Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
JDATABASE::JLocation_t Struct Reference

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

#include <JProductRouter.hh>

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

Public Member Functions

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

Public Attributes

int string
 position in detector More...
 
int floor
 position in string More...
 
int position
 position in floor More...
 

Friends

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

Detailed Description

Auxiliary data structure for location of product in detector.

Definition at line 29 of file JProductRouter.hh.

Constructor & Destructor Documentation

JDATABASE::JLocation_t::JLocation_t ( )
inline

Default constructor.


The default corresponds to an invalid location.

Definition at line 36 of file JProductRouter.hh.

36  :
37  string (-1),
38  floor (-1),
39  position(-1)
40  {}
int floor
position in string
int position
position in floor
int string
position in detector
JDATABASE::JLocation_t::JLocation_t ( const int  string,
const int  floor,
const int  position 
)
inline

Constructor.

Parameters
stringstring
floorfloor
positionposition

Definition at line 50 of file JProductRouter.hh.

52  :
53  string (string),
54  floor (floor),
56  {}
int floor
position in string
int position
position in floor
int string
position in detector

Member Function Documentation

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

Check validity of location.

Returns
true if valid; else false

Definition at line 64 of file JProductRouter.hh.

65  {
66  return *this != JLocation_t();
67  }
JLocation_t()
Default constructor.
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 76 of file JProductRouter.hh.

77  {
78  if (this->string == location.string) {
79 
80  if (this->floor == location.floor)
81  return this->position < location.position;
82  else
83  return this->floor < location.floor;
84 
85  } else {
86 
87  return this->string < location.string;
88  }
89  }
int floor
position in string
int position
position in floor
int string
position in detector

Friends And Related Function Documentation

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 99 of file JProductRouter.hh.

100  {
101  using namespace std;
102  using namespace JPP;
103 
104  return out << right
105  << FILL(4,'0') << object.string << '.'
106  << FILL(2,'0') << object.floor << '.'
107  << FILL(2,'0') << object.position << FILL() << left;
108  }
Auxiliary data structure for sequence of same character.
Definition: JManip.hh:328

Member Data Documentation

int JDATABASE::JLocation_t::string

position in detector

Definition at line 111 of file JProductRouter.hh.

int JDATABASE::JLocation_t::floor

position in string

Definition at line 112 of file JProductRouter.hh.

int JDATABASE::JLocation_t::position

position in floor

Definition at line 113 of file JProductRouter.hh.


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