OctopOS  0.6.0
Data communication bus for SPACE HAUC
Public Member Functions | List of all members
publisher< T > Class Template Reference

#include <publisher.h>

Inheritance diagram for publisher< T >:
tentacle

Public Member Functions

 publisher (std::string _name, key_t message_key)
 
bool publish (T data)
 
- Public Member Functions inherited from tentacle
 tentacle (key_t msg_key)
 
bool write (long type, std::string data)
 
bool write (std::pair< long, std::string > pair)
 

Additional Inherited Members

- Static Public Member Functions inherited from tentacle
static std::pair< long, std::string > read (long type, bool block=true, bool under=false)
 
- Protected Types inherited from tentacle
enum  role_t { SUBSCRIBER, PUBLISHER }
 
- Static Protected Member Functions inherited from tentacle
static long getTempId (role_t role)
 
- Static Protected Attributes inherited from tentacle
static int message_que
 
static intptr_t * shared_data = NULL
 

Detailed Description

template<typename T>
class publisher< T >

This class is used to publish data to a topic specified on construction. The template parameter is the data type of the topic. Inherites from tentacle for IPC communication.

Constructor & Destructor Documentation

◆ publisher()

template<typename T >
publisher< T >::publisher ( std::string  _name,
key_t  message_key 
)
inline

creates a publisher object and registers it with octopOS.

Parameters
_nameThe name of the topic to publish to.
message_keyThe key for the message bus to create a tentacle on.

Member Function Documentation

◆ publish()

template<typename T >
bool publisher< T >::publish ( data)
inline

Updates data in shared memory segment, then tells octopOS to notify subscribers of the newly published data.

Parameters
dataThe data to be published
Returns
true if data published successfully otherwise false.

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