31 #include <boost/assign/list_of.hpp>
32 #include <boost/program_options.hpp>
38 namespace RobotRaconteur
140 RobotRaconteurNodeSetupFlags_CLIENT_DEFAULT_ALLOWED_OVERRIDE = 0x7D33E5D,
265 boost::program_options::options_description desc;
266 boost::program_options::variables_map vm;
269 std::string default_node_name;
270 uint16_t default_tcp_port;
271 uint32_t default_flags;
282 const std::string& prefix =
"robotraconteur-");
304 void SetDefaults(
const std::string& node_name, uint16_t tcp_port, uint32_t default_flags);
460 RR_SHARED_PTR<TcpTransport> tcp_transport;
461 RR_SHARED_PTR<LocalTransport> local_transport;
462 RR_SHARED_PTR<HardwareTransport> hardware_transport;
463 RR_SHARED_PTR<IntraTransport> intra_transport;
464 RR_SHARED_PTR<RobotRaconteurNode> node;
465 RR_SHARED_PTR<CommandLineConfigParser> config;
469 void DoSetup(
const RR_SHARED_PTR<RobotRaconteurNode>& node,
470 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
471 const RR_SHARED_PTR<CommandLineConfigParser>& config);
491 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
492 const std::string& node_name, uint16_t tcp_port, uint32_t flags);
515 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
516 const std::string& node_name, uint16_t tcp_port, uint32_t flags, uint32_t allowed_overrides,
517 int argc,
char* argv[]);
539 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
540 const std::string& node_name, uint16_t tcp_port, uint32_t flags, uint32_t allowed_overrides,
541 const std::vector<std::string>& args);
564 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
565 const RR_SHARED_PTR<CommandLineConfigParser>& config);
679 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name =
"",
680 uint32_t flags = RobotRaconteurNodeSetupFlags_CLIENT_DEFAULT);
694 ClientNodeSetup(
const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name =
"",
695 uint32_t flags = RobotRaconteurNodeSetupFlags_CLIENT_DEFAULT);
710 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
int argc,
726 ClientNodeSetup(
const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
int argc,
741 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
742 const std::vector<std::string>& args);
757 const std::vector<std::string>& args);
825 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name,
826 uint16_t tcp_port = 0, uint32_t flags = RobotRaconteurNodeSetupFlags_SERVER_DEFAULT);
841 ServerNodeSetup(
const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name,
842 uint16_t tcp_port = 0, uint32_t flags = RobotRaconteurNodeSetupFlags_SERVER_DEFAULT);
859 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name,
860 uint16_t tcp_port,
int argc,
char* argv[]);
875 ServerNodeSetup(
const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name,
876 uint16_t tcp_port,
int argc,
char* argv[]);
892 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name,
893 uint16_t tcp_port,
const std::vector<std::string>& args);
907 ServerNodeSetup(
const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
const std::string& node_name,
908 uint16_t tcp_port,
const std::vector<std::string>& args);
978 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
979 const std::string& node_name, uint16_t tcp_port = 0,
980 uint32_t flags = RobotRaconteurNodeSetupFlags_SECURE_SERVER_DEFAULT);
996 const std::string& node_name, uint16_t tcp_port = 0,
997 uint32_t flags = RobotRaconteurNodeSetupFlags_SECURE_SERVER_DEFAULT);
1015 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
1016 const std::string& node_name, uint16_t tcp_port,
int argc,
1034 const std::string& node_name, uint16_t tcp_port,
int argc,
1052 const std::vector<RR_SHARED_PTR<ServiceFactory> >& service_types,
1053 const std::string& node_name, uint16_t tcp_port,
const std::vector<std::string>& args);
1069 const std::string& node_name, uint16_t tcp_port,
const std::vector<std::string>& args);
RobotRaconteurNodeSetupFlags
Setup option flags.
Definition: NodeSetup.h:61
@ RobotRaconteurNodeSetupFlags_LOCAL_TAP_NAME
Allow the user to set the LocalTap name.
Definition: NodeSetup.h:119
@ RobotRaconteurNodeSetupFlags_NODEID_OVERRIDE
Allow NodeID to be configured using command line options.
Definition: NodeSetup.h:100
@ RobotRaconteurNodeSetupFlags_NONE
No options enabled.
Definition: NodeSetup.h:63
@ RobotRaconteurNodeSetupFlags_JUMBO_MESSAGE
Enable jumbo messages (up to 100 MB per message)
Definition: NodeSetup.h:122
@ RobotRaconteurNodeSetupFlags_SERVER_DEFAULT
Default configuration for server nodes.
Definition: NodeSetup.h:156
@ RobotRaconteurNodeSetupFlags_ENABLE_TCP_TRANSPORT
Enable TcpTransport.
Definition: NodeSetup.h:71
@ RobotRaconteurNodeSetupFlags_DISABLE_MESSAGE4
Disable Message Format Version 4 on all transports.
Definition: NodeSetup.h:83
@ RobotRaconteurNodeSetupFlags_CLIENT_DEFAULT
Default configuration for client nodes (See ClientNodeSetup)
Definition: NodeSetup.h:132
@ RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_IPV4_DISCOVERY
Enable TcpTransport IPv4 discovery.
Definition: NodeSetup.h:112
@ RobotRaconteurNodeSetupFlags_SECURE_SERVER_DEFAULT_ALLOWED_OVERRIDE
Default allowed overrides for server nodes requiring TLS network transports.
Definition: NodeSetup.h:209
@ RobotRaconteurNodeSetupFlags_ENABLE_NODE_ANNOUNCE
Enable node announce on all transports.
Definition: NodeSetup.h:67
@ RobotRaconteurNodeSetupFlags_SERVER_DEFAULT_ALLOWED_OVERRIDE
Default allowed overrides for server nodes.
Definition: NodeSetup.h:169
@ RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_START_SERVER_PORT_SHARER
Start the TcpTransport server to incoming for incoming clients using the port sharer.
Definition: NodeSetup.h:81
@ RobotRaconteurNodeSetupFlags_ENABLE_LOCAL_TRANSPORT
Enable LocalTransport.
Definition: NodeSetup.h:69
@ RobotRaconteurNodeSetupFlags_LOCAL_TAP_ENABLE
Enable the LocalTap debug logging system.
Definition: NodeSetup.h:117
@ RobotRaconteurNodeSetupFlags_ENABLE_INTRA_TRANSPORT
Enable IntraTransport.
Definition: NodeSetup.h:107
@ RobotRaconteurNodeSetupFlags_LOCAL_TRANSPORT_START_CLIENT
Start the LocalTransport client with specified node name.
Definition: NodeSetup.h:77
@ RobotRaconteurNodeSetupFlags_ENABLE_ALL_TRANSPORTS
Convenience flag to enable all transports.
Definition: NodeSetup.h:125
@ RobotRaconteurNodeSetupFlags_DISABLE_TIMEOUTS
Disable all timeouts (useful for debugging)
Definition: NodeSetup.h:87
@ RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_LISTEN_LOCALHOST
Only listen on localhost connections for TcpTransport.
Definition: NodeSetup.h:95
@ RobotRaconteurNodeSetupFlags_TCP_WEBSOCKET_ORIGIN_OVERRIDE
Allow TCP WebSocket origin control to be configured using command line options.
Definition: NodeSetup.h:104
@ RobotRaconteurNodeSetupFlags_LOAD_TLS_CERT
Load the TLS certificate for TcpTransport.
Definition: NodeSetup.h:89
@ RobotRaconteurNodeSetupFlags_ENABLE_NODE_DISCOVERY_LISTENING
Enable node discovery listening on all transports.
Definition: NodeSetup.h:65
@ RobotRaconteurNodeSetupFlags_LOCAL_TRANSPORT_START_SERVER
Start the LocalTransport server to listen for incoming clients.
Definition: NodeSetup.h:75
@ RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_START_SERVER
Start the TcpTransport server to listen for incoming clients on the specified port.
Definition: NodeSetup.h:79
@ RobotRaconteurNodeSetupFlags_ENABLE_HARDWARE_TRANSPORT
Enable HardwareTransport.
Definition: NodeSetup.h:73
@ RobotRaconteurNodeSetupFlags_NODENAME_OVERRIDE
Allow NodeName to be configured using command line options.
Definition: NodeSetup.h:98
@ RobotRaconteurNodeSetupFlags_TCP_TRANSPORT_IPV6_DISCOVERY
Enable TcpTransport IPv6 discovery.
Definition: NodeSetup.h:114
@ RobotRaconteurNodeSetupFlags_DISABLE_STRINGTABLE
Disable Message Format Version 4 string table on all transports.
Definition: NodeSetup.h:85
@ RobotRaconteurNodeSetupFlags_INTRA_TRANSPORT_START_SERVER
Start the IntraTransport server to listen for incoming clients.
Definition: NodeSetup.h:109
@ RobotRaconteurNodeSetupFlags_LOCAL_TRANSPORT_SERVER_PUBLIC
Make LocalTransport server listen for incoming clients from all users.
Definition: NodeSetup.h:93
@ RobotRaconteurNodeSetupFlags_TCP_PORT_OVERRIDE
Allow TCP port to be configured using command line options.
Definition: NodeSetup.h:102
@ RobotRaconteurNodeSetupFlags_REQUIRE_TLS
Require TLS for all clients on TcpTransport.
Definition: NodeSetup.h:91
@ RobotRaconteurNodeSetupFlags_SECURE_SERVER_DEFAULT
Default configuration for server nodes requiring TLS network transports.
Definition: NodeSetup.h:194
Initializes a RobotRaconteurNode instance to default configuration for a client only node.
Definition: NodeSetup.h:666
ClientNodeSetup(const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::vector< std::string > &args)
Construct a new ClientNodeSetup and initialize specified RobotRaconteurNode with command line options...
ClientNodeSetup(const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name="", uint32_t flags=RobotRaconteurNodeSetupFlags_CLIENT_DEFAULT)
Construct a new ClientNodeSetup and initialize the singleton RobotRaconteurNode without command line ...
ClientNodeSetup(const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name="", uint32_t flags=RobotRaconteurNodeSetupFlags_CLIENT_DEFAULT)
Construct a new ClientNodeSetup and initialize specified RobotRaconteurNode without command line opti...
ClientNodeSetup(const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, int argc, char *argv[])
Construct a new ClientNodeSetup and initialize the singleton RobotRaconteurNode with command line opt...
ClientNodeSetup(const boost::shared_ptr< RobotRaconteurNode > &node, const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, int argc, char *argv[])
Construct a new ClientNodeSetup and initialize specified RobotRaconteurNode with command line options...
ClientNodeSetup(const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::vector< std::string > &args)
Construct a new ClientNodeSetup and initialize the singleton RobotRaconteurNode with command line opt...
Command line parser for node setup classes.
Definition: NodeSetup.h:264
void SetDefaults(const std::string &node_name, uint16_t tcp_port, uint32_t default_flags)
Set the default NodeName, TCP port, and flags.
std::string GetOptionOrDefaultAsString(const std::string &option)
Get the option value as a string.
bool GetOptionOrDefaultAsBool(const std::string &option)
Get the option value as a bool.
int32_t GetOptionOrDefaultAsInt(const std::string &option)
Get the option value as an int32_t.
void AddIntOption(const std::string &name, const std::string &descr)
Add a new int32_t option.
static void FillOptionsDescription(boost::program_options::options_description &desc, uint32_t allowed_overrides, const std::string &prefix="robotraconteur-")
Fill the specified options_description with standard node command line options.
void AddStringOption(const std::string &name, const std::string &descr)
Add a new string option.
CommandLineConfigParser(uint32_t allowed_overrides, const std::string &prefix="robotraconteur-")
Construct a new CommandLineConfigParser.
void ParseCommandLine(int argc, char *argv[])
Parse a specified argc and argv
std::string GetOptionOrDefaultAsString(const std::string &option, const std::string &default_value)
Get the option value as a string.
void ParseCommandLine(const std::vector< std::string > &args)
Parse a specified string vector containing the options.
int32_t GetOptionOrDefaultAsInt(const std::string &option, int32_t default_value)
Get the option value as an int32_t.
void AcceptParsedResult(const boost::program_options::variables_map &vm)
Accept options from a boost::program_options::variables_map.
void AddBoolOption(const std::string &name, const std::string &descr)
Add a new bool option.
bool GetOptionOrDefaultAsBool(const std::string &option, bool default_value)
Get the option value as a bool.
Setup a node using specified options and manage node lifecycle.
Definition: NodeSetup.h:459
boost::shared_ptr< TcpTransport > GetTcpTransport()
Get the TcpTransport.
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.
boost::shared_ptr< IntraTransport > GetIntraTransport()
Get the IntraTransport.
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...
boost::shared_ptr< CommandLineConfigParser > GetCommandLineConfig()
Get the command line config parser object used to configure node.
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< HardwareTransport > GetHardwareTransport()
Get the HardwareTransport.
boost::shared_ptr< LocalTransport > GetLocalTransport()
Get the LocalTransport.
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...
void ReleaseNode()
Release the node from lifecycle management.
Initializes a RobotRaconteurNode instance to default configuration for a secure server and client nod...
Definition: NodeSetup.h:963
SecureServerNodeSetup(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 SecureServerNodeSetup and initialize the singleton RobotRaconteurNode with command li...
SecureServerNodeSetup(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 SecureServerNodeSetup and initialize specified RobotRaconteurNode with command line o...
SecureServerNodeSetup(const std::vector< boost::shared_ptr< ServiceFactory > > &service_types, const std::string &node_name, uint16_t tcp_port=0, uint32_t flags=RobotRaconteurNodeSetupFlags_SECURE_SERVER_DEFAULT)
Construct a new SecureServerNodeSetup and initialize the singleton RobotRaconteurNode without command...
SecureServerNodeSetup(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 SecureServerNodeSetup and initialize specified RobotRaconteurNode with command line o...
SecureServerNodeSetup(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_SECURE_SERVER_DEFAULT)
Construct a new SecureServerNodeSetup and initialize specified RobotRaconteurNode without command lin...
SecureServerNodeSetup(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 SecureServerNodeSetup and initialize the singleton RobotRaconteurNode with command li...
Initializes a RobotRaconteurNode instance to default configuration for a server and client node.
Definition: NodeSetup.h:811
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 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 opti...
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 ...
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 opt...
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 opt...