All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
ignition::transport::NodeOptions Class Reference

A class for customizing the behavior of the Node. More...

#include <ignition/transport/NodeOptions.hh>

Public Member Functions

 NodeOptions ()
 Constructor. More...
 
 NodeOptions (const NodeOptions &_other)
 Copy constructor. More...
 
virtual ~NodeOptions ()
 Destructor. More...
 
const std::string & NameSpace () const
 Get the namespace used in this node. More...
 
NodeOptionsoperator= (const NodeOptions &_other)
 Assignment operator. More...
 
const std::string & Partition () const
 Get the partition used in this node. More...
 
bool SetNameSpace (const std::string &_ns)
 Set the node's namespace. More...
 
bool SetPartition (const std::string &_partition)
 Set the node's partition name. More...
 

Protected Attributes

std::unique_ptr
< transport::NodeOptionsPrivate
dataPtr
 

Detailed Description

A class for customizing the behavior of the Node.

E.g.: Set a custom namespace or a partition name.

Constructor & Destructor Documentation

ignition::transport::NodeOptions::NodeOptions ( )

Constructor.

ignition::transport::NodeOptions::NodeOptions ( const NodeOptions _other)

Copy constructor.

Parameters
[in]_otherNodeOptions to copy.
virtual ignition::transport::NodeOptions::~NodeOptions ( )
virtual

Destructor.

Member Function Documentation

const std::string& ignition::transport::NodeOptions::NameSpace ( ) const

Get the namespace used in this node.

Returns
The namespace.
See Also
SetNameSpace.
NodeOptions& ignition::transport::NodeOptions::operator= ( const NodeOptions _other)

Assignment operator.

Parameters
[in]_otherThe new NodeOptions.
Returns
A reference to this instance.
const std::string& ignition::transport::NodeOptions::Partition ( ) const

Get the partition used in this node.

Returns
The partition name.
See Also
SetPartition.
bool ignition::transport::NodeOptions::SetNameSpace ( const std::string &  _ns)

Set the node's namespace.

A namespace is considered a prefix that might be potentially applied to some of the topic/services advertised in a node. E.g.: Node1 sets a namespace 'ns1' and advertises the topics 't1', 't2' and '/t3'. '/t3' is considered an absolute topic (starts with '/') and it won't be affected by a namespace. However, 't1' and 't2' will be advertised as '/ns1/t1' and '/ns1/t2'. A namespace is any alphanumeric string with a few exceptions. The symbol '/' is allowed as part of a namespace but just '/' is not allowed. The symbols '@', '~' and ' ' are not allowed as part of a namespace. Two or more consecutive slashes ('//') are not allowed.

Parameters
[in]_nsThe namespace.
Returns
True when operation succeed or false if the namespace was invalid.
See Also
NameSpace.
bool ignition::transport::NodeOptions::SetPartition ( const std::string &  _partition)

Set the node's partition name.

A partition is used to isolate a set of topics or services from other nodes that use the same names. E.g.: Node1 advertises topics '/foo' and Node2 advertises '/foo' too. If we don't use a partition, a node subscribed to '/foo' will receive the messages published from Node1 and Node2. Alternatively, we could specify 'p1' as a partition for Node1 and 'p2' as a partition for Node2. When we create the node for our subscriber, if we specify 'p1' as a partition name, we'll receive the messages published only by Node1. If we use 'p2', we'll only receive the messages published by Node2. If we don't set a partition name, we won't receive any messages from Node1 or Node2. A partition name is any alphanumeric string with a few exceptions. The symbol '/' is allowed as part of a partition name but just '/' is not allowed. The symbols '@', '~' and ' ' are not allowed as part of a partition name. Two or more consecutive slashes ('//') are not allowed

Parameters
[in]_nsThe partition's name. The default partition value is created using a combination of your hostname, followed by ':' and your username. E.g.: "bb9:caguero" . It's also possible to use the environment variable IGN_PARTITION for setting a partition name.
Returns
True when operation succeed or false if the partition name was invalid.
See Also
Partition

Member Data Documentation

std::unique_ptr<transport::NodeOptionsPrivate> ignition::transport::NodeOptions::dataPtr
protected

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