Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Friends | List of all members
JACOUSTICS::JEKey Struct Reference

Emitter key. More...

#include <JEKey.hh>

Inheritance diagram for JACOUSTICS::JEKey:
JLANG::JObjectID JACOUSTICS::JCounter JLANG::JMultiComparable< JEKey, JLANG::JTYPELIST< JObjectID, JCounter >::typelist > JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int >

Public Member Functions

 JEKey ()
 Default constructor. More...
 
 JEKey (const JObjectID &id, const JCounter &counter)
 Constructor. More...
 
int getKey () const
 Get hash key. More...
 
int getID () const
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 
int getCounter () const
 Get counter. More...
 
 ClassDefNV (JCounter, 1)
 

Static Public Attributes

static const int COUNTER = 100
 Multiplication factor for emitter identifier. More...
 

Static Protected Member Functions

static bool lt (const JEKey &first, const JEKey &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
 Less than method for composite data types. More...
 
static bool lt (const JEKey &first, const JEKey &second, const JType< JTypeList< JHead_t, JNullType > > &type)
 Less than method for composite data types. More...
 

Protected Attributes

int __id
 
int counter
 

Friends

std::ostream & operator<< (std::ostream &out, const JEKey &key)
 Write emitter key to output stream. More...
 

Detailed Description

Emitter key.

Definition at line 29 of file JEKey.hh.

Constructor & Destructor Documentation

JACOUSTICS::JEKey::JEKey ( )
inline

Default constructor.

Definition at line 43 of file JEKey.hh.

44  {}
JACOUSTICS::JEKey::JEKey ( const JObjectID id,
const JCounter counter 
)
inline

Constructor.

Parameters
idemitter identifier
counterevent counter

Definition at line 53 of file JEKey.hh.

54  :
55  JObjectID(id),
56  JCounter (counter)
57  {}
JCounter()
Default constructor.
JObjectID()
Default constructor.
Definition: JObjectID.hh:35

Member Function Documentation

int JACOUSTICS::JEKey::getKey ( ) const
inline

Get hash key.

Returns
hash key

Definition at line 65 of file JEKey.hh.

66  {
67  return getCounter() * COUNTER + getID();
68  }
int getCounter() const
Get counter.
static const int COUNTER
Multiplication factor for emitter identifier.
Definition: JEKey.hh:37
int getID() const
Get identifier.
Definition: JObjectID.hh:55
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 55 of file JObjectID.hh.

56  {
57  return __id;
58  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 66 of file JObjectID.hh.

67  {
68  this->__id = id;
69  }
bool JLANG::JObjectID::less ( const JObjectID object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 78 of file JObjectID.hh.

79  {
80  return this->getID() < object.getID();
81  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
bool JLANG::JObjectID::less ( const int  id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 90 of file JObjectID.hh.

91  {
92  return this->getID() < id;
93  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
bool JLANG::JObjectID::more ( const int  id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 102 of file JObjectID.hh.

103  {
104  return this->getID() > id;
105  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
int JACOUSTICS::JCounter::getCounter ( ) const
inlineinherited

Get counter.

Returns
counter

Definition at line 46 of file JAcoustics/JCounter.hh.

47  {
48  return counter;
49  }
JACOUSTICS::JCounter::ClassDefNV ( JCounter  ,
 
)
inherited
static bool JLANG::JMultiComparable< JEKey , JLANG::JTYPELIST< JObjectID, JCounter >::typelist >::lt ( const JEKey &  first,
const JEKey &  second,
const JType< JTypeList< JHead_t, JTail_t > > &  type 
)
inlinestaticprotectedinherited

Less than method for composite data types.

Parameters
firstfirst object
secondsecond object
typetype
Returns
true if first object is less than second object; else false

Definition at line 43 of file JMultiComparable.hh.

46  {
47  if (static_cast<const JHead_t&>(first) <
48  static_cast<const JHead_t&>(second))
49  return true;
50  else if (static_cast<const JHead_t&>(second) <
51  static_cast<const JHead_t&>(first))
52  return false;
53  else
54  return lt(first, second, JType<JTail_t>());
55  }
Auxiliary class for a type holder.
Definition: JType.hh:19
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
static bool lt(const JEKey &first, const JEKey &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
Less than method for composite data types.
static bool JLANG::JMultiComparable< JEKey , JLANG::JTYPELIST< JObjectID, JCounter >::typelist >::lt ( const JEKey &  first,
const JEKey &  second,
const JType< JTypeList< JHead_t, JNullType > > &  type 
)
inlinestaticprotectedinherited

Less than method for composite data types.

Parameters
firstfirst object
secondsecond object
typetype
Returns
true if first object is less than second object; else false

Definition at line 67 of file JMultiComparable.hh.

70  {
71  return (static_cast<const JHead_t&>(first) <
72  static_cast<const JHead_t&>(second));
73  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JEKey key 
)
friend

Write emitter key to output stream.

Parameters
outoutput stream
keyemitter key
Returns
output stream

Definition at line 78 of file JEKey.hh.

79  {
80  using namespace std;
81 
82  return out << setw(3) << key.getID() << ' '
83  << setw(8) << key.getCounter();
84  }
int getCounter() const
Get counter.
int getID() const
Get identifier.
Definition: JObjectID.hh:55

Member Data Documentation

const int JACOUSTICS::JEKey::COUNTER = 100
static

Multiplication factor for emitter identifier.

Definition at line 37 of file JEKey.hh.

int JLANG::JObjectID::__id
protectedinherited

Definition at line 160 of file JObjectID.hh.

int JACOUSTICS::JCounter::counter
protectedinherited

Definition at line 54 of file JAcoustics/JCounter.hh.


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