Skip to content

Commit

Permalink
clang-tidy
Browse files Browse the repository at this point in the history
renamings (topic_info -> datatype_info)
  • Loading branch information
rex-schilasky committed Apr 23, 2024
1 parent 1a3466a commit bdc8343
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 61 deletions.
20 changes: 10 additions & 10 deletions ecal/core/include/ecal/ecal_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ namespace eCAL
/**
* @brief Constructor.
*
* @param topic_name_ Unique topic name.
* @param topic_info_ Topic information (encoding, type, descriptor)
* @param config_ Optional configuration parameters.
* @param topic_name_ Unique topic name.
* @param data_type_info_ Topic data type information (encoding, type, descriptor).
* @param config_ Optional configuration parameters.
**/
ECAL_API CPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_, const Config& config_ = {});
ECAL_API CPublisher(const std::string& topic_name_, const SDataTypeInformation& data_type_info_, const Config& config_ = {});

/**
* @brief Constructor.
Expand Down Expand Up @@ -154,13 +154,13 @@ namespace eCAL
/**
* @brief Creates this object.
*
* @param topic_name_ Unique topic name.
* @param topic_info_ Topic information (encoding, type, descriptor)
* @param config_ Optional configuration parameters.
* @param topic_name_ Unique topic name.
* @param data_type_info_ Topic data type information (encoding, type, descriptor).
* @param config_ Optional configuration parameters.
*
* @return True if it succeeds, false if it fails.
**/
ECAL_API bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_, const Config& config_ = {});
ECAL_API bool Create(const std::string& topic_name_, const SDataTypeInformation& data_type_info_, const Config& config_ = {});

/**
* @brief Creates this object.
Expand All @@ -181,11 +181,11 @@ namespace eCAL
/**
* @brief Setup topic information.
*
* @param topic_info_ Topic information attributes.
* @param data_type_info_ Topic data type information attributes.
*
* @return True if it succeeds, false if it fails.
**/
ECAL_API bool SetDataTypeInformation(const SDataTypeInformation& topic_info_);
ECAL_API bool SetDataTypeInformation(const SDataTypeInformation& data_type_info_);

/**
* @brief Sets publisher attribute.
Expand Down
10 changes: 5 additions & 5 deletions ecal/core/include/ecal/msg/capnproto/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ namespace eCAL
**/
SDataTypeInformation GetDataTypeInformation() const
{
SDataTypeInformation topic_info;
topic_info.encoding = eCAL::capnproto::EncodingAsString();
topic_info.name = eCAL::capnproto::TypeAsString<message_type>();
topic_info.descriptor = eCAL::capnproto::SchemaAsString<message_type>();
return topic_info;
SDataTypeInformation data_type_info;
data_type_info.encoding = eCAL::capnproto::EncodingAsString();
data_type_info.name = eCAL::capnproto::TypeAsString<message_type>();
data_type_info.descriptor = eCAL::capnproto::SchemaAsString<message_type>();
return data_type_info;
}

std::unique_ptr<capnp::MallocMessageBuilder> builder;
Expand Down
6 changes: 3 additions & 3 deletions ecal/core/include/ecal/msg/flatbuffers/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ namespace eCAL
**/
SDataTypeInformation GetDataTypeInformation() const override
{
SDataTypeInformation topic_info;
topic_info.encoding = "flatb";
SDataTypeInformation data_type_info;
data_type_info.encoding = "flatb";
// empty type, empty descriptor
return topic_info;
return data_type_info;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions ecal/core/include/ecal/msg/messagepack/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ namespace eCAL
**/
SDataTypeInformation GetDataTypeInformation() const override
{
SDataTypeInformation topic_info;
topic_info.encoding = "mpack";
SDataTypeInformation data_type_info;
data_type_info.encoding = "mpack";
// empty descriptor, empty descriptor
return topic_info;
return data_type_info;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions ecal/core/include/ecal/msg/protobuf/dynamic_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ namespace eCAL
assert(msg_ptr_);
if(msg_ptr_ == nullptr) return SDataTypeInformation();

SDataTypeInformation topic_info;
topic_info.encoding = "proto";
topic_info.name = msg_ptr_->GetTypeName();
topic_info.descriptor = GetDescriptorFromMessage(msg_ptr_);
return topic_info;
SDataTypeInformation data_type_info;
data_type_info.encoding = "proto";
data_type_info.name = msg_ptr_->GetTypeName();
data_type_info.descriptor = GetDescriptorFromMessage(msg_ptr_);
return data_type_info;
}

static std::string GetDescriptorFromMessage(const google::protobuf::Message* msg_ptr_)
Expand Down
10 changes: 5 additions & 5 deletions ecal/core/include/ecal/msg/protobuf/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ namespace eCAL
**/
struct SDataTypeInformation GetDataTypeInformation() const
{
struct SDataTypeInformation topic_info;
struct SDataTypeInformation data_type_info;
static T msg{};
topic_info.encoding = "proto";
topic_info.name = msg.GetTypeName();
topic_info.descriptor = protobuf::GetProtoMessageDescription(msg);
return topic_info;
data_type_info.encoding = "proto";
data_type_info.name = msg.GetTypeName();
data_type_info.descriptor = protobuf::GetProtoMessageDescription(msg);
return data_type_info;
}

};
Expand Down
18 changes: 9 additions & 9 deletions ecal/core/include/ecal/msg/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ namespace eCAL
* @brief Constructor, that automatically intializes the Publisher.
* This should be the preferred constructor.
*
* @param topic_name_ Unique topic name.
* @param topic_info_ Struct that contains information of the datatype (name, encoding, description) of the topic.
* @param config_ Optional configuration parameters.
* @param topic_name_ Unique topic name.
* @param data_type_info_ Topic data type information (encoding, type, descriptor).
* @param config_ Optional configuration parameters.
**/
CMsgPublisher(const std::string& topic_name_, const struct SDataTypeInformation& topic_info_, const Config& config_ = {}) : CPublisher(topic_name_, topic_info_, config_)
CMsgPublisher(const std::string& topic_name_, const struct SDataTypeInformation& data_type_info_, const Config& config_ = {}) : CPublisher(topic_name_, data_type_info_, config_)
{
}

Expand Down Expand Up @@ -103,15 +103,15 @@ namespace eCAL
/**
* @brief Creates this object.
*
* @param topic_name_ Unique topic name.
* @param topic_info_ Associated datatype description.
* @param config_ Optional configuration parameters.
* @param topic_name_ Unique topic name.
* @param data_type_info_ Topic data type information (encoding, type, descriptor).
* @param config_ Optional configuration parameters.
*
* @return True if it succeeds, false if it fails.
**/
bool Create(const std::string& topic_name_, const struct SDataTypeInformation& topic_info_, const Config& config_ = {})
bool Create(const std::string& topic_name_, const struct SDataTypeInformation& data_type_info_, const Config& config_ = {})
{
return(CPublisher::Create(topic_name_, topic_info_, config_));
return(CPublisher::Create(topic_name_, data_type_info_, config_));
}

/**
Expand Down
12 changes: 6 additions & 6 deletions ecal/core/include/ecal/msg/string/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ namespace eCAL
**/
SDataTypeInformation GetDataTypeInformation() const override
{
SDataTypeInformation topic_info;
topic_info.encoding = "base";
topic_info.name = "std::string";
SDataTypeInformation data_type_info;
data_type_info.encoding = "base";
data_type_info.name = "std::string";
// empty descriptor
return topic_info;
return data_type_info;
}

/**
* @brief Get size of the string object.
*
* @param msg_ The message object.
*
* @return String site.
* @return String size.
**/
size_t GetSize(const T& msg_) const override
{
Expand All @@ -144,7 +144,7 @@ namespace eCAL
}
};
/** @example minimal_snd.cpp
* This is an example how to use eCAL::CPublisher to send a std::string with eCAL. To receive the strings, see @ref minimal_rec.cpp .
* This is an example how to use eCAL::string::CPublisher to send a std::string with eCAL. To receive the strings, see @ref minimal_rec.cpp .
**/
}
}
8 changes: 3 additions & 5 deletions ecal/core/src/pubsub/ecal_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@

namespace eCAL
{
CPublisher::Config::Config()
CPublisher::Config::Config() :
share_topic_type(eCAL::Config::IsTopicTypeSharingEnabled()),
share_topic_description(eCAL::Config::IsTopicDescriptionSharingEnabled())
{
// shm config
shm.send_mode = eCAL::Config::GetPublisherShmMode();
Expand All @@ -48,10 +50,6 @@ namespace eCAL

// tcp config
tcp.send_mode = eCAL::Config::GetPublisherTcpMode();

// allow to share topic type/description
share_topic_type = eCAL::Config::IsTopicTypeSharingEnabled();
share_topic_description = eCAL::Config::IsTopicDescriptionSharingEnabled();
}

CPublisher::CPublisher() :
Expand Down
12 changes: 2 additions & 10 deletions ecal/core/src/readwrite/ecal_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ namespace eCAL
m_host_group_name(Process::GetHostGroupName()),
m_pid(Process::GetProcessID()),
m_pname(Process::GetProcessName()),
m_topic_name(topic_name_),
m_topic_info(topic_info_),
m_topic_size(0),
m_buffering_shm(PUB_MEMFILE_BUF_COUNT),
m_zero_copy(PUB_MEMFILE_ZERO_COPY),
Expand All @@ -87,16 +89,6 @@ namespace eCAL
m_share_tdesc(true),
m_created(false)
{
// set defaults
m_topic_name = topic_name_;
m_topic_id.clear();
m_topic_info = topic_info_;
m_id = 0;
m_clock = 0;
m_connected = false;
m_ext_subscribed = false;
m_created = false;

// configure
Configure(config_);

Expand Down

0 comments on commit bdc8343

Please sign in to comment.