# FairMQ: fair::mq Namespace Reference

fair::mq Namespace Reference

Tools for interfacing containers to the transport via polymorphic allocators. More...

## Namespaces

| shmem

## Classes

struct | Alignment
class | ChannelResource
struct | DeviceErrorState
class | DeviceRunner
| Utility class to facilitate a convenient top-level device launch/shutdown. More...
struct | ErrorCategory
struct | Event
class | EventManager
| Manages event callbacks from different subscribers. More...
class | FairMQMemoryResource
struct | MessageBadAlloc
struct | MessageError
struct | OngoingTransition
struct | ParserError
class | Plugin
| Base class for FairMQ plugins. More...
class | PluginManager
| manages and owns plugin instances More...
class | PluginServices
| Facilitates communication between devices and plugins. More...
struct | PollerError
class | ProgOptions
struct | PropertyChange
struct | PropertyChangeAsString
class | PropertyHelper
struct | PropertyNotFoundError
struct | SocketError
class | StateMachine
class | StateQueue
struct | TransportError
struct | TransportFactoryError

## Typedefs

using | Message = FairMQMessage
using | MessagePtr = FairMQMessagePtr
using | Poller = FairMQPoller
using | PollerPtr = FairMQPollerPtr
using | Socket = FairMQSocket
using | SocketPtr = FairMQSocketPtr
using | TransportFactory = FairMQTransportFactory
using | RegionCallback = FairMQRegionCallback
using | RegionBulkCallback = FairMQRegionBulkCallback
using | RegionEventCallback = FairMQRegionEventCallback
using | RegionEvent = FairMQRegionEvent
using | RegionInfo = FairMQRegionInfo
using | RegionBlock = FairMQRegionBlock
using | UnmanagedRegion = FairMQUnmanagedRegion
using | UnmanagedRegionPtr = FairMQUnmanagedRegionPtr
using | byte = unsigned char
using | BytePmrAllocator = pmr::polymorphic_allocator< fair::mq::byte >
using | Property = boost::any
using | Properties = std::map< std::string, Property >

## Enumerations

enum | TransferCode : int { success = 0, error = -1, timeout = -2, interrupted = -3 }
enum | ErrorCode { OperationInProgress = 10, OperationTimeout, OperationCanceled, DeviceChangeStateFailed, DeviceGetPropertiesFailed, DeviceSetPropertiesFailed }
enum | State : int { Undefined = 0, Ok, Error, Idle, InitializingDevice, Initialized, Binding, Bound, Connecting, DeviceReady, InitializingTask, Ready, Running, ResettingTask, ResettingDevice, Exiting }
enum | Transition : int { Auto = 0, InitDevice, CompleteInit, Bind, Connect, InitTask, Run, Stop, ResetTask, ResetDevice, End, ErrorFound }
enum | channelOptionKeyIds { NAME = 0, TYPE, METHOD, ADDRESS, TRANSPORT, SNDBUFSIZE, RCVBUFSIZE, SNDKERNELSIZE, RCVKERNELSIZE, LINGER, RATELOGGING, PORTRANGEMIN, PORTRANGEMAX, AUTOBIND, NUMSOCKETS, lastsocketkey }
enum | Transport { DEFAULT, ZMQ, SHM, OFI }

## Functions

fair::mq::Properties | PtreeParser (const ptree &pt, const string &id)
fair::mq::Properties | JSONParser (const string &filename, const string &deviceId)
fair::mq::Properties | PtreeParser (const boost::property_tree::ptree &pt, const std::string &deviceId)
fair::mq::Properties | JSONParser (const std::string &filename, const std::string &deviceId)
template<typename ContainerT >
FairMQMessagePtr | getMessage (ContainerT &&container_, FairMQMemoryResource *targetResource=nullptr)
ValInfo | ConvertVarValToValInfo (const po::variable_value &v)
string | ConvertVarValToString (const po::variable_value &v)
template<class T >
ostream & | operator<< (ostream &os, const vector< T > &v)
ostream & | operator<< (ostream &os, const vector< signed char > &v)
ostream & | operator<< (ostream &os, const vector< unsigned char > &v)
template<typename T >
pair< string, string > | getString (const boost::any &v, const string &label)
template<typename T >
pair< string, string > | getStringPair (const boost::any &v, const string &label)
std::error_code | MakeErrorCode (ErrorCode e)
string | GetStateName (const State state)
string | GetTransitionName (const Transition transition)
State | GetState (const string &state)
Transition | GetTransition (const string &transition)
State | GetState (const std::string &state)
Transition | GetTransition (const std::string &transition)
std::ostream & | operator<< (std::ostream &os, const State &state)
std::ostream & | operator<< (std::ostream &os, const Transition &transition)
Properties | SuboptParser (const vector< string > &channelConfig, const string &deviceId)
Properties | SuboptParser (const std::vector< std::string > &channelConfig, const std::string &deviceId)
std::string | TransportName (Transport transport)
Transport | TransportType (const std::string &transport)

## Variables

const ErrorCategory | errorCategory {}
array< string, 16 > | stateNames
unordered_map< string, State > | states
array< string, 12 > | transitionNames
unordered_map< string, Transition > | transitions

## Detailed Description

Tools for interfacing containers to the transport via polymorphic allocators.

Author
  Mikolaj Krzewicki, mkrze.nosp@m.wic@.nosp@m.cern..nosp@m.ch

## Function Documentation

## SuboptParser()

Properties fair::mq::SuboptParser | ( | const std::vector< std::string > & | channelConfig,
|  | const std::string & | deviceId
| ) |  |

A parser implementation for FairMQ channel properties. The parser handles a comma separated key=value list format by using the getsubopt function of the standard library.

The option key '–channel-config' can be used with the list of key/value pairs like e.g.

    --channel-config name=output,type=push,method=bind

The FairMQ option parser defines a 'UserParser' function for different formats. Currently it is strictly parsing channel options, but in general the concept is extensible by renaming UserParser to ChannelPropertyParser and introducing additional parser functions.

## Variable Documentation

## stateNames

array<string, 16> fair::mq::stateNames

Initial value:
=
{
{
"UNDEFINED",
"OK",
"ERROR",
"IDLE",
"INITIALIZING DEVICE",
"INITIALIZED",
"BINDING",
"BOUND",
"CONNECTING",
"DEVICE READY",
"INITIALIZING TASK",
"READY",
"RUNNING",
"RESETTING TASK",
"RESETTING DEVICE",
"EXITING"
}
}

## states

unordered_map<string, State> fair::mq::states

Initial value:
=
{
{ "UNDEFINED", State::Undefined },
{ "OK", State::Ok },
{ "ERROR", State::Error },
{ "IDLE", State::Idle },
{ "INITIALIZING DEVICE", State::InitializingDevice },
{ "INITIALIZED", State::Initialized },
{ "BINDING", State::Binding },
{ "BOUND", State::Bound },
{ "CONNECTING", State::Connecting },
{ "DEVICE READY", State::DeviceReady },
{ "INITIALIZING TASK", State::InitializingTask },
{ "READY", State::Ready },
{ "RUNNING", State::Running },
{ "RESETTING TASK", State::ResettingTask },
{ "RESETTING DEVICE", State::ResettingDevice },
{ "EXITING", State::Exiting }
}

## transitionNames

array<string, 12> fair::mq::transitionNames

Initial value:
=
{
{
"AUTO",
"INIT DEVICE",
"COMPLETE INIT",
"BIND",
"CONNECT",
"INIT TASK",
"RUN",
"STOP",
"RESET TASK",
"RESET DEVICE",
"END",
"ERROR FOUND"
}
}

## transitions

unordered_map<string, Transition> fair::mq::transitions

Initial value:
=
{
{ "AUTO", Transition::Auto },
{ "INIT DEVICE", Transition::InitDevice },
{ "COMPLETE INIT", Transition::CompleteInit },
{ "BIND", Transition::Bind },
{ "CONNECT", Transition::Connect },
{ "INIT TASK", Transition::InitTask },
{ "RUN", Transition::Run },
{ "STOP", Transition::Stop },
{ "RESET TASK", Transition::ResetTask },
{ "RESET DEVICE", Transition::ResetDevice },
{ "END", Transition::End },
{ "ERROR FOUND", Transition::ErrorFound }
}

privacy