Skip to content

Commit

Permalink
Correction by review.
Browse files Browse the repository at this point in the history
Signed-off-by: ISP akm <[email protected]>
  • Loading branch information
xygyo77 committed Apr 16, 2024
1 parent 26d5540 commit cd38f19
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions CARET_trace/include/caret_trace/tracing_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@ class TracingController
/// @return True if the process is enabled, false otherwise.
bool is_allowed_process();

/// @brief Check if trace point is a enabled node
/// @brief Check if trace point is a enabled timer handle
/// @param timer_handle Address of the timer handle.
/// @return True if the timer_handle is enabled, false otherwise.
bool is_allowed_timer_handle(const void * timer_handle);

/// @brief Check if trace point is a enabled node
/// @brief Check if trace point is a enabled state machine
/// @param state_machine Address of the lifecycle state machine.
/// @return True if the state_machine is enabled, false otherwise.
bool is_allowed_state_machine(const void * state_machine);

/// @brief Check if trace point is a enabled subscription
/// @brief Check if trace point is a enabled ipb
/// @param buffer Address of the intra-process buffer.
/// @return True if the buffer is enabled, false otherwise.
/// @return True if the ipb is enabled, false otherwise.
bool is_allowed_ipb(const void * ipb);

/// @brief Check if trace point is a enabled callback
/// @brief Check if trace point is a enabled service handle
/// @param service_handle Address of the service handle.
/// @return True if the buffer is enabled, false otherwise.
/// @return True if the service_handle is enabled, false otherwise.
bool is_allowed_service_handle(const void * service_handle);

/// @brief Check if trace point is a enabled callback
/// @brief Check if trace point is a enabled client handle
/// @param client_handle Address of the client handle.
/// @return True if the buffer is enabled, false otherwise.
/// @return True if the client_handle is enabled, false otherwise.
bool is_allowed_client_handle(const void * client_handle);

/// @brief Check if trace point is a enabled message
/// @param publisher_handle Address of the publisher handle.
/// @brief Check if trace point is a enabled publisher
/// @param message Address of the message.
/// @return True if the message is enabled, false otherwise.
bool is_allowed_message(const void * message);

Expand Down
20 changes: 10 additions & 10 deletions CARET_trace/src/tracing_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ bool TracingController::is_allowed_service_handle(const void * service_handle)
std::unordered_map<const void *, bool>::iterator is_allowed_it;
{
std::shared_lock<std::shared_timed_mutex> lock(mutex_);
is_allowed_it = allowed_service_handle_.find(service_handle);
if (is_allowed_it != allowed_service_handle_.end()) {
is_allowed_it = allowed_service_handles_.find(service_handle);
if (is_allowed_it != allowed_service_handles_.end()) {
return is_allowed_it->second;
}
}
Expand All @@ -640,30 +640,30 @@ bool TracingController::is_allowed_service_handle(const void * service_handle)
auto node_name = node_handle_to_node_names_[node_handle];

if (node_name.size() == 0) {
allowed_service_handle_[service_handle] = true;
allowed_service_handles_[service_handle] = true;
return true;
}

if (select_enabled_) {
auto is_selected_node = partial_match(selected_node_names_, node_name);

if (is_selected_node && selected_node_names_.size() > 0) {
allowed_service_handle_[service_handle] = true;
allowed_service_handles_[service_handle] = true;
return true;
}
allowed_service_handle_[service_handle] = false;
allowed_service_handles_[service_handle] = false;
return false;
} else if (ignore_enabled_) {
auto is_ignored_node = partial_match(ignored_node_names_, node_name);

if (is_ignored_node && ignored_node_names_.size() > 0) {
allowed_service_handle_[service_handle] = false;
allowed_service_handles_[service_handle] = false;
return false;
}
allowed_service_handle_[service_handle] = true;
allowed_service_handles_[service_handle] = true;
return true;
}
allowed_service_handle_[service_handle] = true;
allowed_service_handles_[service_handle] = true;
return true;
}
}
Expand Down Expand Up @@ -855,7 +855,7 @@ void TracingController::add_node(const void * node_handle, std::string node_name
allowed_timer_handles_.clear();
allowed_state_machines_.clear();
allowed_ipbs_.clear();
allowed_service_handle_.clear();
allowed_service_handles_.clear();
allowed_client_handles_.clear();
allowed_callbacks_.clear();
}
Expand Down Expand Up @@ -958,7 +958,7 @@ void TracingController::add_service_handle(const void * service_handle, const vo
{
std::lock_guard<std::shared_timed_mutex> lock(mutex_);
service_handle_to_node_handles_[service_handle] = node_handle;
allowed_service_handle_.erase(service_handle);
allowed_service_handles_.erase(service_handle);
}

void TracingController::add_client_handle(const void * client_handle, const void * node_handle)
Expand Down

0 comments on commit cd38f19

Please sign in to comment.