00001 #ifndef FWCore_Utilities_FunctionWithDict_h 00002 #define FWCore_Utilities_FunctionWithDict_h 00003 00004 /*---------------------------------------------------------------------- 00005 00006 FunctionWithDict: A holder for a class member function 00007 00008 ----------------------------------------------------------------------*/ 00009 00010 #include <string> 00011 00012 #include "Reflex/Member.h" 00013 00014 namespace edm { 00015 00016 class ObjectWithDict; 00017 class TypeWithDict; 00018 00019 class FunctionWithDict { 00020 public: 00021 FunctionWithDict() : function_() {} 00022 00023 explicit FunctionWithDict(Reflex::Member const& function); 00024 00025 std::string name() const; 00026 00027 std::string typeName() const; 00028 00029 TypeWithDict declaringType() const; 00030 00031 TypeWithDict typeOf() const; 00032 00033 bool isConst() const; 00034 00035 bool isConstructor() const; 00036 00037 bool isDestructor() const; 00038 00039 bool isOperator() const; 00040 00041 bool isPublic() const; 00042 00043 bool isStatic() const; 00044 00045 TypeWithDict returnType() const; 00046 00047 TypeWithDict finalReturnType() const; 00048 00049 size_t functionParameterSize(bool required = false) const; 00050 00051 void invoke(ObjectWithDict const& obj, ObjectWithDict* ret, std::vector<void*> const& values = std::vector<void*>()) const; 00052 00053 Reflex::Type_Iterator begin() const; 00054 Reflex::Type_Iterator end() const; 00055 size_t size() const { 00056 return functionParameterSize(); 00057 } 00058 00059 #ifndef __GCCXML__ 00060 explicit operator bool() const; 00061 #endif 00062 00063 private: 00064 00065 Reflex::Member function_; 00066 }; 00067 00068 } 00069 #endif