ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::TransferElementID Class Reference

Simple class holding a unique ID for a TransferElement. More...

#include <TransferElementID.h>

Public Member Functions

 TransferElementID ()=default
 Default constructor constructs an invalid ID, which may be assigned with another ID. More...
 
 TransferElementID (const TransferElementID &other)=default
 Copy ID from another. More...
 
bool operator== (const TransferElementID &other) const
 Compare ID with another. More...
 
bool operator!= (const TransferElementID &other) const
 
bool isValid () const
 Check whether the ID is valid. More...
 
TransferElementIDoperator= (const TransferElementID &other)=default
 Assign ID from another. More...
 

Protected Member Functions

void makeUnique ()
 Assign an ID to this instance. More...
 

Protected Attributes

size_t _id {0}
 The actual ID value. More...
 

Friends

struct std::hash< TransferElementID >
 
struct std::less< TransferElementID >
 
class TransferElement
 
std::ostream & operator<< (std::ostream &os, const TransferElementID &me)
 Streaming operator to stream the TransferElementID e.g. More...
 

Detailed Description

Simple class holding a unique ID for a TransferElement.

The ID is guaranteed to be unique for all accessors throughout the lifetime of the process.

Definition at line 17 of file TransferElementID.h.

Constructor & Destructor Documentation

◆ TransferElementID() [1/2]

ChimeraTK::TransferElementID::TransferElementID ( )
default

Default constructor constructs an invalid ID, which may be assigned with another ID.

◆ TransferElementID() [2/2]

ChimeraTK::TransferElementID::TransferElementID ( const TransferElementID other)
default

Copy ID from another.

Member Function Documentation

◆ isValid()

bool ChimeraTK::TransferElementID::isValid ( ) const
inline

Check whether the ID is valid.

Definition at line 36 of file TransferElementID.h.

◆ makeUnique()

void ChimeraTK::TransferElementID::makeUnique ( )
protected

Assign an ID to this instance.

May only be called if currently no ID has been assigned.

Definition at line 14 of file TransferElementID.cc.

+ Here is the caller graph for this function:

◆ operator!=()

bool ChimeraTK::TransferElementID::operator!= ( const TransferElementID other) const
inline

Definition at line 33 of file TransferElementID.h.

+ Here is the call graph for this function:

◆ operator=()

TransferElementID& ChimeraTK::TransferElementID::operator= ( const TransferElementID other)
default

Assign ID from another.

◆ operator==()

bool ChimeraTK::TransferElementID::operator== ( const TransferElementID other) const
inline

Compare ID with another.

Will always return false, if the ID is invalid (i.e. setId() was never called).

Definition at line 32 of file TransferElementID.h.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const TransferElementID me 
)
friend

Streaming operator to stream the TransferElementID e.g.

to std::cout

Definition at line 24 of file TransferElementID.cc.

◆ std::hash< TransferElementID >

friend struct std::hash< TransferElementID >
friend

Definition at line 51 of file TransferElementID.h.

◆ std::less< TransferElementID >

friend struct std::less< TransferElementID >
friend

Definition at line 54 of file TransferElementID.h.

◆ TransferElement

friend class TransferElement
friend

Definition at line 57 of file TransferElementID.h.

Member Data Documentation

◆ _id

size_t ChimeraTK::TransferElementID::_id {0}
protected

The actual ID value.

Definition at line 48 of file TransferElementID.h.


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