Skip to content
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

add method to access MemoryToolsService members #81

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,22 @@ struct MemoryToolsService
void
unignore();

// Return ignored or not.
OSRF_TESTING_TOOLS_CPP_MEMORY_TOOLS_PUBLIC
bool
get_ignored();

/// Adds a backtrace to the log message.
/** Repeated calls do nothing, and only prints if a log is also printed. */
OSRF_TESTING_TOOLS_CPP_MEMORY_TOOLS_PUBLIC
void
print_backtrace();

// Return print back trace or not.
OSRF_TESTING_TOOLS_CPP_MEMORY_TOOLS_PUBLIC
bool
get_print_backtrace();

/// Returns a stack trace object for introspection.
/**
* Pointer should not be used after MemoryToolsService is out of scope.
Expand Down
12 changes: 12 additions & 0 deletions osrf_testing_tools_cpp/src/memory_tools/memory_tools_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,24 @@ MemoryToolsService::unignore()
impl_->ignored = false;
}

bool
MemoryToolsService::get_ignored()
{
return impl_->ignored;
}

void
MemoryToolsService::print_backtrace()
{
impl_->should_print_backtrace = true;
}

bool
MemoryToolsService::get_print_backtrace()
{
return impl_->should_print_backtrace;
}

StackTrace *
MemoryToolsService::get_stack_trace()
{
Expand Down