Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::ServerNodeSetup Class Reference

Initializes a RobotRaconteurNode instance to default configuration for a server and client node. More...

#include <NodeSetup.h>

Inheritance diagram for RobotRaconteur::ServerNodeSetup:
RobotRaconteur::RobotRaconteurNodeSetup

Public Member Functions

 ServerNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port=0, uint32_t flags=RobotRaconteurNodeSetupFlags_SERVER_DEFAULT)
 Construct a new ServerNodeSetup and initialize specified RobotRaconteurNode without command line options.
 ServerNodeSetup (const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port=0, uint32_t flags=RobotRaconteurNodeSetupFlags_SERVER_DEFAULT)
 Construct a new ServerNodeSetup and initialize the singleton RobotRaconteurNode without command line options.
 ServerNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, int argc, char *argv[])
 Construct a new ServerNodeSetup and initialize specified RobotRaconteurNode with command line options.
 ServerNodeSetup (const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, int argc, char *argv[])
 Construct a new ServerNodeSetup and initialize the singleton RobotRaconteurNode with command line options.
 ServerNodeSetup (const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, const std::vector< std::string > &args)
 Construct a new ServerNodeSetup and initialize specified RobotRaconteurNode with command line options.
 ServerNodeSetup (const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port, const std::vector< std::string > &args)
 Construct a new ServerNodeSetup and initialize the singleton RobotRaconteurNode with command line options.
boost::shared_ptr< LocalTransportGetLocalTransport ()
 Get the LocalTransport.
boost::shared_ptr< TcpTransportGetTcpTransport ()
 Get the TcpTransport.
boost::shared_ptr< HardwareTransportGetHardwareTransport ()
 Get the HardwareTransport.
boost::shared_ptr< IntraTransportGetIntraTransport ()
 Get the IntraTransport.
boost::shared_ptr< CommandLineConfigParserGetCommandLineConfig ()
 Get the command line config parser object used to configure node.
void ReleaseNode ()
 Release the node from lifecycle management.

Detailed Description

Initializes a RobotRaconteurNode instance to default configuration for a server and client node.

ServerNodeSetup is a subclass of RobotRaconteurNodeSetup providing default configuration for a RobotRaconteurNode instance that is used as a server to accept incoming client connections and to initiate client connections.

ServerNodeSetup requires a NodeName, and a TCP port if LocalTransport and TcpTransport are enabled (default behavior).

See Command Line Options for more information on available command line options.

Note: String table and HardwareTransport are disabled by default. They can be enabled using command line options.

By default, the configuration will do the following:

  1. Configure logging level from environmental variable or command line options. Defaults to INFO if not specified
  2. Configure tap if specified in command line options
  3. Register service types passed to service_types
  4. Start LocalTransport (default enabled)
    1. Configure the node to use the specified NodeName, and load the NodeID from the filesystem based based on the NodeName. NodeID will be automatically generated if not previously used.
      1. If "public" option is set, the transport will listen for all local users (default disabled)
    2. Start the LocalTransport server to listen for incoming connections with the specified NodeName and NodeID
    3. Start LocalTransport discovery announce and listening (default enabled)
    4. Disable Message Format Version 4 (default enabled) and/or String Table (default disabled) if specified on command line
  5. Start TcpTransport (default enabled)
    1. Start the TcpTransport server to listen for incoming connections on specified port or using the port sharer (default enabled using specified port)
    2. Disable Message Format Version 4 (default enabled) and/or String Table (default disabled) if specified in flags or command line
    3. Start TcpTranport discovery announce and listening (default enabled)
    4. Load TLS certificate and set if TLS is specified on command line (default disabled)
    5. Process WebSocket origin command line options
  6. Start HardwareTransport (default disabled)
    1. Disable Message Format Version 4 (default enabled) and/or String Table (default disabled) if specified in flags or command line
  7. Start IntraTransport (default enabled)
    1. Enable IntraTransport server to listen for incoming clients (default enabled)
    2. Disable Message Format Version 4 (default enabled) and/or String Table (default disabled) if specified in flags or command line
  8. Disable timeouts if specified in flags or command line (default timeouts normal)

Most users will not need to be concerned with these details, and can simply use the default configuration.

Constructor & Destructor Documentation

◆ ServerNodeSetup() [1/6]

RobotRaconteur::ServerNodeSetup::ServerNodeSetup ( const boost::shared_ptr< RobotRaconteurNode > & node,
const std::vector< boost::shared_ptr< ServiceFactory > > & service_types,
const std::string & node_name,
uint16_t tcp_port = 0,
uint32_t flags = RobotRaconteurNodeSetupFlags_SERVER_DEFAULT )

Construct a new ServerNodeSetup and initialize specified RobotRaconteurNode without command line options.

service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.

Parameters
nodeThe node to configure and manage lifecycle
service_typesThe service types to register
node_nameThe node name for LocalTransport and RobotRaconteurNode
tcp_portThe port to listen on for TcpTransport
flagsThe node configuration flags

◆ ServerNodeSetup() [2/6]

RobotRaconteur::ServerNodeSetup::ServerNodeSetup ( const std::vector< boost::shared_ptr< ServiceFactory > > & service_types,
const std::string & node_name,
uint16_t tcp_port = 0,
uint32_t flags = RobotRaconteurNodeSetupFlags_SERVER_DEFAULT )

Construct a new ServerNodeSetup and initialize the singleton RobotRaconteurNode without command line options.

Configures RobotRaconteurNode::s() and manages its lifecycle

service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.

Parameters
service_typesThe service types to register
node_nameThe node name for LocalTransport and RobotRaconteurNode
tcp_portThe port to listen on for TcpTransport
flagsThe node configuration flags

◆ ServerNodeSetup() [3/6]

RobotRaconteur::ServerNodeSetup::ServerNodeSetup ( const boost::shared_ptr< RobotRaconteurNode > & node,
const std::vector< boost::shared_ptr< ServiceFactory > > & service_types,
const std::string & node_name,
uint16_t tcp_port,
int argc,
char * argv[] )

Construct a new ServerNodeSetup and initialize specified RobotRaconteurNode with command line options.

service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.

See Command Line Options for more information on available command line options.

Parameters
nodeThe node to configure and manage lifecycle
service_typesThe service types to register
node_nameThe node name for LocalTransport and RobotRaconteurNode
tcp_portThe port to listen on for TcpTransport
argcThe number of command line arguments in argv vector
argvThe command line argument vector

◆ ServerNodeSetup() [4/6]

RobotRaconteur::ServerNodeSetup::ServerNodeSetup ( const std::vector< boost::shared_ptr< ServiceFactory > > & service_types,
const std::string & node_name,
uint16_t tcp_port,
int argc,
char * argv[] )

Construct a new ServerNodeSetup and initialize the singleton RobotRaconteurNode with command line options.

service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.

See Command Line Options for more information on available command line options.

Parameters
service_typesThe service types to register
node_nameThe node name for LocalTransport and RobotRaconteurNode
tcp_portThe port to listen on for TcpTransport
argcThe number of command line arguments in argv vector
argvThe command line argument vector

◆ ServerNodeSetup() [5/6]

RobotRaconteur::ServerNodeSetup::ServerNodeSetup ( const boost::shared_ptr< RobotRaconteurNode > & node,
const std::vector< boost::shared_ptr< ServiceFactory > > & service_types,
const std::string & node_name,
uint16_t tcp_port,
const std::vector< std::string > & args )

Construct a new ServerNodeSetup and initialize specified RobotRaconteurNode with command line options.

service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.

See Command Line Options for more information on available command line options.

Parameters
nodeThe node to configure and manage lifecycle
service_typesThe service types to register
node_nameThe node name for LocalTransport and RobotRaconteurNode
tcp_portThe port to listen on for TcpTransport
argsThe command line options as a string vector

◆ ServerNodeSetup() [6/6]

RobotRaconteur::ServerNodeSetup::ServerNodeSetup ( const std::vector< boost::shared_ptr< ServiceFactory > > & service_types,
const std::string & node_name,
uint16_t tcp_port,
const std::vector< std::string > & args )

Construct a new ServerNodeSetup and initialize the singleton RobotRaconteurNode with command line options.

service_types may be ROBOTRACONTEUR_SERVICE_TYPES if "robotraconteur_generated.h" is included.

See Command Line Options for more information on available command line options.

Parameters
service_typesThe service types to register
node_nameThe node name for LocalTransport and RobotRaconteurNode
tcp_portThe port to listen on for TcpTransport
argsThe command line options as a string vector

Member Function Documentation

◆ GetCommandLineConfig()

boost::shared_ptr< CommandLineConfigParser > RobotRaconteur::RobotRaconteurNodeSetup::GetCommandLineConfig ( )
inherited

Get the command line config parser object used to configure node.

Returns
RR_SHARED_PTR<CommandLineConfigParser> The command line config parser

◆ GetHardwareTransport()

boost::shared_ptr< HardwareTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetHardwareTransport ( )
inherited

Get the HardwareTransport.

Will be null if HardwareTransport is not specified in flags

Note: Hardware transport is not enabled by default

Returns
RR_SHARED_PTR<HardwareTransport> The HardwareTransport object

◆ GetIntraTransport()

boost::shared_ptr< IntraTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetIntraTransport ( )
inherited

Get the IntraTransport.

Will be null if IntraTransport is not specified in flags

Returns
RR_SHARED_PTR<IntraTransport> The IntraTransport object

◆ GetLocalTransport()

boost::shared_ptr< LocalTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetLocalTransport ( )
inherited

Get the LocalTransport.

Will be null if LocalTransport is not specified in flags

Returns
RR_SHARED_PTR<LocalTransport> The LocalTransport object

◆ GetTcpTransport()

boost::shared_ptr< TcpTransport > RobotRaconteur::RobotRaconteurNodeSetup::GetTcpTransport ( )
inherited

Get the TcpTransport.

Will be null if TcpTransport is not specified in flags

Returns
RR_SHARED_PTR<TcpTransport> The TcpTransport object

◆ ReleaseNode()

void RobotRaconteur::RobotRaconteurNodeSetup::ReleaseNode ( )
inherited

Release the node from lifecycle management.

If called, RobotRaconteurNode::Shutdown() will not be called when the node setup instance is destroyed


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