Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JEvtCategorySet Struct Reference

Container for a set of event categories. More...

#include <JEvtCategoryToolkit.hh>

Inheritance diagram for JAANET::JEvtCategorySet:
std::set< JEvtCategoryHelper >

Public Member Functions

 JEvtCategorySet ()
 Default constructor.
 

Friends

std::istream & operator>> (std::istream &in, JEvtCategorySet &categories)
 Stream input.
 
std::ostream & operator<< (std::ostream &out, const JEvtCategorySet &categories)
 Stream output.
 

Detailed Description

Container for a set of event categories.

Input syntax as follows:

      <PDG type> [& <PDG type>]...
      <key>=<value>[,<key>=<value>]...[ & <key>=<value>[,<key>=<value>]...]...

where

  • <PDG type> refers to a PDG identifier;
  • <key> to one of the data members of a data structure derived from JAANET::JEvtCategory;
  • <value> and to the corresponding value. Multiple event categories can be specified, separated by the '&' character.

Definition at line 43 of file JEvtCategoryToolkit.hh.

Constructor & Destructor Documentation

◆ JEvtCategorySet()

JAANET::JEvtCategorySet::JEvtCategorySet ( )
inline

Default constructor.

Definition at line 49 of file JEvtCategoryToolkit.hh.

50 {}

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JEvtCategorySet & categories )
friend

Stream input.

Parameters
ininput stream
categoriesset of event categories
Returns
input stream

Definition at line 60 of file JEvtCategoryToolkit.hh.

61 {
62 using namespace std;
63 using namespace JPP;
64
65 for (JToken<'&'> token; in >> token; ) {
66
67 JEvtCategoryHelper category;
68
69 istringstream iss(token);
70 iss >> category;
71
72 if (!fail(iss)) { categories.insert(category); }
73 }
74
75 return in;
76 }
Wrapper class around string.
Definition JToken.hh:26
bool fail(std::istream &in)
Check for stream state.
Definition JParser.hh:98
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Helper class for event categories.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JEvtCategorySet & categories )
friend

Stream output.

Parameters
outoutput stream
categoriesset of event categories
Returns
output stream

Definition at line 86 of file JEvtCategoryToolkit.hh.

87 {
88 using namespace std;
89 using namespace JPP;
90
91 if (categories.size() > 0) {
92 out << *categories.cbegin();
93 }
94
95 for (iterator i = next(categories.cbegin()); i != categories.cend(); ++i) {
96 out << " & " << *i;
97 }
98
99 return out;
100 }

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