Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JDATABASE::JLocation_t Struct Reference

Auxiliary data structure for location of product in detector. More...

#include <JLocation_t.hh>

Inheritance diagram for JDATABASE::JLocation_t:
JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JLocation_t ()
 Default constructor.
 
 JLocation_t (const int string, const int floor, const int position)
 Constructor.
 
bool is_valid () const
 Check validity of location.
 
bool less (const JLocation_t &location) const
 Less-than method.
 

Public Attributes

int string
 position in detector
 
int floor
 position in string
 
int position
 position in floor
 

Friends

std::ostream & operator<< (std::ostream &out, const JLocation_t &object)
 Write location to output stream.
 

Detailed Description

Auxiliary data structure for location of product in detector.

Definition at line 24 of file JLocation_t.hh.

Constructor & Destructor Documentation

◆ JLocation_t() [1/2]

JDATABASE::JLocation_t::JLocation_t ( )
inline

Default constructor.


The default corresponds to an invalid location.

Definition at line 31 of file JLocation_t.hh.

31 :
32 string (-1),
33 floor (-1),
34 position(-1)
35 {}
int string
position in detector
int floor
position in string
int position
position in floor

◆ JLocation_t() [2/2]

JDATABASE::JLocation_t::JLocation_t ( const int string,
const int floor,
const int position )
inline

Constructor.

Parameters
stringstring
floorfloor
positionposition

Definition at line 45 of file JLocation_t.hh.

47 :
48 string (string),
49 floor (floor),
51 {}

Member Function Documentation

◆ is_valid()

bool JDATABASE::JLocation_t::is_valid ( ) const
inline

Check validity of location.

Returns
true if valid; else false

Definition at line 59 of file JLocation_t.hh.

60 {
61 return *this != JLocation_t();
62 }
JLocation_t()
Default constructor.

◆ less()

bool JDATABASE::JLocation_t::less ( const JLocation_t & location) const
inline

Less-than method.

Parameters
locationlocation
Returns
true if this location less than given location; else false

Definition at line 71 of file JLocation_t.hh.

72 {
73 if (this->string == location.string) {
74
75 if (this->floor == location.floor)
76 return this->position < location.position;
77 else
78 return this->floor < location.floor;
79
80 } else {
81
82 return this->string < location.string;
83 }
84 }

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JLocation_t & object )
friend

Write location to output stream.

Parameters
outoutput stream
objectlocation
Returns
output stream

Definition at line 94 of file JLocation_t.hh.

95 {
96 using namespace std;
97 using namespace JPP;
98
99 return out << FILL(4,'0') << object.string << '.'
100 << FILL(2,'0') << object.floor << '.'
101 << FILL(2,'0') << object.position << FILL();
102 }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.
Definition JManip.hh:330

Member Data Documentation

◆ string

int JDATABASE::JLocation_t::string

position in detector

Definition at line 105 of file JLocation_t.hh.

◆ floor

int JDATABASE::JLocation_t::floor

position in string

Definition at line 106 of file JLocation_t.hh.

◆ position

int JDATABASE::JLocation_t::position

position in floor

Definition at line 107 of file JLocation_t.hh.


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