Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
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

◆ JEKey() [1/2]

JACOUSTICS::JEKey::JEKey ( )
inline

Default constructor.

Definition at line 47 of file JEKey.hh.

48  {}

◆ JEKey() [2/2]

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),
61  {}
JObjectID()
Default constructor.
Definition: JObjectID.hh:30
JCounter()
Default constructor.

Member Function Documentation

◆ getKey()

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 getID() const
Get identifier.
Definition: JObjectID.hh:50
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

◆ getID() [1/2]

int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51  {
52  return __id;
53  }

◆ getID() [2/2]

int& JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62  {
63  return __id;
64  }

◆ setID()

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  }

◆ less() [1/2]

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  }

◆ less() [2/2]

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  }

◆ more()

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  }

◆ getCounter()

int JACOUSTICS::JCounter::getCounter ( ) const
inlineinherited

Get counter.

Returns
counter

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

52  {
53  return counter;
54  }

◆ ClassDefNV()

JACOUSTICS::JCounter::ClassDefNV ( JCounter  ,
 
)
inherited

◆ lt() [1/2]

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  }
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.
Auxiliary class for a type holder.
Definition: JType.hh:19

◆ lt() [2/2]

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  }

Friends And Related Function Documentation

◆ operator<<

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(4) << key.getCounter();
88  }
Definition: JSTDTypes.hh:14

Member Data Documentation

◆ COUNTER

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.

◆ __id

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

◆ counter

int JACOUSTICS::JCounter::counter
protectedinherited

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


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