Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
KM3NETDAQ::JEvent_t Struct Reference

Auxiliary class for handling event name and optional number. More...

#include <JRuncontrolToolkit.hh>

Public Member Functions

 JEvent_t ()
 Default constructor. More...
 
 JEvent_t (const std::string &name, const int number)
 Constructor. More...
 
const std::string & getName () const
 Get event name. More...
 
int getNumber () const
 Get event number. More...
 

Static Public Member Functions

static JEvent_t toValue (const std::string &buffer)
 Convert string to event. More...
 

Protected Attributes

std::string event_name
 
int event_number
 

Friends

std::istream & operator>> (std::istream &in, JEvent_t &object)
 Read event name and optional number from input stream. More...
 
std::ostream & operator<< (std::ostream &out, const JEvent_t &object)
 Write event to output stream. More...
 

Detailed Description

Auxiliary class for handling event name and optional number.

Definition at line 65 of file JRuncontrolToolkit.hh.

Constructor & Destructor Documentation

KM3NETDAQ::JEvent_t::JEvent_t ( )
inline

Default constructor.

Definition at line 69 of file JRuncontrolToolkit.hh.

69  :
70  event_name ("?"),
71  event_number(0)
72  {}
KM3NETDAQ::JEvent_t::JEvent_t ( const std::string &  name,
const int  number 
)
inline

Constructor.

Parameters
nameevent name
numberevent number

Definition at line 81 of file JRuncontrolToolkit.hh.

82  :
83  event_name (name),
84  event_number(number)
85  {}
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42

Member Function Documentation

const std::string& KM3NETDAQ::JEvent_t::getName ( ) const
inline

Get event name.

Returns
event name

Definition at line 93 of file JRuncontrolToolkit.hh.

94  {
95  return event_name;
96  }
int KM3NETDAQ::JEvent_t::getNumber ( ) const
inline

Get event number.

Returns
event number

Definition at line 104 of file JRuncontrolToolkit.hh.

105  {
106  return event_number;
107  }
static JEvent_t KM3NETDAQ::JEvent_t::toValue ( const std::string &  buffer)
inlinestatic

Convert string to event.

Parameters
bufferbuffer
Returns
event

Definition at line 116 of file JRuncontrolToolkit.hh.

117  {
118  using namespace std;
119  using namespace JPP;
120 
121  JEvent_t object;
122 
123  const string::size_type sep = buffer.find(EVENTNAME_DELIMETER);
124 
125  if (sep != string::npos) {
126 
127  istringstream(buffer.substr(sep + 1)) >> object.event_number;
128 
129  object.event_name = trim(buffer.substr(0, sep));
130 
131  } else {
132 
133  object.event_name = trim(buffer);
134  object.event_number = -1;
135  }
136 
137  return object;
138  }
static const char EVENTNAME_DELIMETER
Definition: JDAQTags.hh:35
std::string trim(const std::string &buffer)
Trim string.
Definition: JLangToolkit.hh:79
JEvent_t()
Default constructor.

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JEvent_t object 
)
friend

Read event name and optional number from input stream.

Parameters
ininput stream
objectevent
Returns
input stream

Definition at line 148 of file JRuncontrolToolkit.hh.

149  {
150  std::string buffer;
151 
152  in >> buffer;
153 
154  object = JEvent_t::toValue(buffer);
155 
156  return in;
157  }
static JEvent_t toValue(const std::string &buffer)
Convert string to event.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const JEvent_t object 
)
friend

Write event to output stream.

Parameters
outoutput stream
objectevent
Returns
output stream

Definition at line 167 of file JRuncontrolToolkit.hh.

168  {
169  out << object.event_name;
170 
171  if (object.event_number != -1) {
172  out << getEventnameDelimeter() << object.event_number;
173  }
174 
175  return out;
176  }
char getEventnameDelimeter()
Get the event name delimeter.

Member Data Documentation

std::string KM3NETDAQ::JEvent_t::event_name
protected

Definition at line 180 of file JRuncontrolToolkit.hh.

int KM3NETDAQ::JEvent_t::event_number
protected

Definition at line 181 of file JRuncontrolToolkit.hh.


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