|
Robot Raconteur Core C++ Library
|
Setup a node using specified options and manage node lifecycle. More...
#include <NodeSetup.h>
Public Member Functions | |
| RobotRaconteurNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, uint32_t flags) | |
| Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, and flags. | |
| RobotRaconteurNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, uint32_t flags, uint32_t allowed_overrides, int argc, char *argv[]) | |
| Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, flags, and command line options. | |
| RobotRaconteurNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, uint32_t flags, uint32_t allowed_overrides, const std::vector< std::string > &args) | |
| Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, flags, and command line options. | |
| RobotRaconteurNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const boost::shared_ptr< CommandLineConfigParser > &config) | |
| Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, and command line parser object. | |
| boost::shared_ptr< LocalTransport > | GetLocalTransport () |
| Get the LocalTransport. | |
| boost::shared_ptr< TcpTransport > | GetTcpTransport () |
| Get the TcpTransport. | |
| boost::shared_ptr< HardwareTransport > | GetHardwareTransport () |
| Get the HardwareTransport. | |
| boost::shared_ptr< IntraTransport > | GetIntraTransport () |
| Get the IntraTransport. | |
| boost::shared_ptr< CommandLineConfigParser > | GetCommandLineConfig () |
| Get the command line config parser object used to configure node. | |
| void | ReleaseNode () |
| Release the node from lifecycle management. | |
Setup a node using specified options and manage node lifecycle.
RobotRaconteurNodeSetup and its subclasses ClientNodeSetup, ServerNodeSetup, and SecureServerNodeSetup are designed to help configure nodes and manage node lifecycles. The node setup classes use RAII to configure the node on construction, and call RobotRaconteurNode::Shutdown() when the instance is destroyed. The node setup can be created on the stack of main() for fully automatic lifecycle management, or stored as a class instance variable in a shared_ptr to be destroyed when the node is no longer needed.
The node setup classes execute the following operations to configure the node:
See Command Line Options for more information on available command line options.
Logging level is configured using the environmental variable ROBOTRACONTEUR_LOG_LEVEL or the command line option --robotraconteur-log-level. See logging.md for more information.
See taps.md for more information on using taps.
The node setup classes optionally initialize LocalTransport, TcpTransport, HardwareTransport, and/or IntraTransport. transports.md for more information.
The LocalTransport::StartServerAsNodeName() or LocalTransport::StartClientAsNodeName() are used to load the NodeID. See LocalTransport for more information on this procedure.
| RobotRaconteur::RobotRaconteurNodeSetup::RobotRaconteurNodeSetup | ( | const boost::shared_ptr< RobotRaconteurNode > & | node, |
| const std::vector< boost::shared_ptr< ServiceFactory > > & | service_types, | ||
| const std::string & | node_name, | ||
| uint16_t | tcp_port, | ||
| uint32_t | flags ) |
Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, and flags.
Construct node setup and configure the specified node. Use this overload if no command line options are provided.
service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.
tcp_port is ignored if RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_START_SERVER is not set in flags
| node | The node to configure and manage lifecycle |
| service_types | The service types to register. |
| node_name | The NodeName |
| tcp_port | The port to listen for incoming TCP clients |
| flags | The configuration flags |
| RobotRaconteur::RobotRaconteurNodeSetup::RobotRaconteurNodeSetup | ( | const boost::shared_ptr< RobotRaconteurNode > & | node, |
| const std::vector< boost::shared_ptr< ServiceFactory > > & | service_types, | ||
| const std::string & | node_name, | ||
| uint16_t | tcp_port, | ||
| uint32_t | flags, | ||
| uint32_t | allowed_overrides, | ||
| int | argc, | ||
| char * | argv[] ) |
Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, flags, and command line options.
Construct node setup and configure the specified node. Use this overload if command line options are provided.
service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.
tcp_port is ignored if RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_START_SERVER is not set in flags or using command line options
| node | The node to configure and manage lifecycle |
| service_types | The service types to register. |
| node_name | The NodeName |
| tcp_port | The port to listen for incoming TCP clients |
| flags | The configuration flags |
| allowed_overrides | The allowed override flags |
| argc | The number of command line arguments in argv vector |
| argv | The command line argument vector |
| RobotRaconteur::RobotRaconteurNodeSetup::RobotRaconteurNodeSetup | ( | const boost::shared_ptr< RobotRaconteurNode > & | node, |
| const std::vector< boost::shared_ptr< ServiceFactory > > & | service_types, | ||
| const std::string & | node_name, | ||
| uint16_t | tcp_port, | ||
| uint32_t | flags, | ||
| uint32_t | allowed_overrides, | ||
| const std::vector< std::string > & | args ) |
Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, flags, and command line options.
Construct node setup and configure the specified node. Use this overload if command line options are provided.
service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.
tcp_port is ignored if RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_START_SERVER is not set in flags or using command line options
| node | The node to configure and manage lifecycle |
| service_types | The service types to register. |
| node_name | The NodeName |
| tcp_port | The port to listen for incoming TCP clients |
| flags | The configuration flags |
| allowed_overrides | The allowed override flags |
| args | The command line arguments as an STL vector |
| RobotRaconteur::RobotRaconteurNodeSetup::RobotRaconteurNodeSetup | ( | const boost::shared_ptr< RobotRaconteurNode > & | node, |
| const std::vector< boost::shared_ptr< ServiceFactory > > & | service_types, | ||
| const boost::shared_ptr< CommandLineConfigParser > & | config ) |
Construct a new RobotRaconteurNodeSetup with node, NodeName TCP port, and command line parser object.
Construct node setup and configure the specified node. Use this overload if command line options parser object is used.
service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.
tcp_port is ignored if RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_START_SERVER is not set in flags or using command line options
CommandLineConfigParser must be fully executed by calling CommandLineConfigParser::ParseCommandLine() or CommandLineConfigParser::AcceptParsedResult()
| node | The node to configure and manage lifecycle |
| service_types | The service types to register. |
| node_name | The NodeName |
| tcp_port | The port to listen for incoming TCP clients |
| config | The command line config parser object |
| boost::shared_ptr< CommandLineConfigParser > RobotRaconteur::RobotRaconteurNodeSetup::GetCommandLineConfig | ( | ) |
Get the command line config parser object used to configure node.
| boost::shared_ptr< HardwareTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetHardwareTransport | ( | ) |
Get the HardwareTransport.
Will be null if HardwareTransport is not specified in flags
Note: Hardware transport is not enabled by default
| boost::shared_ptr< IntraTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetIntraTransport | ( | ) |
Get the IntraTransport.
Will be null if IntraTransport is not specified in flags
| boost::shared_ptr< LocalTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetLocalTransport | ( | ) |
Get the LocalTransport.
Will be null if LocalTransport is not specified in flags
| boost::shared_ptr< TcpTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetTcpTransport | ( | ) |
Get the TcpTransport.
Will be null if TcpTransport is not specified in flags
| void RobotRaconteur::RobotRaconteurNodeSetup::ReleaseNode | ( | ) |
Release the node from lifecycle management.
If called, RobotRaconteurNode::Shutdown() will not be called when the node setup instance is destroyed