CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
edm::FunctionWithDict Class Reference

#include <FunctionWithDict.h>

Public Member Functions

IterWithDict< TMethodArg > begin () const
 
TypeWithDict declaringType () const
 
IterWithDict< TMethodArg > end () const
 
TypeWithDict finalReturnType () const
 
size_t functionParameterSize (bool required=false) const
 
 FunctionWithDict ()
 
 FunctionWithDict (TMethod *)
 
void invoke (ObjectWithDict const &obj, ObjectWithDict *ret=nullptr, std::vector< void * > const &values=std::vector< void * >()) const
 Call a member function. More...
 
void invoke (ObjectWithDict *ret=nullptr, std::vector< void * > const &values=std::vector< void * >()) const
 Call a static function. More...
 
bool isConst () const
 
bool isConstructor () const
 
bool isDestructor () const
 
bool isOperator () const
 
bool isPublic () const
 
bool isStatic () const
 
std::string name () const
 
 operator bool () const
 
size_t size () const
 
std::string typeName () const
 

Private Attributes

TMethod * function_
 

Detailed Description

Definition at line 26 of file FunctionWithDict.h.

Constructor & Destructor Documentation

edm::FunctionWithDict::FunctionWithDict ( )

Definition at line 20 of file FunctionWithDict.cc.

20  : function_(nullptr) {
21  }
edm::FunctionWithDict::FunctionWithDict ( TMethod *  meth)
explicit

Definition at line 23 of file FunctionWithDict.cc.

23  : function_(meth) {
24  }

Member Function Documentation

IterWithDict< TMethodArg > edm::FunctionWithDict::begin ( void  ) const

Definition at line 125 of file FunctionWithDict.cc.

References function_.

125  {
126  if (function_ == nullptr) {
127  return IterWithDict<TMethodArg>();
128  }
129  return IterWithDict<TMethodArg>(function_->GetListOfMethodArgs());
130  }
TypeWithDict edm::FunctionWithDict::declaringType ( ) const

Definition at line 54 of file FunctionWithDict.cc.

References function_.

54  {
55  return TypeWithDict(function_->GetClass());
56  }
IterWithDict< TMethodArg > edm::FunctionWithDict::end ( void  ) const

Definition at line 133 of file FunctionWithDict.cc.

133  {
134  return IterWithDict<TMethodArg>();
135  }
TypeWithDict edm::FunctionWithDict::finalReturnType ( ) const

Definition at line 43 of file FunctionWithDict.cc.

References edm::TypeWithDict::byName(), and function_.

Referenced by reco::parser::MethodInvoker::MethodInvoker(), reco::returnType(), and FWTableViewManager::tableFormats().

43  {
44  auto const& item = returnTypeMap.find(function_);
45  if(item != returnTypeMap.end()) {
46  return item->second;
47  }
48  TypeWithDict theType = TypeWithDict::byName(function_->GetReturnTypeNormalizedName());
49  returnTypeMap.insert(std::make_pair(function_, theType));
50  return theType;
51  }
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
size_t edm::FunctionWithDict::functionParameterSize ( bool  required = false) const

Definition at line 88 of file FunctionWithDict.cc.

References function_.

Referenced by reco::checkMethod(), and FWTableViewManager::tableFormats().

88  {
89  if (required) {
90  return function_->GetNargs() - function_->GetNargsOpt();
91  }
92  return function_->GetNargs();
93  }
void edm::FunctionWithDict::invoke ( ObjectWithDict const &  obj,
ObjectWithDict ret = nullptr,
std::vector< void * > const &  values = std::vector<void*>() 
) const

Call a member function.

Definition at line 102 of file FunctionWithDict.cc.

References edm::ObjectWithDict::address(), compareJSON::const, AlCaHLTBitMon_QueryRunRegistry::data, and function_.

Referenced by reco::parser::MethodInvoker::invoke(), and ora::UniqueRefWriter::write().

103  {
104  void const** data = const_cast<void const**>(values.data());
105  if (ret == nullptr) {
106  gInterpreter->ExecuteWithArgsAndReturn(function_, obj.address(), data, values.size(), nullptr);
107  return;
108  }
109  gInterpreter->ExecuteWithArgsAndReturn(function_, obj.address(), data, values.size(), ret->address());
110  }
string const
Definition: compareJSON.py:14
void edm::FunctionWithDict::invoke ( ObjectWithDict ret = nullptr,
std::vector< void * > const &  values = std::vector<void*>() 
) const

Call a static function.

Definition at line 114 of file FunctionWithDict.cc.

References edm::ObjectWithDict::address(), compareJSON::const, AlCaHLTBitMon_QueryRunRegistry::data, and function_.

115  {
116  void const** data = const_cast<void const**>(values.data());
117  if (ret == nullptr) {
118  gInterpreter->ExecuteWithArgsAndReturn(function_, nullptr, data, values.size(), nullptr);
119  return;
120  }
121  gInterpreter->ExecuteWithArgsAndReturn(function_, nullptr, data, values.size(), ret->address());
122  }
string const
Definition: compareJSON.py:14
bool edm::FunctionWithDict::isConst ( ) const

Definition at line 59 of file FunctionWithDict.cc.

References function_.

Referenced by reco::checkMethod(), fireworks::OptionNode::fillOptionForType(), and FWTableViewManager::tableFormats().

59  {
60  return function_->Property() & kIsConstMethod;
61  }
bool edm::FunctionWithDict::isConstructor ( ) const

Definition at line 64 of file FunctionWithDict.cc.

References function_, and reco::parser::kIsConstructor.

Referenced by reco::checkMethod(), and fireworks::OptionNode::fillOptionForType().

64  {
65  return function_->ExtraProperty() & kIsConstructor;
66  }
bool edm::FunctionWithDict::isDestructor ( ) const

Definition at line 69 of file FunctionWithDict.cc.

References function_, and reco::parser::kIsDestructor.

Referenced by reco::checkMethod(), and fireworks::OptionNode::fillOptionForType().

69  {
70  return function_->ExtraProperty() & kIsDestructor;
71  }
bool edm::FunctionWithDict::isOperator ( ) const

Definition at line 74 of file FunctionWithDict.cc.

References function_, and reco::parser::kIsOperator.

Referenced by fireworks::OptionNode::fillOptionForType().

74  {
75  return function_->ExtraProperty() & kIsOperator;
76  }
bool edm::FunctionWithDict::isPublic ( ) const

Definition at line 79 of file FunctionWithDict.cc.

References function_.

Referenced by reco::checkMethod(), fireworks::OptionNode::fillOptionForType(), and FWTableViewManager::tableFormats().

79  {
80  return function_->Property() & kIsPublic;
81  }
bool edm::FunctionWithDict::isStatic ( ) const

Definition at line 83 of file FunctionWithDict.cc.

References function_, and reco::parser::kIsStatic.

Referenced by reco::checkMethod().

83  {
84  return function_->Property() & kIsStatic;
85  }
std::string edm::FunctionWithDict::name ( void  ) const
edm::FunctionWithDict::operator bool ( ) const
explicit

Definition at line 26 of file FunctionWithDict.cc.

26  {
27  if (function_ == nullptr) {
28  return false;
29  }
30  return function_->IsValid();
31  }
size_t edm::FunctionWithDict::size ( void  ) const

Definition at line 96 of file FunctionWithDict.cc.

References function_.

96  {
97  return function_->GetNargs();
98  }
std::string edm::FunctionWithDict::typeName ( ) const

Definition at line 38 of file FunctionWithDict.cc.

References function_.

Referenced by reco::parser::MethodInvoker::returnTypeName().

38  {
39  return function_->GetReturnTypeNormalizedName();
40  }

Member Data Documentation

TMethod* edm::FunctionWithDict::function_
private