Main Page   Class Hierarchy   Compound List   File List   Compound Members  

method.h

00001 #ifndef __METHOD_H__
00002 #define __METHOD_H__
00003 
00007 enum RTTIMethodFlags { 
00008     RTTI_MTH_INSTANCE  = RTTI_FLD_INSTANCE, 
00009     RTTI_MTH_STATIC    = RTTI_FLD_STATIC, 
00010     RTTI_MTH_CONST     = RTTI_FLD_CONST, 
00011     RTTI_MTH_PUBLIC    = RTTI_FLD_PUBLIC, 
00012     RTTI_MTH_PROTECTED = RTTI_FLD_PROTECTED, 
00013     RTTI_MTH_PRIVATE   = RTTI_FLD_PRIVATE, 
00014     RTTI_MTH_VIRTUAL   = RTTI_FLD_VIRTUAL, 
00015     RTTI_MTH_ABSTRACT  = 0x0200 
00016 }; 
00017 
00018 
00022 class RTTIMethodDescriptor { 
00023   public:
00027     char const* getName() { 
00028         return name;
00029     }
00030     
00035     RTTIMethodType* getType() { 
00036         return type;
00037     }
00038     
00043     int getFlags() { 
00044         return flags;
00045     }
00046 
00047 
00055     void getMethodDeclaration(char* buf) { 
00056         type->getMethodDeclaration(buf, name);
00057     }
00058 
00065     void invoke(void* result, void* obj, void* parameters[]) { 
00066         type->invoke(result, obj, parameters);
00067     }
00068 
00073     RTTIClassDescriptor* getDeclaringClass() { 
00074         return type->getClass();
00075     }
00076 
00083     RTTIMethodDescriptor(char const* name, int flags, RTTIMethodType* type) { 
00084         this->name = name;
00085         this->flags = flags;
00086         this->type = type;
00087         type->isStatic = (flags & RTTI_MTH_STATIC) != 0; 
00088         next = NULL; 
00089         chain = &next;
00090     }
00091 
00098     RTTIMethodDescriptor& operator, (RTTIMethodDescriptor& method) {
00099         *chain = &method;
00100         chain = &method.next;
00101         return *this;
00102     }
00103     
00107     ~RTTIMethodDescriptor() { 
00108         type->destroy();
00109     }
00110 
00115     int getIndex() { 
00116         return index;
00117     }
00118 
00119   protected:
00120     friend class RTTIType;
00121     friend class RTTIClassDescriptor;
00122     friend class RTTIBfdRepository;
00123         
00124 
00125     int             flags;
00126     int             index;
00127     RTTIMethodType* type;
00128     char const*     name;
00129 
00130     RTTIMethodDescriptor*  next;
00131     RTTIMethodDescriptor** chain;
00132 };
00133 
00134 #endif

Generated on Fri Apr 26 17:39:24 2002 for CppReflection by doxygen1.2.15