# FairMQ: FairMQTransportFactory Class Reference

FairMQTransportFactory Class Referenceabstract
Inheritance diagram for FairMQTransportFactory:
[legend]

## Public Member Functions

| FairMQTransportFactory (const std::string &id)
auto | GetId () const -> const std::string
fair::mq::ChannelResource * | GetMemoryResource ()
| Get a pointer to the associated polymorphic memory resource.
| operator fair::mq::ChannelResource * ()
virtual FairMQMessagePtr | CreateMessage ()=0
| Create empty FairMQMessage (for receiving) More...
virtual FairMQMessagePtr | CreateMessage (fair::mq::Alignment alignment)=0
| Create empty FairMQMessage (for receiving), align received buffer to specified alignment. More...
virtual FairMQMessagePtr | CreateMessage (const size_t size)=0
| Create new FairMQMessage of specified size. More...
virtual FairMQMessagePtr | CreateMessage (const size_t size, fair::mq::Alignment alignment)=0
| Create new FairMQMessage of specified size and alignment. More...
virtual FairMQMessagePtr | CreateMessage (void *data, const size_t size, fairmq_free_fn *ffn, void *hint=nullptr)=0
| Create new FairMQMessage with user provided buffer and size. More...
virtual FairMQMessagePtr | CreateMessage (FairMQUnmanagedRegionPtr &unmanagedRegion, void *data, const size_t size, void *hint=0)=0
| create a message with the buffer located within the corresponding unmanaged region More...
virtual FairMQSocketPtr | CreateSocket (const std::string &type, const std::string &name)=0
| Create a socket.
virtual FairMQPollerPtr | CreatePoller (const std::vector< FairMQChannel > &channels) const =0
| Create a poller for a single channel (all subchannels)
virtual FairMQPollerPtr | CreatePoller (const std::vector< FairMQChannel * > &channels) const =0
| Create a poller for specific channels.
virtual FairMQPollerPtr | CreatePoller (const std::unordered_map< std::string, std::vector< FairMQChannel >> &channelsMap, const std::vector< std::string > &channelList) const =0
| Create a poller for specific channels (all subchannels)
virtual FairMQUnmanagedRegionPtr | CreateUnmanagedRegion (const size_t size, FairMQRegionCallback callback=nullptr, const std::string &path="", int flags=0)=0
| Create new UnmanagedRegion. More...
virtual FairMQUnmanagedRegionPtr | CreateUnmanagedRegion (const size_t size, FairMQRegionBulkCallback callback=nullptr, const std::string &path="", int flags=0)=0
virtual FairMQUnmanagedRegionPtr | CreateUnmanagedRegion (const size_t size, const int64_t userFlags, FairMQRegionCallback callback=nullptr, const std::string &path="", int flags=0)=0
| Create new UnmanagedRegion. More...
virtual FairMQUnmanagedRegionPtr | CreateUnmanagedRegion (const size_t size, const int64_t userFlags, FairMQRegionBulkCallback callback=nullptr, const std::string &path="", int flags=0)=0
virtual void | SubscribeToRegionEvents (FairMQRegionEventCallback callback)=0
| Subscribe to region events (creation, destruction, ...) More...
virtual bool | SubscribedToRegionEvents ()=0
| Check if there is an active subscription to region events. More...
virtual void | UnsubscribeFromRegionEvents ()=0
| Unsubscribe from region events.
virtual std::vector< FairMQRegionInfo > | GetRegionInfo ()=0
virtual fair::mq::Transport | GetType () const =0
| Get transport type.
virtual void | Interrupt ()=0
virtual void | Resume ()=0
virtual void | Reset ()=0
template<typename T >
FairMQMessagePtr | NewSimpleMessage (const T &data)
template<std::size_t N>
FairMQMessagePtr | NewSimpleMessage (const char(&data)[N])
FairMQMessagePtr | NewSimpleMessage (const std::string &str)
template<typename T >
FairMQMessagePtr | NewStaticMessage (const T &data)
FairMQMessagePtr | NewStaticMessage (const std::string &str)

## Static Public Member Functions

static auto | CreateTransportFactory (const std::string &type, const std::string &id="", const fair::mq::ProgOptions *config=nullptr) -> std::shared_ptr< FairMQTransportFactory >
static void | FairMQNoCleanup (void *, void *)
template<typename T >
static void | FairMQSimpleMsgCleanup (void *, void *obj)

## Constructor & Destructor Documentation

## FairMQTransportFactory()

FairMQTransportFactory::FairMQTransportFactory | ( | const std::string & | id | ) |

ctor

Parameters

  id | Topology wide unique id, usually the device id.

## Member Function Documentation

## CreateMessage() [1/6]

virtual FairMQMessagePtr FairMQTransportFactory::CreateMessage | ( |  | ) |

pure virtual

Create empty FairMQMessage (for receiving)

Returns
  pointer to FairMQMessage

Implemented in fair::mq::shmem::TransportFactory, fair::mq::zmq::TransportFactory, and fair::mq::ofi::TransportFactory.

## CreateMessage() [2/6]

virtual FairMQMessagePtr FairMQTransportFactory::CreateMessage | ( | const size_t | size | ) |

pure virtual

Create new FairMQMessage of specified size.

Parameters

  size | message size

Returns
  pointer to FairMQMessage

Implemented in fair::mq::shmem::TransportFactory, and fair::mq::zmq::TransportFactory.

## CreateMessage() [3/6]

virtual FairMQMessagePtr FairMQTransportFactory::CreateMessage | ( | const size_t | size,
|  | fair::mq::Alignment | alignment
| ) |  |

pure virtual

Create new FairMQMessage of specified size and alignment.

Parameters

  size | message size
  alignment | message alignment

Returns
  pointer to FairMQMessage

Implemented in fair::mq::shmem::TransportFactory, and fair::mq::zmq::TransportFactory.

## CreateMessage() [4/6]

virtual FairMQMessagePtr FairMQTransportFactory::CreateMessage | ( | fair::mq::Alignment | alignment | ) |

pure virtual

Create empty FairMQMessage (for receiving), align received buffer to specified alignment.

Parameters

  alignment | alignment to align received buffer to

Returns
  pointer to FairMQMessage

Implemented in fair::mq::shmem::TransportFactory, fair::mq::zmq::TransportFactory, and fair::mq::ofi::TransportFactory.

## CreateMessage() [5/6]

virtual FairMQMessagePtr FairMQTransportFactory::CreateMessage | ( | FairMQUnmanagedRegionPtr & | unmanagedRegion,
|  | void * | data,
|  | const size_t | size,
|  | void * | hint = `0`
| ) |  |

pure virtual

create a message with the buffer located within the corresponding unmanaged region

Parameters

  unmanagedRegion | the unmanaged region that this message buffer belongs to
  data | message buffer (must be within the region - checked at runtime by the transport)
  size | size of the message
  hint | optional parameter, returned to the user in the FairMQRegionCallback

Implemented in fair::mq::shmem::TransportFactory, and fair::mq::zmq::TransportFactory.

## CreateMessage() [6/6]

virtual FairMQMessagePtr FairMQTransportFactory::CreateMessage | ( | void * | data,
|  | const size_t | size,
|  | fairmq_free_fn * | ffn,
|  | void * | hint = `nullptr`
| ) |  |

pure virtual

Create new FairMQMessage with user provided buffer and size.

Parameters

  data | pointer to user provided buffer
  size | size of the user provided buffer
  ffn | callback, called when the message is transfered (and can be deleted)
  obj | optional helper pointer that can be used in the callback

Returns
  pointer to FairMQMessage

Implemented in fair::mq::shmem::TransportFactory, and fair::mq::zmq::TransportFactory.

## CreateUnmanagedRegion() [1/2]

virtual FairMQUnmanagedRegionPtr FairMQTransportFactory::CreateUnmanagedRegion | ( | const size_t | size,
|  | const int64_t | userFlags,
|  | FairMQRegionCallback | callback = `nullptr`,
|  | const std::string & | path = `""`,
|  | int | flags = `0`
| ) |  |

pure virtual

Create new UnmanagedRegion.

Parameters

  size | size of the region
  userFlags | flags to be stored with the region, have no effect on the transport, but can be retrieved from the region by the user
  callback | callback to be called when a message belonging to this region is no longer needed by the transport
  path | optional parameter to pass to the underlying transport
  flags | optional parameter to pass to the underlying transport

Returns
  pointer to UnmanagedRegion

Implemented in fair::mq::shmem::TransportFactory, fair::mq::ofi::TransportFactory, and fair::mq::zmq::TransportFactory.

## CreateUnmanagedRegion() [2/2]

virtual FairMQUnmanagedRegionPtr FairMQTransportFactory::CreateUnmanagedRegion | ( | const size_t | size,
|  | FairMQRegionCallback | callback = `nullptr`,
|  | const std::string & | path = `""`,
|  | int | flags = `0`
| ) |  |

pure virtual

Create new UnmanagedRegion.

Parameters

  size | size of the region
  callback | callback to be called when a message belonging to this region is no longer needed by the transport
  path | optional parameter to pass to the underlying transport
  flags | optional parameter to pass to the underlying transport

Returns
  pointer to UnmanagedRegion

Implemented in fair::mq::shmem::TransportFactory, fair::mq::ofi::TransportFactory, and fair::mq::zmq::TransportFactory.

## SubscribedToRegionEvents()

virtual bool FairMQTransportFactory::SubscribedToRegionEvents | ( |  | ) |

pure virtual

Check if there is an active subscription to region events.

Returns
  true/false

Implemented in fair::mq::shmem::TransportFactory, fair::mq::zmq::TransportFactory, and fair::mq::ofi::TransportFactory.

## SubscribeToRegionEvents()

virtual void FairMQTransportFactory::SubscribeToRegionEvents | ( | FairMQRegionEventCallback | callback | ) |

pure virtual

Subscribe to region events (creation, destruction, ...)

Parameters

  callback | the callback that is called when a region event occurs

Implemented in fair::mq::ofi::TransportFactory, fair::mq::shmem::TransportFactory, and fair::mq::zmq::TransportFactory.

The documentation for this class was generated from the following files:

- fairmq/FairMQTransportFactory.h
- fairmq/FairMQTransportFactory.cxx

privacy