Class Context

Class Documentation

class Context

A class for singletons that manage shared instances.

Public Functions

Context()

Construct an instance.

Context(std::shared_ptr<DataContainer> data_container, std::shared_ptr<TracingController> controller)

Construct an instance.

Parameters:
  • data_container – data container.

  • controller – controller.

Context(const Context&) = delete
TracingController &get_controller()

Get TracingController instance.

Returns:

TracingController instance

std::shared_ptr<DataContainer> get_data_container_ptr()

Get pointer for DataContainer instance.

Returns:

DataContainer pointer

std::shared_ptr<LttngSession> get_lttng_session_ptr()

Get pointer for LttngSession instance.

Returns:

LttngSession pointer.

DataContainer &get_data_container()

Get DataContainer instance.

Returns:

DataContainer instance

TraceNodeInterface &get_node()

Get TraceNodeInterface instance.

Returns:

TraceNodeInterface instance.

Clock &get_clock()

Get Clock instance.

Returns:

clock instance.

void assign_node(std::shared_ptr<TraceNodeInterface> node)

Assign node instance.

Parameters:

node – Node instance to be assigned.

bool is_node_assigned() const

Check whether node is assigned.

Returns:

True is node is assigned, false otherwise.

bool is_recording_allowed() const

Check whether current status enables recording.

Returns:

True is recording is enabled, false otherwise.

Public Members

std::atomic<bool> is_node_initializing

Initializing flag for TraceNode.