m2etis  0.4
m2etis::sim::PubSubWrapper Class Reference

#include <PubSubWrapper.h>

Public Member Functions

 PubSubWrapper (OmNetCallbackInterface *o, const std::string &ip, const int port, const std::string &known_hostname, const int known_hostport, const std::vector< std::string > &rootList)
 constructor creating wrapper out of simulator More...
 
void subscribe (const pubsub::ChannelName channel, pubsub::BasicDeliverCallbackInterface< SimulationEventType > &callback)
 wrapper for subscribe method of PubSubSystem More...
 
void publish (const pubsub::ChannelName channel, const message::M2Message< SimulationEventType >::Ptr msg) const
 wrapper for publish method of PubSubSystem More...
 
void unsubscribe (const pubsub::ChannelName channel) const
 wrapper for unsubscribe method of PubSubSystem More...
 
message::M2Message< SimulationEventType >::Ptr createMessage (const pubsub::ChannelName channel, const SimulationEventType &v)
 method to create a message for the specified channel with the given payload More...
 
message::NetworkMessage< net::NetworkType< net::OMNET > >::Ptr transformToNetworkMessage (message::M2Message< SimulationEventType >::Ptr msg, const pubsub::ChannelName chan)
 method to create NetworkMessage out of a M2Message More...
 
message::M2Message< SimulationEventType >::Ptr transformToM2etisMessage (message::NetworkMessage< net::NetworkType< net::OMNET >>::Ptr msg, const pubsub::ChannelName chan)
 method to create M2Message out of a NetworkMessage More...
 
pubsub::PubSubSystemEnvironmentpssi ()
 getter for PubSubSystemEnvironment More...
 
void Update ()
 method updating Scheduler for simulator More...
 

Public Attributes

pubsub::PubSubSystem_pubsub
 PubSubSystem being wrapped by this class. More...
 

Detailed Description

Definition at line 44 of file PubSubWrapper.h.

Constructor & Destructor Documentation

m2etis::sim::PubSubWrapper::PubSubWrapper ( OmNetCallbackInterface o,
const std::string &  ip,
const int  port,
const std::string &  known_hostname,
const int  known_hostport,
const std::vector< std::string > &  rootList 
)

constructor creating wrapper out of simulator

Parameters
[in]ocallback in simulator
[in]ipIP of the node
[in]portport of the node
[in]known_hostnameIP of the root node
[in]known_hostportport of the root node

Member Function Documentation

message::M2Message<SimulationEventType>::Ptr m2etis::sim::PubSubWrapper::createMessage ( const pubsub::ChannelName  channel,
const SimulationEventType &  v 
)

method to create a message for the specified channel with the given payload

Parameters
[in]channelchannel for which the message will be created
[in]vpayload of the new message
pubsub::PubSubSystemEnvironment* m2etis::sim::PubSubWrapper::pssi ( )

getter for PubSubSystemEnvironment

void m2etis::sim::PubSubWrapper::publish ( const pubsub::ChannelName  channel,
const message::M2Message< SimulationEventType >::Ptr  msg 
) const

wrapper for publish method of PubSubSystem

Parameters
[in]channelchannel to publish on
[in]msgmessage to be published
void m2etis::sim::PubSubWrapper::subscribe ( const pubsub::ChannelName  channel,
pubsub::BasicDeliverCallbackInterface< SimulationEventType > &  callback 
)

wrapper for subscribe method of PubSubSystem

Parameters
[in]channelchannel to subscribe on
[in]callbackDeliverCallback to be registered for this channel
message::M2Message<SimulationEventType>::Ptr m2etis::sim::PubSubWrapper::transformToM2etisMessage ( message::NetworkMessage< net::NetworkType< net::OMNET >>::Ptr  msg,
const pubsub::ChannelName  chan 
)

method to create M2Message out of a NetworkMessage

Parameters
[in]msgmessage to be transformed
[in]chanchannel for this message
message::NetworkMessage<net::NetworkType<net::OMNET> >::Ptr m2etis::sim::PubSubWrapper::transformToNetworkMessage ( message::M2Message< SimulationEventType >::Ptr  msg,
const pubsub::ChannelName  chan 
)

method to create NetworkMessage out of a M2Message

Parameters
[in]msgmessage to be transformed
[in]chanchannel for this message
void m2etis::sim::PubSubWrapper::unsubscribe ( const pubsub::ChannelName  channel) const

wrapper for unsubscribe method of PubSubSystem

Parameters
[in]channelchannel to unsubscribe off
void m2etis::sim::PubSubWrapper::Update ( )

method updating Scheduler for simulator

Member Data Documentation

pubsub::PubSubSystem* m2etis::sim::PubSubWrapper::_pubsub

PubSubSystem being wrapped by this class.

Definition at line 117 of file PubSubWrapper.h.


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