Jpp
Public Member Functions | Protected Attributes | Friends | List of all members
JLANG::JObjectID Class Reference

Auxiliary class for object identification. More...

#include <JObjectID.hh>

Inheritance diagram for JLANG::JObjectID:
JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int > JDETECTOR::JAnchor JDETECTOR::JDetector JDETECTOR::JModule JDETECTOR::JModuleGeometry JDETECTOR::JModulePosition_t JDETECTOR::JModuleRotation_t JDETECTOR::JMonteCarloDetector::LCM_logic JDETECTOR::JMonteCarloDetector::LCM_reverse_logic JDETECTOR::JMonteCarloDetector::OM JDETECTOR::JMonteCarloDetector::OM_cluster JDETECTOR::JMonteCarloDetector::OM_cluster_data JDETECTOR::JMonteCarloDetector::OM_position JDETECTOR::JMonteCarloDetector::String JDETECTOR::JPMT JDETECTOR::JPMTCalibration_t JDETECTOR::JPMTChannel JDETECTOR::JPMTIdentifier JFIT::JK40Hit JSIRENE::JPulse

Public Member Functions

 JObjectID ()
 Default constructor. More...
 
 JObjectID (const int id)
 Constructor. More...
 
int getID () const
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 

Protected Attributes

int __id
 

Friends

std::istream & operator>> (std::istream &in, JObjectID &object)
 Read object identifier from input. More...
 
std::ostream & operator<< (std::ostream &out, const JObjectID &object)
 Write object identifier to output. More...
 
JReaderoperator>> (JReader &in, JObjectID &object)
 Read object identifier from input. More...
 
JWriteroperator<< (JWriter &out, const JObjectID &object)
 Write object identifier to output. More...
 

Detailed Description

Auxiliary class for object identification.

Definition at line 27 of file JObjectID.hh.

Constructor & Destructor Documentation

◆ JObjectID() [1/2]

JLANG::JObjectID::JObjectID ( )
inline

Default constructor.

Definition at line 35 of file JObjectID.hh.

35  :
36  __id(-1)
37  {}

◆ JObjectID() [2/2]

JLANG::JObjectID::JObjectID ( const int  id)
inline

Constructor.

Parameters
ididentifier

Definition at line 45 of file JObjectID.hh.

45  :
46  __id(id)
47  {}

Member Function Documentation

◆ getID()

int JLANG::JObjectID::getID ( ) const
inline

Get identifier.

Returns
identifier

Definition at line 55 of file JObjectID.hh.

56  {
57  return __id;
58  }

◆ setID()

void JLANG::JObjectID::setID ( const int  id)
inline

Set identifier.

Parameters
ididentifier

Definition at line 66 of file JObjectID.hh.

67  {
68  this->__id = id;
69  }

◆ less() [1/2]

bool JLANG::JObjectID::less ( const JObjectID object) const
inline

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 78 of file JObjectID.hh.

79  {
80  return this->getID() < object.getID();
81  }

◆ less() [2/2]

bool JLANG::JObjectID::less ( const int  id) const
inline

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 90 of file JObjectID.hh.

91  {
92  return this->getID() < id;
93  }

◆ more()

bool JLANG::JObjectID::more ( const int  id) const
inline

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 102 of file JObjectID.hh.

103  {
104  return this->getID() > id;
105  }

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JObjectID object 
)
friend

Read object identifier from input.

Parameters
ininput stream
objectobject identifier
Returns
input stream

Definition at line 115 of file JObjectID.hh.

116  {
117  return in >> object.__id;
118  }

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const JObjectID object 
)
friend

Write object identifier to output.

Parameters
outoutput stream
objectobject identifier
Returns
output stream

Definition at line 128 of file JObjectID.hh.

129  {
130  return out << object.__id;
131  }

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JObjectID object 
)
friend

Read object identifier from input.

Parameters
inreader
objectobject identifier
Returns
reader

Definition at line 141 of file JObjectID.hh.

142  {
143  return in >> object.__id;
144  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JObjectID object 
)
friend

Write object identifier to output.

Parameters
outwriter
objectobject identifier
Returns
writer

Definition at line 154 of file JObjectID.hh.

155  {
156  return out << object.__id;
157  }

Member Data Documentation

◆ __id

int JLANG::JObjectID::__id
protected

Definition at line 160 of file JObjectID.hh.


The documentation for this class was generated from the following file:
JLANG::JObjectID::getID
int getID() const
Get identifier.
Definition: JObjectID.hh:55
JLANG::JObjectID::__id
int __id
Definition: JObjectID.hh:160