Ignition Transport

API Reference

4.0.0
TopicUtils.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef IGN_TRANSPORT_TOPICUTILS_HH_
19#define IGN_TRANSPORT_TOPICUTILS_HH_
20
21#include <cstdint>
22#include <string>
23
24#include "ignition/transport/Export.hh"
25
26namespace ignition
27{
28 namespace transport
29 {
32 class IGNITION_TRANSPORT_VISIBLE TopicUtils
33 {
38 public: static bool IsValidNamespace(const std::string &_ns);
39
47 public: static bool IsValidPartition(const std::string &_partition);
48
57 public: static bool IsValidTopic(const std::string &_topic);
58
94 public: static bool FullyQualifiedName(const std::string &_partition,
95 const std::string &_ns,
96 const std::string &_topic,
97 std::string &_name);
98
102 public: static const uint16_t kMaxNameLength = 65535;
103 };
104 }
105}
106
107#endif
This class provides different utilities related with topics.
Definition TopicUtils.hh:33
static bool IsValidTopic(const std::string &_topic)
Determines if a topic name is valid. A topic name is any non-empty alphanumeric string....
static const uint16_t kMaxNameLength
The kMaxNameLength specifies the maximum number of characters allowed in a namespace,...
Definition TopicUtils.hh:102
static bool IsValidNamespace(const std::string &_ns)
Determines if a namespace is valid. A namespace's length must not exceed kMaxNameLength.
static bool IsValidPartition(const std::string &_partition)
Determines if a partition is valid. The same rules to validate a topic name applies to a partition wi...
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. A fully qualified topic name's length mus...
Definition AdvertiseOptions.hh:28