16 #ifndef __OMNETPP_CCLASSDESCRIPTOR_H 17 #define __OMNETPP_CCLASSDESCRIPTOR_H 20 #include "cownedobject.h" 22 #include "opp_string.h" 53 FD_ISCOWNEDOBJECT = 0x10,
59 std::string baseClassName;
61 int inheritanceChainLength;
66 static std::string long2string(
long l);
67 static long string2long(
const char *s);
68 static std::string ulong2string(
unsigned long l);
69 static unsigned long string2ulong(
const char *s);
70 static std::string int642string(int64_t l);
71 static int64_t string2int64(
const char *s);
72 static std::string uint642string(uint64_t l);
73 static uint64_t string2uint64(
const char *s);
74 static std::string bool2string(
bool b);
75 static bool string2bool(
const char *s);
76 static std::string double2string(
double d);
77 static double string2double(
const char *s);
78 static std::string simtime2string(
SimTime t) {
return t.
ustr();}
80 std::string enum2string(
int e,
const char *enumName)
const;
81 int string2enum(
const char *s,
const char *enumName)
const;
82 static std::string oppstring2string(
const char *s) {
return s?s:
"";}
83 static std::string oppstring2string(
const opp_string& s) {
return s.
c_str();}
84 static std::string oppstring2string(
const std::string& s) {
return s;}
85 static void string2oppstring(
const char *s,
opp_string& str) {str = s?s:
"";}
86 static void string2oppstring(
const char *s, std::string& str) {str = s?s:
"";}
87 static const char **mergeLists(
const char **list1,
const char **list2);
139 bool extendsCObject()
const;
144 std::string getNamespace()
const;
150 int getInheritanceChainLength()
const;
156 virtual const char **getPropertyNames()
const = 0;
165 virtual const char *getProperty(
const char *propertyname)
const = 0;
170 virtual int getFieldCount()
const = 0;
176 virtual const char *getFieldName(
int field)
const = 0;
183 virtual int findField(
const char *fieldName)
const;
191 virtual unsigned int getFieldTypeFlags(
int field)
const = 0;
195 bool getFieldIsArray(
int field)
const {
return getFieldTypeFlags(field) & FD_ISARRAY;}
196 bool getFieldIsCompound(
int field)
const {
return getFieldTypeFlags(field) & FD_ISCOMPOUND;}
197 bool getFieldIsPointer(
int field)
const {
return getFieldTypeFlags(field) & FD_ISPOINTER;}
198 bool getFieldIsCObject(
int field)
const {
return getFieldTypeFlags(field) & (FD_ISCOBJECT|FD_ISCOWNEDOBJECT);}
199 bool getFieldIsCOwnedObject(
int field)
const {
return getFieldTypeFlags(field) & FD_ISCOWNEDOBJECT;}
200 bool getFieldIsEditable(
int field)
const {
return getFieldTypeFlags(field) & FD_ISEDITABLE;}
206 virtual const char *getFieldDeclaredOn(
int field)
const;
214 virtual const char *getFieldTypeString(
int field)
const = 0;
220 virtual const char **getFieldPropertyNames(
int field)
const = 0;
228 virtual const char *getFieldProperty(
int field,
const char *propertyname)
const = 0;
234 virtual int getFieldArraySize(
void *
object,
int field)
const = 0;
257 virtual std::string getFieldValueAsString(
void *
object,
int field,
int i)
const = 0;
268 virtual bool setFieldValueAsString(
void *
object,
int field,
int i,
const char *value)
const = 0;
275 virtual const char *getFieldStructName(
int field)
const = 0;
280 virtual void *getFieldStructValuePointer(
void *
object,
int field,
int i)
const = 0;
Lightweight string class, used internally in some parts of OMNeT++.
Definition: opp_string.h:39
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
static const SimTime parse(const char *s)
virtual const char * getFieldDynamicTypeString(void *object, int field, int i) const
Definition: cclassdescriptor.h:247
virtual bool doesSupport(cObject *obj) const
Definition: cclassdescriptor.h:129
const char * c_str() const
Definition: opp_string.h:78
Definition: cabstracthistogram.h:21
Abstract base class for structure description classes, used mainly with message subclassing.
Definition: cclassdescriptor.h:44
Base class for cOwnedObject-based classes that do not wish to support assignment and duplication...
Definition: cownedobject.h:248