libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::access_tracker< Accessor > Class Template Reference

Description

template<typename Accessor>
class tcspc::access_tracker< Accessor >

Tracker that mediates access to objects via a tcspc::context.

This is a movable (noncopyable) object that tracks its address when moved. The address is stored in the associated tcspc::context from which the tracker was created.

An object stores the tracker instance as a data member and also registers an accessor factory in its constructor. This allows code to later access the object state, even after the tracked object has been embedded in an outer object (as with a processor incorporated into a processing graph).

Template Parameters
Accessortype of accessor for the tracked object

Public Member Functions

 access_tracker ()=default
 Construct an empty tracker.
template<typename F>
void register_accessor_factory (F factory)
 Register an accessor factory with this tracker's context.

Friends

class context

Constructor & Destructor Documentation

◆ access_tracker()

template<typename Accessor>
tcspc::access_tracker< Accessor >::access_tracker ( )
default

Construct an empty tracker.

Empty instances cannot be used other than by assigning a non-empty instance.

Non-empty instances can only be obtained from a tcspc::context.

Member Function Documentation

◆ register_accessor_factory()

template<typename Accessor>
template<typename F>
void tcspc::access_tracker< Accessor >::register_accessor_factory ( F factory)
inline

Register an accessor factory with this tracker's context.

This is usually called in the tracked object's constructor to arrange for later access to the object via its corresponding accessor type.

Template Parameters
Ffactory function type
Parameters
factoryfunction taking reference to this tracker and returning the accessor of type Accessor

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