Static Public Member Functions | List of all members
ignition::transport::TopicUtils Class Reference

This class provides different utilities related with topics. More...

#include <ignition/transport/TopicUtils.hh>

Static Public Member Functions

static bool FullyQualifiedName (const std::string &_partition, const std::string &_ns, const std::string &_topic, std::string &_name)
 Get the full topic path given a namespace and a topic name. More...
 
static bool IsValidNamespace (const std::string &_ns)
 Determines if a namespace is valid. More...
 
static bool IsValidPartition (const std::string &_partition)
 Determines if a partition is valid. More...
 
static bool IsValidTopic (const std::string &_topic)
 Determines if a topic name is valid. More...
 

Detailed Description

This class provides different utilities related with topics.

Member Function Documentation

◆ FullyQualifiedName()

static bool ignition::transport::TopicUtils::FullyQualifiedName ( const std::string &  _partition,
const std::string &  _ns,
const std::string &  _topic,
std::string &  _name 
)
static

Get the full topic path given a namespace and a topic name.

Parameters
[in]_partitionPartition name.
[in]_nsNamespace.
[in]_topicTopic name.
[out]_nameFully qualified topic name.
Returns
True if the fully qualified name is valid (if partition, namespace and topic are correct).

Referenced by ignition::transport::Node::Advertise(), ignition::transport::Node::Request(), and ignition::transport::Node::Subscribe().

◆ IsValidNamespace()

static bool ignition::transport::TopicUtils::IsValidNamespace ( const std::string &  _ns)
static

Determines if a namespace is valid.

Parameters
[in]_nsNamespace to be checked.
Returns
true if the namespace is valid.

◆ IsValidPartition()

static bool ignition::transport::TopicUtils::IsValidPartition ( const std::string &  _partition)
static

Determines if a partition is valid.

The same rules to validate a topic name applies to a partition with the addition of the empty string, which is a valid partition (meaning no partition is used).

Parameters
[in]_partitionPartition to be checked.
Returns
true if the partition is valid.

◆ IsValidTopic()

static bool ignition::transport::TopicUtils::IsValidTopic ( const std::string &  _topic)
static

Determines if a topic name is valid.

A topic name is any non-empty alphanumeric string. The symbol '/' is also allowed as part of a topic name. The symbol '@' is not allowed in a topic name

Parameters
[in]_topicTopic name to be checked.
Returns
true if the topic name is valid.

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