optimization and fixes

This commit is contained in:
2020-06-09 17:52:17 +03:00
parent d5cef947ee
commit 4ec87e0e2a
4 changed files with 18 additions and 11 deletions

View File

@@ -195,12 +195,16 @@
#endif
#define __VVALUE(t, v) v.value< __PTYPE(t) >()
//printf("base_init %s id=%d (%d) pid=%d (%d) ...\n", #name, id, eh.eh_func.size(), pid, ehp.eh_func.size());
//printf("base_init %s id=%d (%d) pid=%d (%d) ok\n", #name, id, eh.eh_func.size(), pid, ehp.eh_func.size());
//printf("parent_init %s::%s id=%d (%d) pid=%d (%d) ...\n", __classNameS().dataAscii(), #name, id, eh.eh_func.size(), pid, ehp.eh_func.size());
//printf("parent_init %s::%s id=%d (%d) pid=%d (%d) ok\n", __classNameS().dataAscii(), #name, id, eh.eh_func.size(), pid, ehp.eh_func.size());
#define PIOBJECT(name) \
protected: \
typedef name __PIObject__; \
public: \
static const PIString __classNameS() {return PIStringAscii(#name);} \
static const PIString __classNameS() {static PIString ret = PIStringAscii(#name); return ret;} \
static uint __classNameIDS() {static uint ret = PIStringAscii(#name).hash(); return ret;} \
virtual const char * className() const {return #name;} \
virtual uint classNameID() const {static uint ret = PIStringAscii(#name).hash(); return ret;} \
@@ -220,7 +224,7 @@
__MetaData & eh(__meta_data()[id]); \
eh.eh_set << ehp.eh_set; \
eh.eh_func << ehp.eh_func; \
eh.addScope(__classNameS()); \
eh.addScope(__classNameS(), id); \
} \
}; \
__BaseInitializer__ __base_init__;
@@ -239,8 +243,9 @@
__MetaData & ehp(__meta_data()[pid]); \
eh.eh_set << ehp.eh_set; \
eh.eh_func << ehp.eh_func; \
eh.scope_id = ehp.scope_id; \
eh.scope_list = ehp.scope_list; \
eh.addScope(__classNameS()); \
eh.addScope(PIStringAscii(#name), pid); \
} \
}; \
__ParentInitializer__ __parent_init__; \
@@ -836,8 +841,8 @@ public:
PIStringList names;
};
struct __MetaData {
__MetaData() {scope_list << PIStringAscii("PIObject");}
void addScope(const PIString & s);
__MetaData() {scope_list << PIStringAscii("PIObject"); scope_id << PIStringAscii("PIObject").hash();}
void addScope(const PIString & s, uint shash);
PIStringList scope_list;
PISet<uint> scope_id;
PISet<const void * > eh_set;