Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
Hardware::HardwareID Class Reference

#include <HardwareElements.h>

Inheritance diagram for Hardware::HardwareID:
Hardware::Element Hardware::APA Hardware::APAGroup Hardware::ASIC Hardware::Board Hardware::Cryostat Hardware::TPC

Public Member Functions

 HardwareID ()
 
 HardwareID (ID id, std::string this_type)
 
ID const & getID () const
 
std::string const & getType () const
 

Protected Member Functions

int getTypeOrder () const
 

Private Attributes

ID fID
 
std::string fType
 

Friends

bool operator< (const HardwareID &lhs, const HardwareID &rhs)
 
std::ostream & operator<< (std::ostream &os, HardwareID const &rhs)
 

Detailed Description

Definition at line 27 of file HardwareElements.h.

Constructor & Destructor Documentation

Hardware::HardwareID::HardwareID ( )
inline

Definition at line 29 of file HardwareElements.h.

29 : fID(0), fType("Unknown") {}
Hardware::HardwareID::HardwareID ( ID  id,
std::string  this_type 
)
inline

Definition at line 30 of file HardwareElements.h.

30 : fID(id), fType(this_type) {}

Member Function Documentation

ID const& Hardware::HardwareID::getID ( ) const
inline

Definition at line 31 of file HardwareElements.h.

31 { return fID;}
std::string const& Hardware::HardwareID::getType ( ) const
inline

Definition at line 32 of file HardwareElements.h.

32 { return fType; }
int Hardware::HardwareID::getTypeOrder ( ) const
inlineprotected

Definition at line 48 of file HardwareElements.h.

48  {
49  if(fType == "APA") return 0;
50  if(fType == "TPC") return 1;
51  if(fType == "Board") return 2;
52  if(fType == "ASIC") return 3;
53  else return -1;
54  }

Friends And Related Function Documentation

bool operator< ( const HardwareID lhs,
const HardwareID rhs 
)
friend

Definition at line 35 of file HardwareElements.h.

35  {
36  if( lhs.getTypeOrder() == rhs.getTypeOrder())
37  return lhs.getID() < rhs.getID();
38  else return lhs.getTypeOrder() < rhs.getTypeOrder();
39  }
std::ostream& operator<< ( std::ostream &  os,
HardwareID const &  rhs 
)
friend

Definition at line 41 of file HardwareElements.h.

41  {
42  os << rhs.getType() << ": " << rhs.getID();
43  return os;
44  }

Member Data Documentation

ID Hardware::HardwareID::fID
private

Definition at line 61 of file HardwareElements.h.

std::string Hardware::HardwareID::fType
private

Definition at line 62 of file HardwareElements.h.


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