Jpp  debug
the software that should make you happy
Public Member Functions | List of all members
JROOT::JROOTClassSelector Struct Reference

Auxiliary class to select ROOT class based on class name. More...

#include <JROOTClassSelector.hh>

Inheritance diagram for JROOT::JROOTClassSelector:
JLANG::JEquals< JFirst_t, JSecond_t >

Public Member Functions

 JROOTClassSelector ()
 Default contructor. More...
 
 JROOTClassSelector (const char *const type_name)
 Contructor. More...
 
 JROOTClassSelector (const std::string &type_name)
 Contructor. More...
 
template<class T >
 JROOTClassSelector (const JType< T > &type, const bool option)
 Contructor. More...
 
bool equals (const JROOTClassSelector &selector) const
 Equals method. More...
 
bool equals (const char *const selector) const
 Equals method. More...
 
template<class T >
bool operator() (const JType< T > &type) const
 Get status of given data type. More...
 

Detailed Description

Auxiliary class to select ROOT class based on class name.

Definition at line 35 of file JROOTClassSelector.hh.

Constructor & Destructor Documentation

◆ JROOTClassSelector() [1/4]

JROOT::JROOTClassSelector::JROOTClassSelector ( )
inline

Default contructor.

Definition at line 42 of file JROOTClassSelector.hh.

42  :
43  std::string()
44  {}

◆ JROOTClassSelector() [2/4]

JROOT::JROOTClassSelector::JROOTClassSelector ( const char *const  type_name)
inline

Contructor.

Parameters
type_nametype_name

Definition at line 52 of file JROOTClassSelector.hh.

52  :
53  std::string(type_name)
54  {}

◆ JROOTClassSelector() [3/4]

JROOT::JROOTClassSelector::JROOTClassSelector ( const std::string &  type_name)
inline

Contructor.

Parameters
type_nametype_name

Definition at line 62 of file JROOTClassSelector.hh.

62  :
63  std::string(type_name)
64  {}

◆ JROOTClassSelector() [4/4]

template<class T >
JROOT::JROOTClassSelector::JROOTClassSelector ( const JType< T > &  type,
const bool  option 
)
inline

Contructor.

Parameters
typedata type
optioninclude namespace

Definition at line 74 of file JROOTClassSelector.hh.

74  :
75  std::string(option ? getName(type) : getClassname(getName(type)))
76  {}
std::string getClassname(const std::string &type_name)
Get type name, i.e. part after JEEP::TYPENAME_SEPARATOR.
Definition: JeepToolkit.hh:289
const char * getName()
Get ROOT name of given data type.
Definition: JRootToolkit.hh:62

Member Function Documentation

◆ equals() [1/2]

bool JROOT::JROOTClassSelector::equals ( const JROOTClassSelector selector) const
inline

Equals method.

Note that if one of the selectors has an empty name space, the equality is evaluated by class name only else by class name and name space.

Parameters
selectorselector
Returns
true if this selector equals given selector; else false

Definition at line 88 of file JROOTClassSelector.hh.

89  {
90  if (getNamespace(*this) == "" || getNamespace(selector) == "")
91  return (getClassname(*this) == getClassname(selector));
92  else
93  return (getNamespace(*this) == getNamespace(selector) &&
94  getClassname(*this) == getClassname(selector));
95  }
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
Definition: JeepToolkit.hh:270

◆ equals() [2/2]

bool JROOT::JROOTClassSelector::equals ( const char *const  selector) const
inline

Equals method.

Parameters
selectorselector
Returns
true if this selector equals given selector; else false

Definition at line 104 of file JROOTClassSelector.hh.

105  {
106  return equals(JROOTClassSelector(selector));
107  }
JROOTClassSelector()
Default contructor.
bool equals(const JROOTClassSelector &selector) const
Equals method.

◆ operator()()

template<class T >
bool JROOT::JROOTClassSelector::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 117 of file JROOTClassSelector.hh.

118  {
119  return equals(JROOTClassSelector(type, true));
120  }

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