Jpp
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 26 of file JProductRouter.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 33 of file JProductRouter.hh.

33  :
34  string (-1),
35  floor (-1),
36  position(-1)
37  {}

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

49  :
50  string (string),
51  floor (floor),
53  {}

Member Function Documentation

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

63  {
64  if (this->string == location.string) {
65 
66  if (this->floor == location.floor)
67  return this->position < location.position;
68  else
69  return this->floor < location.floor;
70 
71  } else {
72 
73  return this->string < location.string;
74  }
75  }

Friends And Related Function 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 85 of file JProductRouter.hh.

86  {
87  using namespace std;
88 
89  return out << setw(3) << object.string << ' ' << setw(2) << object.floor << ' ' << setw(2) << object.position;
90  }

Member Data Documentation

◆ string

int JDATABASE::JLocation_t::string

position in detector

Definition at line 93 of file JProductRouter.hh.

◆ floor

int JDATABASE::JLocation_t::floor

position in string

Definition at line 94 of file JProductRouter.hh.

◆ position

int JDATABASE::JLocation_t::position

position in floor

Definition at line 95 of file JProductRouter.hh.


The documentation for this struct was generated from the following file:
JDATABASE::JLocation_t::floor
int floor
position in string
Definition: JProductRouter.hh:94
JDATABASE::JLocation_t::position
int position
position in floor
Definition: JProductRouter.hh:95
std
Definition: jaanetDictionary.h:36
JDATABASE::JLocation_t::string
int string
position in detector
Definition: JProductRouter.hh:93