Jpp
 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< JLocation_t >

Public Member Functions

 JLocation_t ()
 Default constructor. More...
 
 JLocation_t (const int string, const int floor, const int position)
 Constructor. 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 28 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 35 of file JProductRouter.hh.

35  :
36  string (-1),
37  floor (-1),
38  position(-1)
39  {}
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 49 of file JProductRouter.hh.

51  :
52  string (string),
53  floor (floor),
55  {}
int floor
position in string
int position
position in floor
int string
position in detector

Member Function Documentation

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

65  {
66  if (this->string == location.string) {
67 
68  if (this->floor == location.floor)
69  return this->position < location.position;
70  else
71  return this->floor < location.floor;
72 
73  } else {
74 
75  return this->string < location.string;
76  }
77  }
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 87 of file JProductRouter.hh.

88  {
89  using namespace std;
90  using namespace JPP;
91 
92  return out << FILL(3,'0') << object.string << '.'
93  << FILL(2,'0') << object.floor << '.'
94  << FILL(2,'0') << object.position << FILL();
95  }
Auxiliary data structure for sequence of same character.
Definition: JPrint.hh:361

Member Data Documentation

int JDATABASE::JLocation_t::string

position in detector

Definition at line 98 of file JProductRouter.hh.

int JDATABASE::JLocation_t::floor

position in string

Definition at line 99 of file JProductRouter.hh.

int JDATABASE::JLocation_t::position

position in floor

Definition at line 100 of file JProductRouter.hh.


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