SObjectizer  5.5
Public Member Functions | Protected Member Functions | List of all members
so_5::msg_tracing::trace_data_t Class Referenceabstract

An interface of object for accessing trace details. More...

#include <msg_tracing.hpp>

Inheritance diagram for so_5::msg_tracing::trace_data_t:
so_5::impl::msg_tracing_helpers::details::actual_trace_data_t

Public Member Functions

virtual optional< current_thread_id_ttid () const SO_5_NOEXCEPT=0
 Get the Thread ID from trace message. More...
 
virtual optional< std::type_index > msg_type () const SO_5_NOEXCEPT=0
 Get the information about message type. More...
 
virtual optional< msg_source_tmsg_source () const SO_5_NOEXCEPT=0
 Get the information about message source. More...
 
virtual optional< const so_5::agent_t * > agent () const SO_5_NOEXCEPT=0
 Get a pointer to agent from trace message. More...
 
virtual optional< message_or_signal_flag_tmessage_or_signal () const SO_5_NOEXCEPT=0
 Get message or signal information. More...
 
virtual optional< message_instance_info_tmessage_instance_info () const SO_5_NOEXCEPT=0
 Get message instance information. More...
 
virtual optional< compound_action_description_tcompound_action () const SO_5_NOEXCEPT=0
 Get the description of a compound action. More...
 
virtual optional< const so_5::impl::event_handler_data_t * > event_handler_data_ptr () const SO_5_NOEXCEPT=0
 Get pointer to event handler. More...
 

Protected Member Functions

 trace_data_t (const trace_data_t &)=delete
 
trace_data_toperator= (const trace_data_t &)=delete
 
 trace_data_t ()=default
 
virtual ~trace_data_t () SO_5_NOEXCEPT=default
 

Detailed Description

An interface of object for accessing trace details.

A reference to an object with this interface will be passed to trace filter. This interface provides access to details of a trace message.

Please note that not all data can be available for every trace message. Because of that all methods returns optional values. It means that the value returned must be checked for presense first. For example:

const auto thr_id = so_5::query_current_thread_id();
[thr_id](const so_5::msg_tracing::trace_data_t & td) {
// Try to get ID of thread.
const auto tid = td.tid();
// Check the presence of value first.
if(tid) {
// And only then we can check the value itself.
return thr_id == *tid;
}
else
return false;
} );
Note
Version 5.5.22 provides and experimental implementation of trace filters. Because of that the content of this interface can be a subject of change in the future versions of SObjectizer.
Since
v.5.5.22
Examples:
so_5/nohandler_msg_tracing/main.cpp, and so_5/selective_msg_tracing/main.cpp.

Constructor & Destructor Documentation

◆ trace_data_t() [1/2]

so_5::msg_tracing::trace_data_t::trace_data_t ( const trace_data_t )
protecteddelete

◆ trace_data_t() [2/2]

so_5::msg_tracing::trace_data_t::trace_data_t ( )
protecteddefault

◆ ~trace_data_t()

virtual so_5::msg_tracing::trace_data_t::~trace_data_t ( )
protectedvirtualdefault

Member Function Documentation

◆ agent()

virtual optional<const so_5::agent_t *> so_5::msg_tracing::trace_data_t::agent ( ) const
pure virtual

Get a pointer to agent from trace message.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

◆ compound_action()

virtual optional<compound_action_description_t> so_5::msg_tracing::trace_data_t::compound_action ( ) const
pure virtual

Get the description of a compound action.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

◆ event_handler_data_ptr()

virtual optional<const so_5::impl::event_handler_data_t *> so_5::msg_tracing::trace_data_t::event_handler_data_ptr ( ) const
pure virtual

◆ message_instance_info()

virtual optional<message_instance_info_t> so_5::msg_tracing::trace_data_t::message_instance_info ( ) const
pure virtual

Get message instance information.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

◆ message_or_signal()

virtual optional<message_or_signal_flag_t> so_5::msg_tracing::trace_data_t::message_or_signal ( ) const
pure virtual

Get message or signal information.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

◆ msg_source()

virtual optional<msg_source_t> so_5::msg_tracing::trace_data_t::msg_source ( ) const
pure virtual

Get the information about message source.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

◆ msg_type()

virtual optional<std::type_index> so_5::msg_tracing::trace_data_t::msg_type ( ) const
pure virtual

Get the information about message type.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

◆ operator=()

trace_data_t& so_5::msg_tracing::trace_data_t::operator= ( const trace_data_t )
protecteddelete

◆ tid()

virtual optional<current_thread_id_t> so_5::msg_tracing::trace_data_t::tid ( ) const
pure virtual

Get the Thread ID from trace message.

Implemented in so_5::impl::msg_tracing_helpers::details::actual_trace_data_t.

Examples:
so_5/selective_msg_tracing/main.cpp.

The documentation for this class was generated from the following file: