Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
JDETECTOR::JModuleMap_t Struct Reference

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

#include <JDetectorCalibration.hh>

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

Public Types

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

Public Member Functions

 JModuleMap_t ()
 Default constructor. More...
 
 JModuleMap_t (const JObjectID &id)
 Constructor. More...
 
int getID () const
 Get identifier. More...
 
int & getID ()
 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

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

Detailed Description

Auxiliary data structure for module address map.

Definition at line 85 of file JDetectorCalibration.hh.

Member Typedef Documentation

Definition at line 89 of file JDetectorCalibration.hh.

Constructor & Destructor Documentation

JDETECTOR::JModuleMap_t::JModuleMap_t ( )
inline

Default constructor.

Definition at line 94 of file JDetectorCalibration.hh.

95  {}
JDETECTOR::JModuleMap_t::JModuleMap_t ( const JObjectID id)
inline

Constructor.

Parameters
idmodule identifier

Definition at line 103 of file JDetectorCalibration.hh.

103  :
104  JObjectID(id)
105  {}
JObjectID()
Default constructor.
Definition: JObjectID.hh:30

Member Function Documentation

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

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51  {
52  return __id;
53  }
int& JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62  {
63  return __id;
64  }
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  }
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
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  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
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  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50

Friends And Related Function Documentation

void to_json ( json js,
const JModuleMap_t object 
)
friend

Convert module address map to JSon.

Parameters
jsjson
objectmodule address map

Definition at line 114 of file JDetectorCalibration.hh.

115  {
116  js = json{ { Id_t, object.getID() },
117  { DOMMap_t, static_cast<const JModuleMap_t::map_type&>(object) } };
118  }
static const std::string Id_t
static const std::string DOMMap_t
nlohmann::json 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 127 of file JDetectorCalibration.hh.

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

Member Data Documentation

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.


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