Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JDETECTOR::JModuleMap_t Struct Reference

Auxiliary data structure for module address map. More...

#include <JDetectorCalibration.hh>

Inheritance diagram for JDETECTOR::JModuleMap_t:
JLANG::JObjectID< T > std::map< std::string, int > JLANG::JComparable< JObjectID< T > > JLANG::JComparable< JObjectID< T >, int >

Public Types

typedef std::map< std::string, int > map_type
 

Public Member Functions

 JModuleMap_t ()
 Default constructor.
 
 JModuleMap_t (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

void to_json (json &js, const JModuleMap_t &object)
 Convert module address map to JSon.
 
void from_json (const json &js, JModuleMap_t &object)
 Convert JSon to module address map.
 

Detailed Description

Auxiliary data structure for module address map.

Definition at line 84 of file JDetectorCalibration.hh.

Member Typedef Documentation

◆ map_type

Definition at line 88 of file JDetectorCalibration.hh.

Constructor & Destructor Documentation

◆ JModuleMap_t() [1/2]

JDETECTOR::JModuleMap_t::JModuleMap_t ( )
inline

Default constructor.

Definition at line 93 of file JDetectorCalibration.hh.

94 {}

◆ JModuleMap_t() [2/2]

JDETECTOR::JModuleMap_t::JModuleMap_t ( const int id)
inline

Constructor.

Parameters
idmodule identifier

Definition at line 102 of file JDetectorCalibration.hh.

102 :
103 JObjectID<JModuleMap_t>(id)
104 {}

Member Function Documentation

◆ getID() [1/2]

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

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 ( )
inlineinherited

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)
inlineinherited

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
inlineinherited

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
inlineinherited

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
inlineinherited

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

◆ to_json

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

Convert module address map to JSon.

Parameters
jsjson
objectmodule address map

Definition at line 113 of file JDetectorCalibration.hh.

114 {
115 js = json{ { Id_t, object.getID() },
116 { DOMMap_t, static_cast<const JModuleMap_t::map_type&>(object) } };
117 }
nlohmann::json json
static const std::string Id_t
static const std::string DOMMap_t
std::map< std::string, int > map_type

◆ from_json

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

Convert JSon to module address map.

Parameters
jsjson
objectmodule address map

Definition at line 126 of file JDetectorCalibration.hh.

127 {
128 object.setID(js.at(Id_t).get<int>());
129
130 static_cast<JModuleMap_t::map_type&>(object) = js.at(DOMMap_t).get<JModuleMap_t::map_type>();
131 }

Member Data Documentation

◆ _id_

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

Definition at line 153 of file JObjectID.hh.


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