ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Athena::Timeout Class Reference

Singleton to access the timeout flag. More...

#include <Timeout.h>

Collaboration diagram for Athena::Timeout:

Public Member Functions

bool reached () const
 Check if the timeout was reached. More...
 
 Timeout ()
 

Static Public Member Functions

static Timeoutinstance ()
 Get reference to Timeout singleton. More...
 
static Timeoutinstance (const EventContext &ctx)
 

Private Member Functions

void set ()
 Set timeout flag. More...
 
void reset ()
 Reset timeout flag. More...
 
 Timeout (Timeout &)
 
Timeoutoperator= (const Timeout &)
 

Private Attributes

std::atomic< bool > m_state
 Timeout flag. More...
 

Friends

class TimeoutMaster
 Only classes derived from TimeoutMaster can modify timeout flag. More...
 

Detailed Description

Singleton to access the timeout flag.

This singleton provides a global timeout flag. It can be set by the TimeoutMaster and algorithms, tools, etc. can query it in loops to react on the timeout signal.

Definition at line 35 of file Timeout.h.

Constructor & Destructor Documentation

◆ Timeout() [1/2]

Athena::Timeout::Timeout ( )
inline

Definition at line 47 of file Timeout.h.

47 : m_state(false) {}

◆ Timeout() [2/2]

Athena::Timeout::Timeout ( Timeout )
private

Member Function Documentation

◆ instance() [1/2]

Timeout & Athena::Timeout::instance ( )
inlinestatic

Get reference to Timeout singleton.

Definition at line 64 of file Timeout.h.

64  {
65  return instance (Gaudi::Hive::currentContext());
66  }

◆ instance() [2/2]

Timeout & Athena::Timeout::instance ( const EventContext &  ctx)
inlinestatic

Definition at line 59 of file Timeout.h.

59  {
61  return *instances.get (ctx);
62  }

◆ operator=()

Timeout& Athena::Timeout::operator= ( const Timeout )
private

◆ reached()

bool Athena::Timeout::reached ( ) const
inline

Check if the timeout was reached.

Definition at line 45 of file Timeout.h.

45 { return m_state; }

◆ reset()

void Athena::Timeout::reset ( )
inlineprivate

Reset timeout flag.

Definition at line 52 of file Timeout.h.

◆ set()

void Athena::Timeout::set ( )
inlineprivate

Set timeout flag.

Definition at line 51 of file Timeout.h.

Friends And Related Function Documentation

◆ TimeoutMaster

friend class TimeoutMaster
friend

Only classes derived from TimeoutMaster can modify timeout flag.

Definition at line 37 of file Timeout.h.

Member Data Documentation

◆ m_state

std::atomic<bool> Athena::Timeout::m_state
private

Timeout flag.

Definition at line 50 of file Timeout.h.


The documentation for this class was generated from the following file:
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
Athena::Timeout::instance
static Timeout & instance()
Get reference to Timeout singleton.
Definition: Timeout.h:64
Athena::Timeout::m_state
std::atomic< bool > m_state
Timeout flag.
Definition: Timeout.h:50
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211