Jpp  18.0.0-rc.4
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
JROOT::JROOTClassSelection Struct Reference

Auxiliary class for ROOT class selection. More...

#include <JROOTClassSelector.hh>

Inheritance diagram for JROOT::JROOTClassSelection:
std::set< JROOTClassSelector >

Public Member Functions

 JROOTClassSelection ()
 Default contructor. More...
 
 JROOTClassSelection (const std::set< JROOTClassSelector > &selection)
 Copy contructor. More...
 
template<class T >
 JROOTClassSelection (const JType< T > &typelist)
 Contructor. More...
 
template<class T >
void add ()
 Add given data type. More...
 
template<class T >
void remove ()
 Remove data type. More...
 
template<class T >
void operator() (const JType< T > &type)
 Add data type. More...
 
template<class T >
bool operator() (const JType< T > &type) const
 Get status of given data type. More...
 
template<class T >
bool is_valid () const
 Get status of given data type. More...
 

Friends

std::istream & operator>> (std::istream &in, JROOTClassSelection &object)
 Read ROOT class selection from input. More...
 
std::ostream & operator<< (std::ostream &out, const JROOTClassSelection &object)
 Write ROOT class selection to output. More...
 

Detailed Description

Auxiliary class for ROOT class selection.

Definition at line 91 of file JROOTClassSelector.hh.

Constructor & Destructor Documentation

JROOT::JROOTClassSelection::JROOTClassSelection ( )
inline

Default contructor.

Definition at line 97 of file JROOTClassSelector.hh.

98  {}
JROOT::JROOTClassSelection::JROOTClassSelection ( const std::set< JROOTClassSelector > &  selection)
inline

Copy contructor.

Parameters
selectionselection

Definition at line 106 of file JROOTClassSelector.hh.

template<class T >
JROOT::JROOTClassSelection::JROOTClassSelection ( const JType< T > &  typelist)
inline

Contructor.

Parameters
typelisttype list

Definition at line 117 of file JROOTClassSelector.hh.

118  {
119  JLANG::for_each(*this, typelist);
120  }
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition: JTypeList.hh:415

Member Function Documentation

template<class T >
void JROOT::JROOTClassSelection::add ( )
inline

Add given data type.

Definition at line 127 of file JROOTClassSelector.hh.

128  {
129  this->insert(JROOTClassSelector(JType<T>()));
130  }
Auxiliary class to select ROOT class based on class name.
template<class T >
void JROOT::JROOTClassSelection::remove ( )
inline

Remove data type.

Definition at line 137 of file JROOTClassSelector.hh.

138  {
139  this->erase(JROOTClassSelector(JType<T>()));
140  }
Auxiliary class to select ROOT class based on class name.
template<class T >
void JROOT::JROOTClassSelection::operator() ( const JType< T > &  type)
inline

Add data type.

Parameters
typedata type

Definition at line 149 of file JROOTClassSelector.hh.

150  {
151  add<T>();
152  }
template<class T >
bool JROOT::JROOTClassSelection::operator() ( const JType< T > &  type) const
inline

Get status of given data type.

Parameters
typedata type
Returns
true if valid class name; else false

Definition at line 162 of file JROOTClassSelector.hh.

163  {
164  return this->find(JROOTClassSelector(JType<T>())) != this->end();
165  }
Auxiliary class to select ROOT class based on class name.
template<class T >
bool JROOT::JROOTClassSelection::is_valid ( ) const
inline

Get status of given data type.

Returns
true if valid class name; else false

Definition at line 174 of file JROOTClassSelector.hh.

175  {
176  return (*this)(JType<T>());
177  }

Friends And Related Function Documentation

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

Read ROOT class selection from input.

Note that if the first character of the read class name is:

  • a '+', the remainder of the class name is added; or
  • a '-', the remainder of the class name is removed; otherwise
  • the complete class name is added.
Parameters
ininput stream
objectROOT class selection
Returns
input stream

Definition at line 192 of file JROOTClassSelector.hh.

193  {
194  for (std::string buffer; in >> buffer; ) {
195 
196  const TRegexp regexp(buffer.substr(1).c_str());
197 
198  switch (buffer[0]) {
199 
200  case '-':
201 
202  for (JROOTClassSelection::iterator i = object.begin(); i != object.end(); ) {
203 
204  if (TString(i->c_str()).Index(regexp) != -1)
205  object.erase(i++);
206  else
207  ++i;
208  }
209 
210  break;
211 
212  case '+':
213 
214  object.insert(buffer.substr(1));
215  break;
216 
217  default:
218 
219  object.insert(buffer);
220  break;
221  }
222  }
223 
224  return in;
225  }
then awk string
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 JROOTClassSelection object 
)
friend

Write ROOT class selection to output.

Parameters
outoutput stream
objectROOT class selection
Returns
output stream

Definition at line 235 of file JROOTClassSelector.hh.

236  {
237  for (const_iterator i = object.begin(); i != object.end(); ++i) {
238  out << *i << std::endl;
239  }
240 
241  return out;
242  }

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