Node is the fundamental building block of Cyber RT. every module contains and communicates through the node. A module can have different types of communication by defining read/write and/or service/client in a node.
More...
#include <node.h>
|
| virtual | ~Node () |
| |
| const std::string & | Name () const |
| | Get node's name. More...
|
| |
| template<typename MessageT > |
| auto | CreateWriter (const proto::RoleAttributes &role_attr) -> std::shared_ptr< Writer< MessageT >> |
| | Create a Writer with specific message type. More...
|
| |
| template<typename MessageT > |
| auto | CreateWriter (const std::string &channel_name) -> std::shared_ptr< Writer< MessageT >> |
| | Create a Writer with specific message type. More...
|
| |
| template<typename MessageT > |
| auto | CreateReader (const std::string &channel_name, const CallbackFunc< MessageT > &reader_func=nullptr) -> std::shared_ptr< cyber::Reader< MessageT >> |
| | Create a Reader with specific message type with channel name qos and other configs used will be default. More...
|
| |
| template<typename MessageT > |
| auto | CreateReader (const ReaderConfig &config, const CallbackFunc< MessageT > &reader_func=nullptr) -> std::shared_ptr< cyber::Reader< MessageT >> |
| | Create a Reader with specific message type with reader config. More...
|
| |
| template<typename MessageT > |
| auto | CreateReader (const proto::RoleAttributes &role_attr, const CallbackFunc< MessageT > &reader_func=nullptr) -> std::shared_ptr< cyber::Reader< MessageT >> |
| | Create a Reader object with RoleAttributes More...
|
| |
| template<typename Request , typename Response > |
| auto | CreateService (const std::string &service_name, const typename Service< Request, Response >::ServiceCallback &service_callback) -> std::shared_ptr< Service< Request, Response >> |
| | Create a Service object with specific service_name More...
|
| |
| template<typename Request , typename Response > |
| auto | CreateClient (const std::string &service_name) -> std::shared_ptr< Client< Request, Response >> |
| | Create a Client object to request Service with service_name More...
|
| |
| void | Observe () |
| | Observe all readers' data. More...
|
| |
| void | ClearData () |
| | clear all readers' data More...
|
| |
| template<typename MessageT > |
| auto | GetReader (const std::string &channel_name) -> std::shared_ptr< Reader< MessageT >> |
| | Get the Reader object that subscribe channel_name More...
|
| |
Node is the fundamental building block of Cyber RT. every module contains and communicates through the node. A module can have different types of communication by defining read/write and/or service/client in a node.
- Warning
- Duplicate name is not allowed in topo objects, such as node, reader/writer, service/clinet in the topo.
◆ ~Node()
| virtual apollo::cyber::Node::~Node |
( |
| ) |
|
|
virtual |
◆ ClearData()
| void apollo::cyber::Node::ClearData |
( |
| ) |
|
◆ CreateClient()
template<typename Request , typename Response >
| auto Node::CreateClient |
( |
const std::string & |
service_name | ) |
-> std::shared_ptr<Client<Request, Response>> |
Create a Client object to request Service with service_name
- Template Parameters
-
| Request | Message Type of the Request |
| Response | Message Type of the Response |
- Parameters
-
| service_name | specific service name to a Service |
- Returns
- std::shared_ptr<Client<Request, Response>> result
Client
◆ CreateReader() [1/3]
template<typename MessageT >
| auto Node::CreateReader |
( |
const std::string & |
channel_name, |
|
|
const CallbackFunc< MessageT > & |
reader_func = nullptr |
|
) |
| -> std::shared_ptr<cyber::Reader<MessageT>> |
Create a Reader with specific message type with channel name qos and other configs used will be default.
- Template Parameters
-
- Parameters
-
| channel_name | the channel of the reader subscribed. |
| reader_func | invoked when message receive invoked when the message is received. |
- Returns
- std::shared_ptr<cyber::Reader<MessageT>> result Reader Object
◆ CreateReader() [2/3]
template<typename MessageT >
Create a Reader with specific message type with reader config.
- Template Parameters
-
- Parameters
-
| config | instance of ReaderConfig, include channel name, qos and pending queue size |
| reader_func | invoked when message receive |
- Returns
- std::shared_ptr<cyber::Reader<MessageT>> result Reader Object
◆ CreateReader() [3/3]
template<typename MessageT >
| auto Node::CreateReader |
( |
const proto::RoleAttributes & |
role_attr, |
|
|
const CallbackFunc< MessageT > & |
reader_func = nullptr |
|
) |
| -> std::shared_ptr<cyber::Reader<MessageT>> |
Create a Reader object with RoleAttributes
- Template Parameters
-
- Parameters
-
| role_attr | instance of RoleAttributes, includes channel name, qos, etc. |
| reader_func | invoked when message receive |
- Returns
- std::shared_ptr<cyber::Reader<MessageT>> result Reader Object
◆ CreateService()
template<typename Request , typename Response >
| auto Node::CreateService |
( |
const std::string & |
service_name, |
|
|
const typename Service< Request, Response >::ServiceCallback & |
service_callback |
|
) |
| -> std::shared_ptr<Service<Request, Response>> |
Create a Service object with specific service_name
- Template Parameters
-
| Request | Message Type of the Request |
| Response | Message Type of the Response |
- Parameters
-
| service_name | specific service name to a serve |
| service_callback | invoked when a service is called |
- Returns
- std::shared_ptr<Service<Request, Response>> result
Service
◆ CreateWriter() [1/2]
template<typename MessageT >
| auto Node::CreateWriter |
( |
const proto::RoleAttributes & |
role_attr | ) |
-> std::shared_ptr<Writer<MessageT>> |
Create a Writer with specific message type.
- Template Parameters
-
- Parameters
-
| role_attr | is a protobuf message RoleAttributes, which includes the channel name and other info. |
- Returns
- std::shared_ptr<Writer<MessageT>> result Writer Object
◆ CreateWriter() [2/2]
template<typename MessageT >
| auto Node::CreateWriter |
( |
const std::string & |
channel_name | ) |
-> std::shared_ptr<Writer<MessageT>> |
Create a Writer with specific message type.
- Template Parameters
-
- Parameters
-
| channel_name | the channel name to be published. |
- Returns
- std::shared_ptr<Writer<MessageT>> result Writer Object
◆ GetReader()
template<typename MessageT >
| auto Node::GetReader |
( |
const std::string & |
channel_name | ) |
-> std::shared_ptr<Reader<MessageT>> |
Get the Reader object that subscribe channel_name
- Template Parameters
-
- Parameters
-
- Returns
- std::shared_ptr<Reader<MessageT>> result reader
◆ Name()
| const std::string& apollo::cyber::Node::Name |
( |
| ) |
const |
Get node's name.
- Warning
- duplicate node name is not allowed in the topo.
◆ Observe()
| void apollo::cyber::Node::Observe |
( |
| ) |
|
Observe all readers' data.
◆ Component
template<typename M0 , typename M1 , typename M2 , typename M3 >
◆ CreateNode
| std::unique_ptr<Node> CreateNode |
( |
const std::string & |
, |
|
|
const std::string & |
|
|
) |
| |
|
friend |
◆ Init
| bool Init |
( |
const char * |
| ) |
|
|
friend |
◆ TimerComponent
The documentation for this class was generated from the following file: