Jpp  master_rocky
the software that should make you happy
Public Types | Public Member Functions | Static Public Member Functions | List of all members
KM3NETDAQ::JEventTable Class Reference

Event table. More...

#include <JEventTable.hh>

Inheritance diagram for KM3NETDAQ::JEventTable:
std::map< std::string, JDAQStateMachine::ev_daq_event * >

Public Types

typedef std::map< std::string, JDAQStateMachine::ev_daq_event * > JMap_t
 

Public Member Functions

 JEventTable ()
 Default constructor. More...
 
void insert (const JTag &tag, JDAQEvent_t &event)
 Insert entry in table. More...
 
void replace (const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
 Replace entry in table. More...
 
const_iterator find (const JTag &tag, const std::string &event_name) const
 Find entry. More...
 

Static Public Member Functions

static std::string getKey (const JTag &tag, const CHSM::event &event)
 Get key for a given tag and event. More...
 
static std::string getKey (const JTag &tag, const std::string &event_name)
 Get key for a given tag and event name. More...
 

Detailed Description

Event table.

This class consists of a STL map<key,value> in which the key corresponds to the unique combination of a ControlHost tag and an event name. The associated value points to the corresponding event.

Definition at line 35 of file JEventTable.hh.

Member Typedef Documentation

◆ JMap_t

Definition at line 40 of file JEventTable.hh.

Constructor & Destructor Documentation

◆ JEventTable()

KM3NETDAQ::JEventTable::JEventTable ( )
inline

Default constructor.

Definition at line 46 of file JEventTable.hh.

46  :
47  JMap_t()
48  {}
std::map< std::string, JDAQStateMachine::ev_daq_event * > JMap_t
Definition: JEventTable.hh:40

Member Function Documentation

◆ getKey() [1/2]

static std::string KM3NETDAQ::JEventTable::getKey ( const JTag tag,
const CHSM::event &  event 
)
inlinestatic

Get key for a given tag and event.

Parameters
tagtag
eventevent
Returns
key

Definition at line 58 of file JEventTable.hh.

59  {
60  return getKey(tag, event.name());
61  }
static std::string getKey(const JTag &tag, const CHSM::event &event)
Get key for a given tag and event.
Definition: JEventTable.hh:58

◆ getKey() [2/2]

static std::string KM3NETDAQ::JEventTable::getKey ( const JTag tag,
const std::string &  event_name 
)
inlinestatic

Get key for a given tag and event name.

Parameters
tagtag
event_nameevent name
Returns
key

Definition at line 71 of file JEventTable.hh.

72  {
73  return tag.toString() + getTokenDelimeter() + event_name;
74  }
std::string toString() const
Convert tag to string.
Definition: JTag.hh:171
char getTokenDelimeter()
Get the token delimeter for command messages.

◆ insert()

void KM3NETDAQ::JEventTable::insert ( const JTag tag,
JDAQEvent_t event 
)
inline

Insert entry in table.

Parameters
tagtag
eventevent

Definition at line 83 of file JEventTable.hh.

84  {
85  JMap_t::insert(make_pair(getKey(tag,event), &event));
86  }

◆ replace()

void KM3NETDAQ::JEventTable::replace ( const JTag oldTag,
const JTag newTag,
JDAQEvent_t event 
)
inline

Replace entry in table.

Parameters
oldTagold tag
newTagnew tag
eventevent

Definition at line 96 of file JEventTable.hh.

99  {
100  iterator i = JMap_t::find(getKey(oldTag,event));
101 
102  if (i != this->end()) {
103  this->erase(i);
104  }
105 
106  insert(newTag, event);
107  }
void insert(const JTag &tag, JDAQEvent_t &event)
Insert entry in table.
Definition: JEventTable.hh:83

◆ find()

const_iterator KM3NETDAQ::JEventTable::find ( const JTag tag,
const std::string &  event_name 
) const
inline

Find entry.

Parameters
tagtag
event_nameevent name

Definition at line 116 of file JEventTable.hh.

117  {
118  return JMap_t::find(getKey(tag,event_name));
119  }

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