Skip to content

Commit

Permalink
[core] const keyword removed from Send() in CPublisher (#1639)
Browse files Browse the repository at this point in the history
Co-authored-by: Kerstin Keller <[email protected]>
  • Loading branch information
ashariff-11 and KerstinKeller authored Jun 24, 2024
1 parent 3274646 commit 41145e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ecal/core/include/ecal/ecal_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ namespace eCAL
*
* @return Number of bytes sent.
**/
ECAL_API size_t Send(const void* buf_, size_t len_, long long time_ = DEFAULT_TIME_ARGUMENT) const;
ECAL_API size_t Send(const void* buf_, size_t len_, long long time_ = DEFAULT_TIME_ARGUMENT);

/**
* @brief Send a message to all subscribers.
Expand All @@ -204,7 +204,7 @@ namespace eCAL
*
* @return Number of bytes sent.
**/
ECAL_API size_t Send(CPayloadWriter& payload_, long long time_ = DEFAULT_TIME_ARGUMENT) const;
ECAL_API size_t Send(CPayloadWriter& payload_, long long time_ = DEFAULT_TIME_ARGUMENT);

/**
* @brief Send a message to all subscribers.
Expand All @@ -214,7 +214,7 @@ namespace eCAL
*
* @return Number of bytes sent.
**/
ECAL_API size_t Send(const std::string& s_, long long time_ = DEFAULT_TIME_ARGUMENT) const;
ECAL_API size_t Send(const std::string& s_, long long time_ = DEFAULT_TIME_ARGUMENT);

/**
* @brief Add callback function for publisher events.
Expand Down
6 changes: 3 additions & 3 deletions ecal/core/src/pubsub/ecal_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ namespace eCAL
return(true);
}

size_t CPublisher::Send(const void* const buf_, const size_t len_, const long long time_ /* = DEFAULT_TIME_ARGUMENT */) const
size_t CPublisher::Send(const void* const buf_, const size_t len_, const long long time_ /* = DEFAULT_TIME_ARGUMENT */)
{
CBufferPayloadWriter payload{ buf_, len_ };
return Send(payload, time_);
}

size_t CPublisher::Send(CPayloadWriter& payload_, long long time_) const
size_t CPublisher::Send(CPayloadWriter& payload_, long long time_)
{
if (!m_created) return(0);

Expand All @@ -180,7 +180,7 @@ namespace eCAL
return written_bytes;
}

size_t CPublisher::Send(const std::string& s_, long long time_) const
size_t CPublisher::Send(const std::string& s_, long long time_)
{
return(Send(s_.data(), s_.size(), time_));
}
Expand Down
4 changes: 2 additions & 2 deletions ecal/samples/cpp/benchmarks/dynsize_snd/src/dynsize_snd.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -27,7 +27,7 @@ int main(int argc, char **argv)
eCAL::Initialize(argc, argv, "dynsize_snd");

// publisher for topic "Performance"
const eCAL::CPublisher pub("Performance");
eCAL::CPublisher pub("Performance");

// prepare snd_buf
const int MAX_BUFSIZE(10*1024*1024);
Expand Down

0 comments on commit 41145e1

Please sign in to comment.