CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/FWCore/Utilities/interface/FunctionWithDict.h

Go to the documentation of this file.
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) : function_(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     size_t functionParameterSize(bool required = false) const;
00048 
00049     void invoke(ObjectWithDict const& obj, ObjectWithDict* ret, std::vector<void*> const& values = std::vector<void*>()) const;
00050 
00051     Reflex::Type_Iterator begin() const;
00052     Reflex::Type_Iterator end() const;
00053     size_t size() const {
00054       return functionParameterSize();
00055     }
00056 
00057 #ifndef __GCCXML__
00058     explicit operator bool() const;
00059 #endif
00060 
00061   private:
00062 
00063     Reflex::Member function_;
00064   };
00065 
00066 }
00067 #endif