80 lines
1.9 KiB
C++
80 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "ddkit/access/ITopicStrategy.hpp"
|
|
|
|
#include <string>
|
|
|
|
namespace ddkit {
|
|
namespace access {
|
|
|
|
class TopicStrategyRemoveNamespaces : public ITopicStrategy {
|
|
|
|
public:
|
|
std::string get(const std::string& typeName) override;
|
|
};
|
|
|
|
|
|
/// @brief replace "::" with "__" (as for example cyclone does not like '::' in topic-names)
|
|
class TopicStrategyReplaceColons : public ITopicStrategy {
|
|
|
|
public:
|
|
std::string get(const std::string& typeName) override;
|
|
};
|
|
|
|
|
|
/// @brief simply prepend the prefix (plus "_") - nothing else
|
|
class TopicStrategyPrefix : public ITopicStrategy {
|
|
|
|
public:
|
|
TopicStrategyPrefix(const std::string& prefix);
|
|
|
|
std::string get(const std::string& typeName) override;
|
|
|
|
private:
|
|
std::string m_prefix;
|
|
};
|
|
|
|
|
|
/// @brief maps all 'unallowed' characters (everything besides [a-zA-Z0-9]) to '_' - implicitly called in TopicPool - always!
|
|
class TopicStrategyMapChars : public ITopicStrategy {
|
|
|
|
public:
|
|
TopicStrategyMapChars();
|
|
|
|
std::string get(const std::string& orig) override;
|
|
};
|
|
|
|
|
|
/// @brief SensorService + VendorData::M_Sensor::IService::ConfigSth -> ddkit_SensorService_Sensor_c2s_ConfigSth
|
|
class TopicStrategyRmodel : public ITopicStrategy {
|
|
|
|
public:
|
|
TopicStrategyRmodel(const std::string& prefix);
|
|
|
|
std::string get(const std::string& typeName) override;
|
|
|
|
private:
|
|
TopicStrategyReplaceColons m_tnsReplaceColons;
|
|
TopicStrategyPrefix m_tnsPrefix;
|
|
};
|
|
|
|
|
|
/// @brief module::name -> module_name
|
|
class TopicStrategySimple : public ITopicStrategy {
|
|
|
|
public:
|
|
std::string get(const std::string& typeName) override;
|
|
};
|
|
|
|
|
|
/// @brief remove big-char-prefixes and -suffixes and replace colons by underscore
|
|
/// - P_Navigation_Reference_PSM::C_Angular_Motion --> Navigation_Reference__Angular_Motion
|
|
class TopicStrategyStd : public ITopicStrategy {
|
|
|
|
public:
|
|
std::string get(const std::string& typeName) override;
|
|
};
|
|
|
|
|
|
} // namespace access
|
|
} // namespace ddkit
|