Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JDB::JDatalogString Struct Reference

Auxiliary data structure for datalog strings. More...

#include <JDatalogString.hh>

Public Member Functions

bool match (const JDatalogString &datalog) const
 Get match.
 

Static Public Member Functions

static const char *const getName ()
 Table name.
 

Public Attributes

int run
 
long int utc
 
std::string source
 
std::string parameter
 
std::string data
 

Friends

std::istream & operator>> (std::istream &in, JDatalogString &object)
 Read datalog from input.
 
std::ostream & operator<< (std::ostream &out, const JDatalogString &object)
 Write datalog to output.
 

Detailed Description

Auxiliary data structure for datalog strings.

Definition at line 33 of file JDatalogString.hh.

Member Function Documentation

◆ getName()

static const char *const JDB::JDatalogString::getName ( )
inlinestatic

Table name.

Definition at line 35 of file JDatalogString.hh.

◆ match()

bool JDB::JDatalogString::match ( const JDatalogString & datalog) const
inline

Get match.

Parameters
datalogdatalog
Returns
true if datalog matches; else false

Definition at line 44 of file JDatalogString.hh.

45 {
46 using namespace std;
47
48 if (!datalog.source .empty() && datalog.source != source) { return false; }
49 if (!datalog.parameter.empty() && datalog.parameter != parameter) { return false; }
50 if (!datalog.data .empty() && !regex_match(data, regex(datalog.data))) { return false; }
51
52 return true;
53 }

Friends And Related Symbol Documentation

◆ operator>>

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

Read datalog from input.

Parameters
ininput stream
objectdatalog
Returns
input stream

Definition at line 63 of file JDatalogString.hh.

64 {
65 object = JDatalogString();
66
67 in >> object.run
68 >> object.utc
69 >> object.source
70 >> object.parameter;
71
72 while (in.peek() != EOF && isspace((char) in.peek())) { in.ignore(1); }
73
74 return getline(in, object.data);
75 }
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition JString.hh:478

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JDatalogString & object )
friend

Write datalog to output.

Parameters
outoutput stream
objectdatalog
Returns
output stream

Definition at line 85 of file JDatalogString.hh.

86 {
87 using namespace JPP;
88
89 JDateAndTime utc(object.utc / 1000, 1.0e-3 * (float) (object.utc%1000) , true);
90
91 //out << object.run << ' ';
92 out << object.utc << ' ';
93 out << utc << ' ';
94 out << object.source << ' ';
95 out << object.parameter << ' ';
96 out << object.data;
97
98 return out;
99 }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for date and time.

Member Data Documentation

◆ run

int JDB::JDatalogString::run

Definition at line 101 of file JDatalogString.hh.

◆ utc

long int JDB::JDatalogString::utc

Definition at line 102 of file JDatalogString.hh.

◆ source

std::string JDB::JDatalogString::source

Definition at line 103 of file JDatalogString.hh.

◆ parameter

std::string JDB::JDatalogString::parameter

Definition at line 104 of file JDatalogString.hh.

◆ data

std::string JDB::JDatalogString::data

Definition at line 105 of file JDatalogString.hh.


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