git-svn-id: svn://db.shs.com.ru/pip@602 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -41,6 +41,7 @@ enum PIP_EXPORT TypeFlag {
|
||||
|
||||
typedef PIFlags<PICodeInfo::TypeFlag> TypeFlags;
|
||||
typedef PIMap<PIString, PIString> MetaMap;
|
||||
typedef PIByteArray(*AccessFunction)(const void *, const char *);
|
||||
|
||||
struct PIP_EXPORT TypeInfo {
|
||||
TypeInfo(const PIString & n = PIString(), const PIString & t = PIString(), PICodeInfo::TypeFlags f = 0, int b = -1) {name = n; type = t; flags = f; bits = b;}
|
||||
@@ -151,6 +152,14 @@ inline PICout operator <<(PICout s, const PICodeInfo::EnumInfo & v) {
|
||||
|
||||
extern PIMap<PIString, PICodeInfo::ClassInfo * > * classesInfo;
|
||||
extern PIMap<PIString, PICodeInfo::EnumInfo * > * enumsInfo;
|
||||
extern PIMap<PIString, PICodeInfo::AccessFunction> * accessFunctions;
|
||||
|
||||
inline PIByteArray getMember(const void * p, const char * class_name, const char * member_name) {
|
||||
if (!p || !class_name || !member_name || !accessFunctions) return PIByteArray();
|
||||
AccessFunction af = accessFunctions->value(PIStringAscii(class_name), (AccessFunction)0);
|
||||
if (!af) return PIByteArray();
|
||||
return af(p, member_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -161,6 +170,7 @@ public:
|
||||
_inited_ = true;
|
||||
PICodeInfo::classesInfo = new PIMap<PIString, PICodeInfo::ClassInfo * >;
|
||||
PICodeInfo::enumsInfo = new PIMap<PIString, PICodeInfo::EnumInfo * >;
|
||||
PICodeInfo::accessFunctions = new PIMap<PIString, PICodeInfo::AccessFunction>;
|
||||
}
|
||||
static bool _inited_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user