Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JObjectID< T > Class Template Reference

Auxiliary base class for object identification. More...

#include <JObjectID.hh>

Inheritance diagram for JLANG::JObjectID< T >:
JLANG::JComparable< JObjectID< T > > JLANG::JComparable< JObjectID< T >, int > JACOUSTICS::JEKey JACOUSTICS::JEmitter JACOUSTICS::JReceiver JCOMPASS::JHit JDETECTOR::JAnchor JDETECTOR::JCompassRotation_t JDETECTOR::JDetector JDETECTOR::JModule JDETECTOR::JModuleCalibration_t JDETECTOR::JModuleGeometry JDETECTOR::JModuleMap_t JDETECTOR::JModulePosition_t JDETECTOR::JModuleRotation_t JDETECTOR::JModuleStatus_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::JPMTIdentifier JDETECTOR::JPMTStatus_t JDETECTOR::JTransmitter JDETECTOR::JTripod JPHYSICS::JRadiationInterface JSIRENE::JPulse

Public Member Functions

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

Protected Attributes

int _id_
 

Friends

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

Detailed Description

template<class T>
class JLANG::JObjectID< T >

Auxiliary base class for object identification.

Definition at line 35 of file JObjectID.hh.

Constructor & Destructor Documentation

◆ JObjectID() [1/2]

template<class T >
JLANG::JObjectID< T >::JObjectID ( )
inline

Default constructor.

Definition at line 43 of file JObjectID.hh.

43 :
45 {}
int getUndefinedObjectID()
Get undefined object identifier.
Definition JObjectID.hh:25

◆ JObjectID() [2/2]

template<class T >
JLANG::JObjectID< T >::JObjectID ( const int id)
inline

Constructor.

Parameters
ididentifier

Definition at line 53 of file JObjectID.hh.

53 :
54 _id_(id)
55 {}

Member Function Documentation

◆ getID() [1/2]

template<class T >
int JLANG::JObjectID< T >::getID ( ) const
inline

Get identifier.

Returns
identifier

Definition at line 63 of file JObjectID.hh.

64 {
65 return _id_;
66 }

◆ getID() [2/2]

template<class T >
int & JLANG::JObjectID< T >::getID ( )
inline

Get identifier.

Returns
identifier

Definition at line 74 of file JObjectID.hh.

75 {
76 return _id_;
77 }

◆ setID()

template<class T >
void JLANG::JObjectID< T >::setID ( const int id)
inline

Set identifier.

Parameters
ididentifier

Definition at line 85 of file JObjectID.hh.

86 {
87 this->_id_ = id;
88 }

◆ less() [1/2]

template<class T >
bool JLANG::JObjectID< T >::less ( const JObjectID< T > & object) const
inline

Less than method.

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

Definition at line 97 of file JObjectID.hh.

98 {
99 return this->getID() < object.getID();
100 }
int getID() const
Get identifier.
Definition JObjectID.hh:63

◆ less() [2/2]

template<class T >
bool JLANG::JObjectID< T >::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 109 of file JObjectID.hh.

110 {
111 return this->getID() < id;
112 }

◆ more()

template<class T >
bool JLANG::JObjectID< T >::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 121 of file JObjectID.hh.

122 {
123 return this->getID() > id;
124 }

Friends And Related Symbol Documentation

◆ operator>>

template<class T >
std::istream & operator>> ( std::istream & in,
JObjectID< T > & object )
friend

Read object identifier from input.

Parameters
ininput stream
objectobject identifier
Returns
input stream

Definition at line 134 of file JObjectID.hh.

135 {
136 return in >> object._id_;
137 }

◆ operator<<

template<class T >
std::ostream & operator<< ( std::ostream & out,
const JObjectID< T > & object )
friend

Write object identifier to output.

Parameters
outoutput stream
objectobject identifier
Returns
output stream

Definition at line 147 of file JObjectID.hh.

148 {
149 return out << object._id_;
150 }

Member Data Documentation

◆ _id_

template<class T >
int JLANG::JObjectID< T >::_id_
protected

Definition at line 153 of file JObjectID.hh.


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