ATLAS Offline Software
Loading...
Searching...
No Matches
TCS::Decision Class Reference

#include <Decision.h>

Collaboration diagram for TCS::Decision:

Public Member Functions

 Decision (unsigned int firstBit=0, unsigned int nBits=1)
 ~Decision ()
StatusCode reset ()
void setBit (unsigned int index, bool value)
void setFirstBit (unsigned int startBit)
void setNBits (unsigned int nBits)
void setOverflow (bool value)
void setAmbiguity (bool value)
bool bit (unsigned int index) const
uint64_t decision () const
unsigned int firstBit () const
unsigned int lastBit () const
unsigned int nBits () const
bool overflow () const
bool ambiguity () const

Private Attributes

uint32_t m_decision {0}
unsigned int m_firstBit {0}
unsigned int m_nBits {1}
bool m_overflow
bool m_ambiguity = false

Detailed Description

Definition at line 19 of file Decision.h.

Constructor & Destructor Documentation

◆ Decision()

TCS::Decision::Decision ( unsigned int firstBit = 0,
unsigned int nBits = 1 )
inline

Definition at line 22 of file Decision.h.

22 :
25 m_overflow(false)
26 {};
unsigned int m_nBits
Definition Decision.h:51
unsigned int nBits() const
Definition Decision.h:44
unsigned int m_firstBit
Definition Decision.h:50
bool m_overflow
Definition Decision.h:52
unsigned int firstBit() const
Definition Decision.h:42

◆ ~Decision()

TCS::Decision::~Decision ( )
inline

Definition at line 29 of file Decision.h.

29{};

Member Function Documentation

◆ ambiguity()

bool TCS::Decision::ambiguity ( ) const
inline

Definition at line 46 of file Decision.h.

46{ return m_ambiguity; }
bool m_ambiguity
Definition Decision.h:56

◆ bit()

bool TCS::Decision::bit ( unsigned int index) const
inline

Definition at line 40 of file Decision.h.

40{ return (m_decision & (0x1<<index)) != 0; }
size_t index() const
Return the index of this element within its container.
uint32_t m_decision
Definition Decision.h:49

◆ decision()

uint64_t TCS::Decision::decision ( ) const
inline

Definition at line 41 of file Decision.h.

41{ return m_decision; }

◆ firstBit()

unsigned int TCS::Decision::firstBit ( ) const
inline

Definition at line 42 of file Decision.h.

42{ return m_firstBit; }

◆ lastBit()

unsigned int TCS::Decision::lastBit ( ) const
inline

Definition at line 43 of file Decision.h.

43{ return m_firstBit + m_nBits - 1; }

◆ nBits()

unsigned int TCS::Decision::nBits ( ) const
inline

Definition at line 44 of file Decision.h.

44{ return m_nBits; }

◆ overflow()

bool TCS::Decision::overflow ( ) const
inline

Definition at line 45 of file Decision.h.

45{ return m_overflow; }

◆ reset()

StatusCode TCS::Decision::reset ( )
inline

◆ setAmbiguity()

void TCS::Decision::setAmbiguity ( bool value)
inline

Definition at line 38 of file Decision.h.

38{ m_ambiguity = value; }

◆ setBit()

void TCS::Decision::setBit ( unsigned int index,
bool value )

Definition at line 12 of file Decision.cxx.

12 {
13 if(index>=m_nBits) {
14 TCS_EXCEPTION("Trying to set bit " << index << ", while max index allowed is " << m_nBits-1)
15 }
16 if(set) {
17 m_decision |= (0x1<<index);
18 } else {
19 m_decision &= ~(0x1<<index);
20 }
21}

◆ setFirstBit()

void TCS::Decision::setFirstBit ( unsigned int startBit)
inline

Definition at line 35 of file Decision.h.

35{ m_firstBit = startBit; }

◆ setNBits()

void TCS::Decision::setNBits ( unsigned int nBits)
inline

Definition at line 36 of file Decision.h.

36{ m_nBits = nBits; }

◆ setOverflow()

void TCS::Decision::setOverflow ( bool value)
inline

Definition at line 37 of file Decision.h.

37{ m_overflow = value; }

Member Data Documentation

◆ m_ambiguity

bool TCS::Decision::m_ambiguity = false
private

Definition at line 56 of file Decision.h.

◆ m_decision

uint32_t TCS::Decision::m_decision {0}
private

Definition at line 49 of file Decision.h.

49{0};

◆ m_firstBit

unsigned int TCS::Decision::m_firstBit {0}
private

Definition at line 50 of file Decision.h.

50{0};

◆ m_nBits

unsigned int TCS::Decision::m_nBits {1}
private

Definition at line 51 of file Decision.h.

51{1};

◆ m_overflow

bool TCS::Decision::m_overflow
private

Definition at line 52 of file Decision.h.


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