A class for customizing the behavior of the Node.
More...
#include <ignition/transport/NodeOptions.hh>
A class for customizing the behavior of the Node.
E.g.: Set a custom namespace or a partition name.
ignition::transport::NodeOptions::NodeOptions |
( |
| ) |
|
ignition::transport::NodeOptions::NodeOptions |
( |
const NodeOptions & |
_other | ) |
|
Copy constructor.
- Parameters
-
virtual ignition::transport::NodeOptions::~NodeOptions |
( |
| ) |
|
|
virtual |
const std::string& ignition::transport::NodeOptions::NameSpace |
( |
| ) |
const |
Get the namespace used in this node.
- Returns
- The namespace.
- See Also
- SetNameSpace.
Assignment operator.
- Parameters
-
- 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
-
- 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] | _ns | The 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
The documentation for this class was generated from the following file: