Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JDETECTOR::JPMTStatus_t Struct Reference

Auxiliary data structure for PMT status. More...

#include <JDetectorCalibration.hh>

Inheritance diagram for JDETECTOR::JPMTStatus_t:
JLANG::JObjectID JEEP::JStatus JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int > JLANG::JEquals< JFirst_t, JSecond_t >

Public Member Functions

 JPMTStatus_t ()
 Default constructor.
 
 JPMTStatus_t (const JObjectID &id, const JStatus &status)
 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.
 
int getStatus () const
 Get status.
 
JStatusgetStatus ()
 Get status.
 
int getStatus (const int mask) const
 Get status.
 
void setStatus (const JStatus &status)
 Set status.
 
bool equals (const JStatus &status) const
 Equal method.
 
bool has (const int bit) const
 Test PMT status.
 
void set (const int bit)
 Set PMT status.
 
void reset (const int bit)
 Reset PMT status.
 

Protected Attributes

int __id
 
int status
 

Friends

void to_json (json &js, const JPMTStatus_t &object)
 Convert PMT status to JSon.
 
void from_json (const json &js, JPMTStatus_t &object)
 Convert JSon to PMT status.
 

Detailed Description

Auxiliary data structure for PMT status.

Definition at line 194 of file JDetectorCalibration.hh.

Constructor & Destructor Documentation

◆ JPMTStatus_t() [1/2]

JDETECTOR::JPMTStatus_t::JPMTStatus_t ( )
inline

Default constructor.

Definition at line 201 of file JDetectorCalibration.hh.

202 {}

◆ JPMTStatus_t() [2/2]

JDETECTOR::JPMTStatus_t::JPMTStatus_t ( const JObjectID & id,
const JStatus & status )
inline

Constructor.

Parameters
idPMT identifier
statusPMT status

Definition at line 211 of file JDetectorCalibration.hh.

212 :
213 JObjectID(id),
215 {}
JObjectID()
Default constructor.
Definition JObjectID.hh:30
JStatus()
Default constructor.
Definition JStatus.hh:43

Member Function Documentation

◆ getID() [1/2]

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

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51 {
52 return __id;
53 }

◆ getID() [2/2]

int & JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62 {
63 return __id;
64 }

◆ setID()

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

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73 {
74 this->__id = id;
75 }

◆ less() [1/2]

bool JLANG::JObjectID::less ( const JObjectID & object) const
inlineinherited

Less than method.

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

Definition at line 84 of file JObjectID.hh.

85 {
86 return this->getID() < object.getID();
87 }
int getID() const
Get identifier.
Definition JObjectID.hh:50

◆ less() [2/2]

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

Less than method.

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

Definition at line 96 of file JObjectID.hh.

97 {
98 return this->getID() < id;
99 }

◆ more()

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

More than method.

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

Definition at line 108 of file JObjectID.hh.

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

◆ getStatus() [1/3]

int JEEP::JStatus::getStatus ( ) const
inlineinherited

Get status.

Returns
status

Definition at line 63 of file JStatus.hh.

64 {
65 return this->status;
66 }

◆ getStatus() [2/3]

JStatus & JEEP::JStatus::getStatus ( )
inlineinherited

Get status.

Returns
status

Definition at line 74 of file JStatus.hh.

75 {
76 return *this;
77 }

◆ getStatus() [3/3]

int JEEP::JStatus::getStatus ( const int mask) const
inlineinherited

Get status.

Parameters
maskmask
Returns
status

Definition at line 86 of file JStatus.hh.

87 {
88 return (this->status & mask);
89 }

◆ setStatus()

void JEEP::JStatus::setStatus ( const JStatus & status)
inlineinherited

Set status.

Parameters
statusstatus

Definition at line 97 of file JStatus.hh.

98 {
99 this->status = status.status;
100 }

◆ equals()

bool JEEP::JStatus::equals ( const JStatus & status) const
inlineinherited

Equal method.

Parameters
statusstatus
Returns
true if this status equal to given status; else false

Definition at line 109 of file JStatus.hh.

110 {
111 return this->status == status.status;
112 }

◆ has()

bool JEEP::JStatus::has ( const int bit) const
inlineinherited

Test PMT status.

Parameters
bitbit

Definition at line 120 of file JStatus.hh.

121 {
122 return (this->status & (1<<bit)) != 0;
123 }

◆ set()

void JEEP::JStatus::set ( const int bit)
inlineinherited

Set PMT status.

Parameters
bitbit

Definition at line 131 of file JStatus.hh.

132 {
133 this->status |= (1<<bit);
134 }

◆ reset()

void JEEP::JStatus::reset ( const int bit)
inlineinherited

Reset PMT status.

Parameters
bitbit

Definition at line 142 of file JStatus.hh.

143 {
144 this->status &= ~(1<<bit);
145 }

Friends And Related Symbol Documentation

◆ to_json

void to_json ( json & js,
const JPMTStatus_t & object )
friend

Convert PMT status to JSon.

Parameters
jsjson
objectPMT status

Definition at line 224 of file JDetectorCalibration.hh.

225 {
226 js = json{ { Serial_t, object.getID() },
227 { STATUS_t, object.getStatus() } };
228 }
nlohmann::json json
static const std::string STATUS_t
static const std::string Serial_t

◆ from_json

void from_json ( const json & js,
JPMTStatus_t & object )
friend

Convert JSon to PMT status.

Parameters
jsjson
objectPMT status

Definition at line 237 of file JDetectorCalibration.hh.

238 {
239 object.setID(js.at(Serial_t).get<int>());
240
241 object.setStatus(js.at(STATUS_t).get<int>());
242 }

Member Data Documentation

◆ __id

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

◆ status

int JEEP::JStatus::status
protectedinherited

Definition at line 200 of file JStatus.hh.


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