Auxiliary class for ROOT class selection.  
 More...
#include <JROOTClassSelector.hh>
Auxiliary class for ROOT class selection. 
Definition at line 127 of file JROOTClassSelector.hh.
 
◆ JROOTClassSelection() [1/3]
  
  
      
        
          | JROOT::JROOTClassSelection::JROOTClassSelection  | 
          ( | 
          const bool |           option = false | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ JROOTClassSelection() [2/3]
◆ JROOTClassSelection() [3/3]
template<class T > 
  
  
      
        
          | JROOT::JROOTClassSelection::JROOTClassSelection  | 
          ( | 
          const JType< T > & |           typelist,  | 
         
        
           | 
           | 
          const bool |           option = false ) | 
         
       
   | 
  
inline   | 
  
 
Contructor. 
- Parameters
 - 
  
    | typelist | type list  | 
    | option | include namespace  | 
  
   
Definition at line 159 of file JROOTClassSelector.hh.
  159                                                                             :
  161    {
  163    }
void for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
 
 
 
 
◆ getOption()
  
  
      
        
          | bool JROOT::JROOTClassSelection::getOption  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ add()
template<class T > 
  
  
      
        
          | void JROOT::JROOTClassSelection::add  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ remove()
template<class T > 
  
  
      
        
          | void JROOT::JROOTClassSelection::remove  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ operator()() [1/2]
template<class T > 
  
  
      
        
          | void JROOT::JROOTClassSelection::operator()  | 
          ( | 
          const JType< T > & |           type | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Add data type. 
- Parameters
 - 
  
  
 
Definition at line 203 of file JROOTClassSelector.hh.
  204    {
  206    }
void add()
Add given data type.
 
 
 
 
◆ operator()() [2/2]
template<class T > 
  
  
      
        
          | bool JROOT::JROOTClassSelection::operator()  | 
          ( | 
          const JType< T > & |           type | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get status of given data type. 
- Parameters
 - 
  
  
 
- Returns
 - true if valid class name; else false 
 
Definition at line 216 of file JROOTClassSelector.hh.
  217    {
  218      const JROOTClassSelector selector(type, 
option);
 
  219      
  220      for (const_iterator i = this->begin(); i != this->end(); ++i) {
  221        if (*i == selector) {
  222          return true;
  223        }
  224      }
  225 
  226      return false;
  227    }
 
 
 
◆ is_valid()
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 236 of file JROOTClassSelector.hh.
  237    {
  238      return (*this)(JType<T>());
  239    }
 
 
 
◆ operator>>
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
 - 
  
    | in | input stream  | 
    | object | ROOT class selection  | 
  
   
- Returns
 - input stream 
 
Definition at line 254 of file JROOTClassSelector.hh.
  255    {
  256      for (std::string buffer; in >> buffer; ) {
  257 
  258        const TRegexp regexp(buffer.substr(1).c_str());
  259 
  260        switch (buffer[0]) {
  261 
  262        case '-':
  263 
  264          for (JROOTClassSelection::iterator i = object.begin(); i != object.end(); ) {
  265 
  266            if (TString(i->c_str()).Contains(regexp))
  267              object.erase(i++);
  268            else
  269              ++i;
  270          }
  271 
  272          break;
  273 
  274        case '+':
  275 
  276          object.insert(buffer.substr(1));
  277          break;
  278 
  279        default:
  280 
  281          object.insert(buffer);
  282          break;
  283        }
  284      }
  285 
  286      return in;
  287    }
 
 
 
◆ operator<<
Write ROOT class selection to output. 
- Parameters
 - 
  
    | out | output stream  | 
    | object | ROOT class selection  | 
  
   
- Returns
 - output stream 
 
Definition at line 297 of file JROOTClassSelector.hh.
  298    {
  299      for (const_iterator i = object.begin(); i != object.end(); ++i) {
  300        out << *i << std::endl;
  301      }
  302 
  303      return out;
  304    }
 
 
 
◆ option
  
  
      
        
          | bool JROOT::JROOTClassSelection::option | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this struct was generated from the following file: