allpix::Configuration::AccessMarker
Helper class to keep track of key access. More…
Public Functions
Name | |
---|---|
AccessMarker() =default | |
AccessMarker(const AccessMarker & rhs) Explicit copy constructor to allow copying of the map keys. |
|
AccessMarker & | operator=(const AccessMarker & rhs) Explicit copy assignment operator to allow copying of the map keys. |
void | registerMarker(const std::string & key) Method to register a key for a new access marker. |
void | markUsed(const std::string & key) Method to mark existing marker as accessed/used. |
bool | isUsed(const std::string & key) Method to retrieve access status of an existing marker. |
Detailed Description
class allpix::Configuration::AccessMarker;
Helper class to keep track of key access.
This class holds all configuration keys in a map together with an atomic boolean marking whether they have been accessed already. This allows to find out which keys have not been accessed at all. This wrapper allows to use atomics for non-locking access but requires to register all keys beforehand.
Public Functions Documentation
function AccessMarker
AccessMarker() =default
Default constructor
function AccessMarker
AccessMarker(
const AccessMarker & rhs
)
Explicit copy constructor to allow copying of the map keys.
function operator=
AccessMarker & operator=(
const AccessMarker & rhs
)
Explicit copy assignment operator to allow copying of the map keys.
function registerMarker
void registerMarker(
const std::string & key
)
Method to register a key for a new access marker.
Parameters:
- key Key of the marker
Warning: This operation is not thread-safe
function markUsed
inline void markUsed(
const std::string & key
)
Method to mark existing marker as accessed/used.
Parameters:
- key Key of the marker
Exceptions:
- std::out_of_range if the key has not been registered beforehand
Note: This is an atomic operation and thread-safe.
function isUsed
inline bool isUsed(
const std::string & key
)
Method to retrieve access status of an existing marker.
Parameters:
- key Key of the marker
Exceptions:
- std::out_of_range if the key has not been registered beforehand
Note: This is an atomic operation and thread-safe.
Updated on 2024-12-13 at 08:31:36 +0000