Jpp  16.0.2
the software that should make you happy
 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< JClass_t, JTypelist_t > 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...
 
int & getID ()
 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 applied to the event counter for the evaluation of the hash key. More...
 

Static Protected Member Functions

template<class JHead_t , class JTail_t >
static bool lt (const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
 Less than method for composite data types. More...
 
template<class JHead_t >
static bool lt (const JClass_t &first, const JClass_t &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.

The emitter key can be used to umambiguously address an event in a data set.

Definition at line 32 of file JEKey.hh.

Constructor & Destructor Documentation

JACOUSTICS::JEKey::JEKey ( )
inline

Default constructor.

Definition at line 47 of file JEKey.hh.

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

Constructor.

Parameters
idemitter identifier
counterevent counter

Definition at line 57 of file JEKey.hh.

58  :
59  JObjectID(id),
60  JCounter (counter)
61  {}
JCounter()
Default constructor.
JObjectID()
Default constructor.
Definition: JObjectID.hh:30

Member Function Documentation

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

Get hash key.

Returns
hash key

Definition at line 69 of file JEKey.hh.

70  {
71  return getCounter() * COUNTER + getID();
72  }
int getCounter() const
Get counter.
static const int COUNTER
Multiplication factor applied to the event counter for the evaluation of the hash key...
Definition: JEKey.hh:41
int getID() const
Get identifier.
Definition: JObjectID.hh:50
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51  {
52  return __id;
53  }
int& JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62  {
63  return __id;
64  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73  {
74  this->__id = id;
75  }
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 84 of file JObjectID.hh.

85  {
86  return this->getID() < object.getID();
87  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
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 96 of file JObjectID.hh.

97  {
98  return this->getID() < id;
99  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
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 108 of file JObjectID.hh.

109  {
110  return this->getID() > id;
111  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
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
template<class JClass_t, class JTypelist_t>
template<class JHead_t , class JTail_t >
static bool JLANG::JMultiComparable< JClass_t, JTypelist_t >::lt ( const JClass_t &  first,
const JClass_t &  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 JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
Less than method for composite data types.
template<class JClass_t, class JTypelist_t>
template<class JHead_t >
static bool JLANG::JMultiComparable< JClass_t, JTypelist_t >::lt ( const JClass_t &  first,
const JClass_t &  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 82 of file JEKey.hh.

83  {
84  using namespace std;
85 
86  return out << setw(3) << key.getID() << ' '
87  << setw(8) << key.getCounter();
88  }
int getCounter() const
Get counter.
int getID() const
Get identifier.
Definition: JObjectID.hh:50

Member Data Documentation

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

Multiplication factor applied to the event counter for the evaluation of the hash key.


Note that the object identifier of any emitter should not exceed this value.

Definition at line 41 of file JEKey.hh.

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 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: