Compare commits

2 Commits

Author SHA1 Message Date
f579718e0b version 1.19.0_alpha
general bug fixes and optimization
Merge branch 'master' of https://git.shs.tools/SHS/pip
2020-06-09 18:04:33 +03:00
4ec87e0e2a optimization and fixes 2020-06-09 17:52:17 +03:00
4 changed files with 15 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0017 NEW) # need include() with .cmake cmake_policy(SET CMP0017 NEW) # need include() with .cmake
project(pip) project(pip)
set(_PIP_MAJOR 1) set(_PIP_MAJOR 1)
set(_PIP_MINOR 18) set(_PIP_MINOR 19)
set(_PIP_REVISION 0) set(_PIP_REVISION 0)
set(_PIP_SUFFIX alpha) set(_PIP_SUFFIX alpha)
set(_PIP_COMPANY SHS) set(_PIP_COMPANY SHS)

View File

@@ -197,6 +197,7 @@ public:
const T at(const Key & key) const {return (*this)[key];} const T at(const Key & key) const {return (*this)[key];}
PIMap<Key, T> & operator <<(const PIMap<Key, T> & other) { PIMap<Key, T> & operator <<(const PIMap<Key, T> & other) {
assert(&other != this);
if (other.isEmpty()) return *this; if (other.isEmpty()) return *this;
if (other.size() == 1) {insert(other.pim_index[0].key, other.pim_content[0]); return *this;} if (other.size() == 1) {insert(other.pim_index[0].key, other.pim_content[0]); return *this;}
if (other.size() == 2) {insert(other.pim_index[0].key, other.pim_content[0]); insert(other.pim_index[1].key, other.pim_content[1]); return *this;} if (other.size() == 2) {insert(other.pim_index[0].key, other.pim_content[0]); insert(other.pim_index[1].key, other.pim_content[1]); return *this;}

View File

@@ -674,10 +674,10 @@ bool dumpApplicationToFile(const PIString & path) {
void PIObject::__MetaData::addScope(const PIString & s) { void PIObject::__MetaData::addScope(const PIString & s, uint shash) {
if (!scope_list.contains(s)) { if (!scope_id.contains(shash)) {
scope_list << s; scope_list << s;
scope_id << s.hash(); scope_id << shash;
} }
} }

View File

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