-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature event naming #1898
Feature event naming #1898
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -400,12 +400,12 @@ namespace eCAL | |||||
return(true); | ||||||
} | ||||||
|
||||||
bool CPublisherImpl::SetEventIDCallback(const PubEventIDCallbackT callback_) | ||||||
bool CPublisherImpl::SetEventCallback(const PubEventCallbackT callback_) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the const qualified parameter 'callback_' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param] ecal/core/src/pubsub/ecal_publisher_impl.h:89: - bool SetEventCallback(const PubEventCallbackT callback_);
+ bool SetEventCallback(const PubEventCallbackT& callback_);
Suggested change
|
||||||
{ | ||||||
if (!m_created) return false; | ||||||
|
||||||
#ifndef NDEBUG | ||||||
Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetEventIDCallback"); | ||||||
Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetEventCallback"); | ||||||
#endif | ||||||
|
||||||
// set event id callback | ||||||
|
@@ -416,12 +416,12 @@ namespace eCAL | |||||
return true; | ||||||
} | ||||||
|
||||||
bool CPublisherImpl::RemoveEventIDCallback() | ||||||
bool CPublisherImpl::RemoveEventCallback() | ||||||
{ | ||||||
if (!m_created) return false; | ||||||
|
||||||
#ifndef NDEBUG | ||||||
Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::RemoveEventIDCallback"); | ||||||
Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::RemoveEventCallback"); | ||||||
#endif | ||||||
|
||||||
// remove event id callback | ||||||
|
@@ -738,7 +738,7 @@ namespace eCAL | |||||
// new event handling with topic id | ||||||
if(m_event_id_callback) | ||||||
{ | ||||||
SPubEventIDCallbackData data; | ||||||
SPubEventCallbackData data; | ||||||
data.type = type_; | ||||||
data.time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); | ||||||
data.clock = 0; | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,7 +40,7 @@ namespace eCAL | |||||
if (g_subgate() != nullptr) g_subgate()->Register(topic_name_, m_subscriber_impl); | ||||||
} | ||||||
|
||||||
CSubscriber::CSubscriber(const std::string& topic_name_, const SDataTypeInformation& data_type_info_, const SubEventIDCallbackT event_callback_, const Subscriber::Configuration& config_) : | ||||||
CSubscriber::CSubscriber(const std::string& topic_name_, const SDataTypeInformation& data_type_info_, const SubEventCallbackT event_callback_, const Subscriber::Configuration& config_) : | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the const qualified parameter 'event_callback_' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param] ecal/core/include/ecal/ecal_subscriber.h:67: - CSubscriber(const std::string& topic_name_, const SDataTypeInformation& data_type_info_, const SubEventCallbackT event_callback_, const Subscriber::Configuration& config_ = GetSubscriberConfiguration());
+ CSubscriber(const std::string& topic_name_, const SDataTypeInformation& data_type_info_, const SubEventCallbackT& event_callback_, const Subscriber::Configuration& config_ = GetSubscriberConfiguration());
Suggested change
|
||||||
CSubscriber(topic_name_, data_type_info_, config_) | ||||||
{ | ||||||
// add event callback for all current event types | ||||||
|
@@ -70,7 +70,7 @@ namespace eCAL | |||||
return *this; | ||||||
} | ||||||
|
||||||
bool CSubscriber::SetReceiveCallback(ReceiveIDCallbackT callback_) | ||||||
bool CSubscriber::SetReceiveCallback(ReceiveCallbackT callback_) | ||||||
{ | ||||||
if (m_subscriber_impl == nullptr) return false; | ||||||
return m_subscriber_impl->SetReceiveCallback(std::move(callback_)); | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -163,7 +163,7 @@ namespace eCAL | |||||
return(false); | ||||||
} | ||||||
|
||||||
bool CSubscriberImpl::SetReceiveCallback(ReceiveIDCallbackT callback_) | ||||||
bool CSubscriberImpl::SetReceiveCallback(ReceiveCallbackT callback_) | ||||||
{ | ||||||
if (!m_created) return(false); | ||||||
|
||||||
|
@@ -231,7 +231,7 @@ namespace eCAL | |||||
return(true); | ||||||
} | ||||||
|
||||||
bool CSubscriberImpl::SetEventIDCallback(const SubEventIDCallbackT callback_) | ||||||
bool CSubscriberImpl::SetEventIDCallback(const SubEventCallbackT callback_) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the const qualified parameter 'callback_' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
Suggested change
ecal/core/src/pubsub/ecal_subscriber_impl.h:80: - bool SetEventIDCallback(const SubEventCallbackT callback_);
+ bool SetEventIDCallback(const SubEventCallbackT& callback_); |
||||||
{ | ||||||
if (!m_created) return false; | ||||||
|
||||||
|
@@ -247,12 +247,12 @@ namespace eCAL | |||||
return true; | ||||||
} | ||||||
|
||||||
bool CSubscriberImpl::RemoveEventIDCallback() | ||||||
bool CSubscriberImpl::RemoveEventCallback() | ||||||
{ | ||||||
if (!m_created) return false; | ||||||
|
||||||
#ifndef NDEBUG | ||||||
Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveEventIDCallback"); | ||||||
Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveEventCallback"); | ||||||
#endif | ||||||
|
||||||
// remove event id callback | ||||||
|
@@ -787,7 +787,7 @@ namespace eCAL | |||||
// new event handling with topic id | ||||||
if (m_event_id_callback) | ||||||
{ | ||||||
SSubEventIDCallbackData data; | ||||||
SSubEventCallbackData data; | ||||||
data.type = type_; | ||||||
data.time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); | ||||||
data.clock = 0; | ||||||
|
@@ -909,7 +909,7 @@ namespace eCAL | |||||
// new event handling with topic id | ||||||
if (m_event_id_callback) | ||||||
{ | ||||||
SSubEventIDCallbackData data; | ||||||
SSubEventCallbackData data; | ||||||
data.type = sub_event_dropped; | ||||||
data.time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); | ||||||
data.clock = current_clock_; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the const qualified parameter 'event_callback_' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
ecal/core/include/ecal/ecal_publisher.h:71: