Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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, int > JDETECTOR::JAnchor JDETECTOR::JDetector JDETECTOR::JModule JDETECTOR::JModuleGeometry 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::JPMTChannel JDETECTOR::JPMTIdentifier 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

JLANG::JObjectID::JObjectID ( )
inline

Default constructor.

Definition at line 34 of file JObjectID.hh.

34  :
35  __id(-1)
36  {}
JLANG::JObjectID::JObjectID ( const int  id)
inline

Constructor.

Parameters
ididentifier

Definition at line 44 of file JObjectID.hh.

44  :
45  __id(id)
46  {}

Member Function Documentation

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

Get identifier.

Returns
identifier

Definition at line 54 of file JObjectID.hh.

55  {
56  return __id;
57  }
void JLANG::JObjectID::setID ( const int  id)
inline

Set identifier.

Parameters
ididentifier

Definition at line 65 of file JObjectID.hh.

66  {
67  this->__id = id;
68  }
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 77 of file JObjectID.hh.

78  {
79  return this->getID() < object.getID();
80  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
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 89 of file JObjectID.hh.

90  {
91  return this->getID() < id;
92  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
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 101 of file JObjectID.hh.

102  {
103  return this->getID() > id;
104  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54

Friends And Related Function Documentation

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 114 of file JObjectID.hh.

115  {
116  return in >> object.__id;
117  }
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 127 of file JObjectID.hh.

128  {
129  return out << object.__id;
130  }
JReader& operator>> ( JReader in,
JObjectID object 
)
friend

Read object identifier from input.

Parameters
inreader
objectobject identifier
Returns
reader

Definition at line 140 of file JObjectID.hh.

141  {
142  return in >> object.__id;
143  }
JWriter& operator<< ( JWriter out,
const JObjectID object 
)
friend

Write object identifier to output.

Parameters
outwriter
objectobject identifier
Returns
writer

Definition at line 153 of file JObjectID.hh.

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

Member Data Documentation

int JLANG::JObjectID::__id
protected

Definition at line 159 of file JObjectID.hh.


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