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

Definition at line 46 of file JProductRouter.hh.

48  :
49  string (string),
50  floor (floor),
52  {}

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

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

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

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

Member Data Documentation

◆ string

int JDATABASE::JLocation_t::string

position in detector

Definition at line 92 of file JProductRouter.hh.

◆ floor

int JDATABASE::JLocation_t::floor

position in string

Definition at line 93 of file JProductRouter.hh.

◆ position

int JDATABASE::JLocation_t::position

position in floor

Definition at line 94 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:93
JDATABASE::JLocation_t::position
int position
position in floor
Definition: JProductRouter.hh:94
std
Definition: jaanetDictionary.h:36
JDATABASE::JLocation_t::string
int string
position in detector
Definition: JProductRouter.hh:92