git-svn-id: svn://db.shs.com.ru/pip@501 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -120,7 +120,7 @@ bool PIObject::executeQueued(PIObject * performer, const PIString & method, cons
|
||||
bool ok = findSuitableMethodV(method, vl.size_s(), ac, func);
|
||||
if (!ok)
|
||||
return false;
|
||||
performer->postQueuedEvent(QueuedEvent(func.addrV, toThis(), this, performer, vl));
|
||||
performer->postQueuedEvent(__QueuedEvent(func.addrV, toThis(), this, performer, vl));
|
||||
performer->proc_event_queue = true;
|
||||
return true;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ void PIObject::piConnect(const PIString & src, const PIString & sig, void * dest
|
||||
}
|
||||
PIMutexLocker _ml(o->mutex_connect);
|
||||
PIMutexLocker _mld(((PIObject*)dest)->mutex_connect, ((PIObject*)dest) != o);
|
||||
o->connections << Connection(ev_h, 0, sig, (PIObject*)dest, dest);
|
||||
o->connections << __Connection(ev_h, 0, sig, (PIObject*)dest, dest);
|
||||
((PIObject*)dest)->connectors << o;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ void PIObject::piConnect(PIObject * src, const PIString & sig, const PIString &
|
||||
}
|
||||
PIMutexLocker _ml(src->mutex_connect);
|
||||
PIMutexLocker _mld(o->mutex_connect, src != o);
|
||||
src->connections << Connection(ev_h, 0, sig, o, o);
|
||||
src->connections << __Connection(ev_h, 0, sig, o, o);
|
||||
((PIObject*)o)->connectors << src;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ void PIObject::piConnect(const PIString & src, const PIString & sig, const PIStr
|
||||
}
|
||||
PIMutexLocker _ml(s->mutex_connect);
|
||||
PIMutexLocker _mld(d->mutex_connect, s != d);
|
||||
s->connections << Connection(ev_h, 0, sig, d, d);
|
||||
s->connections << __Connection(ev_h, 0, sig, d, d);
|
||||
d->connectors << s;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void PIObject::piConnect(PIObject * src, const PIString & sig, PIObject * dest_o
|
||||
PIMutexLocker _ml(src->mutex_connect);
|
||||
PIMutexLocker _mld(dest_o->mutex_connect, src != dest_o);
|
||||
|
||||
src->connections << Connection(ev_h, e_h, sig, dest_o, dest, args);
|
||||
src->connections << __Connection(ev_h, e_h, sig, dest_o, dest, args);
|
||||
//piCout << "piConnect" << ((PIObject*)dest) << sig << ((PIObject*)dest)->connectors.size_s() << "...";
|
||||
//piCout << "addConnector" << dest_o << src;
|
||||
dest_o->connectors << src;
|
||||
@@ -303,7 +303,7 @@ bool PIObject::piConnectU(PIObject * src, const PIString & ename, PIObject * des
|
||||
return false;
|
||||
}
|
||||
//piCout << "connect" << ename << "->" << hname << "with" << args << "args";
|
||||
src->connections << PIObject::Connection(addr_dest, addr_src, ename, dest_o, dest, args, performer);
|
||||
src->connections << PIObject::__Connection(addr_dest, addr_src, ename, dest_o, dest, args, performer);
|
||||
if (que) performer->proc_event_queue = true;
|
||||
dest_o->connectors << src;
|
||||
return true;
|
||||
@@ -314,7 +314,7 @@ void PIObject::piDisconnect(PIObject * src, const PIString & sig, PIObject * des
|
||||
PIMutexLocker _ml(src->mutex_connect);
|
||||
PIMutexLocker _mld(dest->mutex_connect, src != dest);
|
||||
for (int i = 0; i < src->connections.size_s(); ++i) {
|
||||
Connection & cc(src->connections[i]);
|
||||
__Connection & cc(src->connections[i]);
|
||||
if (cc.event == sig && cc.dest_o == dest && cc.slot == ev_h) {
|
||||
src->connections.remove(i);
|
||||
i--;
|
||||
@@ -328,7 +328,7 @@ void PIObject::piDisconnect(PIObject * src, const PIString & sig, PIObject * des
|
||||
PIMutexLocker _ml(src->mutex_connect);
|
||||
PIMutexLocker _mld(dest->mutex_connect, src != dest);
|
||||
for (int i = 0; i < src->connections.size_s(); ++i) {
|
||||
Connection & cc(src->connections[i]);
|
||||
__Connection & cc(src->connections[i]);
|
||||
if (cc.event == sig && cc.dest_o == dest) {
|
||||
src->connections.remove(i);
|
||||
i--;
|
||||
@@ -341,7 +341,7 @@ void PIObject::piDisconnect(PIObject * src, const PIString & sig, PIObject * des
|
||||
void PIObject::piDisconnect(PIObject * src, const PIString & sig) {
|
||||
PIMutexLocker _ml(src->mutex_connect);
|
||||
for (int i = 0; i < src->connections.size_s(); ++i) {
|
||||
Connection & cc(src->connections[i]);
|
||||
__Connection & cc(src->connections[i]);
|
||||
if (cc.event == sig) {
|
||||
PIObject * dest = cc.dest_o;
|
||||
src->connections.remove(i);
|
||||
@@ -364,7 +364,7 @@ void PIObject::piDisconnect(PIObject * src) {
|
||||
#ifndef ANDROID
|
||||
PIMutexLocker _mld(o->mutex_connect, src != o);
|
||||
#endif
|
||||
PIVector<Connection> & oc(o->connections);
|
||||
PIVector<__Connection> & oc(o->connections);
|
||||
for (int i = 0; i < oc.size_s(); ++i) {
|
||||
//piCout << " check" << (void*)(oc[i].dest_o) << "==" << (void*)(src);
|
||||
if (oc[i].dest_o == src) {
|
||||
@@ -373,7 +373,7 @@ void PIObject::piDisconnect(PIObject * src) {
|
||||
}
|
||||
}
|
||||
}
|
||||
piForeachC (PIObject::Connection & c, src->connections)
|
||||
piForeachC (PIObject::__Connection & c, src->connections)
|
||||
c.dest_o->connectors.remove(src);
|
||||
src->connections.clear();
|
||||
}
|
||||
@@ -384,15 +384,15 @@ void PIObject::updateConnectors() {
|
||||
connectors.clear();
|
||||
piForeach (PIObject * o, objects()) {
|
||||
if (o == this) continue;
|
||||
PIVector<Connection> & oc(o->connections);
|
||||
piForeach (Connection & c, oc)
|
||||
PIVector<__Connection> & oc(o->connections);
|
||||
piForeach (__Connection & c, oc)
|
||||
if (c.dest == this)
|
||||
connectors << o;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PIObject::postQueuedEvent(const PIObject::QueuedEvent & e) {
|
||||
void PIObject::postQueuedEvent(const PIObject::__QueuedEvent & e) {
|
||||
mutex_queue.lock();
|
||||
events_queue << e;
|
||||
mutex_queue.unlock();
|
||||
@@ -419,10 +419,10 @@ PIMap<PIString, PIObject::__MetaData> & PIObject::__meta_data() {
|
||||
|
||||
void PIObject::callQueuedEvents() {
|
||||
mutex_queue.lock();
|
||||
PIVector<QueuedEvent> qe = events_queue;
|
||||
PIVector<__QueuedEvent> qe = events_queue;
|
||||
events_queue.clear();
|
||||
mutex_queue.unlock();
|
||||
piForeachC (QueuedEvent & e, qe) {
|
||||
piForeachC (__QueuedEvent & e, qe) {
|
||||
if (e.dest_o->thread_safe_) e.dest_o->mutex_.lock();
|
||||
e.dest_o->emitter_ = e.src;
|
||||
callAddrV(e.slot, e.dest, e.values.size_s(), e.values);
|
||||
@@ -536,7 +536,7 @@ void PIObject::dump(const PIString & line_prefix) const {
|
||||
PICout(PICoutManipulators::AddNewLine) << line_prefix << " connections {";
|
||||
PICout(PICoutManipulators::AddNewLine) << line_prefix << " count: " << connections.size_s();
|
||||
//printf("dump %d connections\n",connections.size());
|
||||
piForeachC (Connection & c, connections) {
|
||||
piForeachC (__Connection & c, connections) {
|
||||
PIObject * dst = c.dest_o;
|
||||
__MetaFunc hf = dst->methodEH(c.slot);
|
||||
__MetaFunc ef = methodEH(c.signal);
|
||||
|
||||
Reference in New Issue
Block a user