version 2.32.0
PIObject::Connection struct
This commit is contained in:
@@ -143,50 +143,6 @@ bool PIObject::executeQueued(PIObject * performer, const PIString & method, cons
|
||||
}
|
||||
|
||||
|
||||
void PIObject::piConnect(const PIString & src, const PIString & sig, void * dest, void * ev_h) {
|
||||
PIObject * o = findByName(src);
|
||||
if (o == 0) {
|
||||
piCout << "[PIObject] Can`t find object with name \"" << src << "\"!";
|
||||
return;
|
||||
}
|
||||
PIMutexLocker _ml(o->mutex_connect);
|
||||
PIMutexLocker _mld(((PIObject*)dest)->mutex_connect, ((PIObject*)dest) != o);
|
||||
o->connections << __Connection(ev_h, 0, sig, (PIObject*)dest, dest);
|
||||
((PIObject*)dest)->connectors << o;
|
||||
}
|
||||
|
||||
|
||||
void PIObject::piConnect(PIObject * src, const PIString & sig, const PIString & dest, void * ev_h) {
|
||||
PIObject * o = findByName(dest);
|
||||
if (o == 0) {
|
||||
piCout << "[PIObject] Can`t find object with name \"" << dest << "\"!";
|
||||
return;
|
||||
}
|
||||
PIMutexLocker _ml(src->mutex_connect);
|
||||
PIMutexLocker _mld(o->mutex_connect, src != o);
|
||||
src->connections << __Connection(ev_h, 0, sig, o, o);
|
||||
((PIObject*)o)->connectors << src;
|
||||
}
|
||||
|
||||
|
||||
void PIObject::piConnect(const PIString & src, const PIString & sig, const PIString & dest, void * ev_h) {
|
||||
PIObject * s = findByName(src);
|
||||
if (s == 0) {
|
||||
piCout << "[PIObject] Can`t find object with name \"" << src << "\"!";
|
||||
return;
|
||||
}
|
||||
PIObject * d = findByName(dest);
|
||||
if (d == 0) {
|
||||
piCout << "[PIObject] Can`t find object with name \"" << dest << "\"!";
|
||||
return;
|
||||
}
|
||||
PIMutexLocker _ml(s->mutex_connect);
|
||||
PIMutexLocker _mld(d->mutex_connect, s != d);
|
||||
s->connections << __Connection(ev_h, 0, sig, d, d);
|
||||
d->connectors << s;
|
||||
}
|
||||
|
||||
|
||||
PIStringList PIObject::scopeList() const {
|
||||
PIMutexLocker ml(__meta_mutex());
|
||||
return __meta_data()[classNameID()].scope_list;
|
||||
@@ -258,31 +214,33 @@ PIObject::__MetaFunc PIObject::methodEH(const void * addr) const {
|
||||
}
|
||||
|
||||
|
||||
void PIObject::piConnect(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, void * ev_h, void * e_h, int args, const char * loc) {
|
||||
PIObject::Connection PIObject::piConnect(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, void * ev_h, void * e_h, int args, const char * loc) {
|
||||
//piCout << "piConnect ...";
|
||||
//piCout << "piConnect" << src << (void*)(dest) << sig;
|
||||
//piCout << "piConnect" << src->className() << "->" << ((PIObject*)dest)->className();
|
||||
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);
|
||||
Connection conn(ev_h, e_h, sig, src, dest_o, dest, args);
|
||||
src->connections << conn;
|
||||
//piCout << "piConnect" << ((PIObject*)dest) << sig << ((PIObject*)dest)->connectors.size_s() << "...";
|
||||
//piCout << "addConnector" << dest_o << src;
|
||||
dest_o->connectors << src;
|
||||
//piCout << "piConnect" << ((PIObject*)dest) << sig << ((PIObject*)dest)->connectors.size_s();
|
||||
//piCout << "piConnect ok";
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
bool PIObject::piConnectU(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, const PIString & hname, const char * loc, PIObject * performer) {
|
||||
if (src == 0 || dest_o == 0 || dest == 0) return false;
|
||||
PIObject::Connection PIObject::piConnectU(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, const PIString & hname, const char * loc, PIObject * performer) {
|
||||
if (src == 0 || dest_o == 0 || dest == 0) return Connection();
|
||||
if (!src->isPIObject()) {
|
||||
piCout << "[piConnectU] \"" << sig << "\" -> \"" << hname << "\" error: source object is not PIObject! (" << loc << ")";
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
if (!dest_o->isPIObject()) {
|
||||
piCout << "[piConnectU] \"" << sig << "\" -> \"" << hname << "\" error: destination object is not PIObject! (" << loc << ")";
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
PIMutexLocker ml(__meta_mutex());
|
||||
PIMutexLocker mls(src->mutex_connect);
|
||||
@@ -290,11 +248,11 @@ bool PIObject::piConnectU(PIObject * src, const PIString & sig, PIObject * dest_
|
||||
PIVector<__MetaFunc> m_src = src->findEH(sig), m_dest = dest_o->findEH(hname);
|
||||
if (m_src.isEmpty()) {
|
||||
piCout << "[piConnectU] Error: can`t find event \"" << sig << "\" in class \"" << src->className() << "\"! (" << loc << ")";
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
if (m_dest.isEmpty()) {
|
||||
piCout << "[piConnectU] Error: can`t find handler \"" << hname << "\" in class \"" << dest_o->className() << "\"! (" << loc << ")";
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
void * addr_src(0), * addr_dest(0);
|
||||
int args(0);
|
||||
@@ -313,25 +271,26 @@ bool PIObject::piConnectU(PIObject * src, const PIString & sig, PIObject * dest_
|
||||
if (addr_src == 0) {
|
||||
piCout << "[piConnectU] Error: can`t find suitable pair of event \"" << sig << "\" in class \"" << src->className()
|
||||
<< "\" and handler \"" << hname << "\" in class \"" << dest_o->className() << "\"! (" << loc << ")";
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
src->connections << PIObject::__Connection(addr_dest, addr_src, sig, dest_o, dest, args, performer);
|
||||
Connection conn(addr_dest, addr_src, sig, src, dest_o, dest, args, performer);
|
||||
src->connections << conn;
|
||||
if (que) performer->proc_event_queue = true;
|
||||
dest_o->connectors << src;
|
||||
//piCout << cc << cq << _ol.size();//"connect" << src << "->" << dest_o << ", dest.connectors.size() =" << dest_o->connectors.size();
|
||||
return true;
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
bool PIObject::piConnectLS(PIObject * src, const PIString & sig, std::function<void()> * f, const char * loc) {
|
||||
PIObject::Connection PIObject::piConnectLS(PIObject * src, const PIString & sig, std::function<void()> * f, const char * loc) {
|
||||
if (src == 0) {
|
||||
delete f;
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
if (!src->isPIObject()) {
|
||||
piCout << "[piConnectLS] \"" << sig << "\" -> [lambda] error: source object is not PIObject! (" << loc << ")";
|
||||
delete f;
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
PIMutexLocker ml(__meta_mutex());
|
||||
PIMutexLocker mls(src->mutex_connect);
|
||||
@@ -340,19 +299,19 @@ bool PIObject::piConnectLS(PIObject * src, const PIString & sig, std::function<v
|
||||
if (m_src.isEmpty()) {
|
||||
piCout << "[piConnectLS] Error: can`t find event \"" << sig << "\" in class \"" << src->className() << "\"! (" << loc << ")";
|
||||
delete f;
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
if (m_src.size() != 1) {
|
||||
piCout << "[piConnectLS] Error: can`t connect overloaded event \"" << sig << "\" in class \"" << src->className() << "\"! (" << loc << ")";
|
||||
delete f;
|
||||
return false;
|
||||
return Connection();
|
||||
}
|
||||
PIObject::__Connection conn(0, m_src[0].addr, sig);
|
||||
PIObject::Connection conn(0, m_src[0].addr, sig, src);
|
||||
//piCout << "found";
|
||||
conn.functor = f;
|
||||
src->connections << conn;
|
||||
//piCout << "finished";
|
||||
return true;
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +319,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[i].destroy();
|
||||
src->connections.remove(i);
|
||||
@@ -375,7 +334,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[i].destroy();
|
||||
src->connections.remove(i);
|
||||
@@ -389,7 +348,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[i].destroy();
|
||||
@@ -417,7 +376,7 @@ void PIObject::piDisconnectAll() {
|
||||
#if !defined(ANDROID) && !defined(MAC_OS) && !defined(FREERTOS)
|
||||
PIMutexLocker _mld(o->mutex_connect, this != o);
|
||||
#endif
|
||||
PIVector<__Connection> & oc(o->connections);
|
||||
PIVector<Connection> & oc(o->connections);
|
||||
for (int i = 0; i < oc.size_s(); ++i) {
|
||||
if (oc[i].functor) continue;
|
||||
//piCout << " check" << (void*)(oc[i].dest_o) << "==" << (void*)(src);
|
||||
@@ -429,7 +388,7 @@ void PIObject::piDisconnectAll() {
|
||||
}
|
||||
}
|
||||
// piCout << "disconnect connections =" << connections.size();
|
||||
piForeachC (PIObject::__Connection & c, connections) {
|
||||
piForeachC (PIObject::Connection & c, connections) {
|
||||
if (c.functor) continue;
|
||||
if (!c.dest_o) continue;
|
||||
if (!c.dest_o->isPIObject()) continue;
|
||||
@@ -447,8 +406,8 @@ void PIObject::updateConnectors() {
|
||||
PIMutexLocker _ml(mutexObjects());
|
||||
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;
|
||||
}
|
||||
@@ -609,7 +568,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 ef = methodEH(c.signal);
|
||||
PIString src(c.event);
|
||||
@@ -682,12 +641,52 @@ void PIObject::__MetaData::addScope(const PIString & s, uint shash) {
|
||||
}
|
||||
|
||||
|
||||
void PIObject::__Connection::destroy() {
|
||||
|
||||
|
||||
void PIObject::Connection::destroy() {
|
||||
if (functor) delete functor;
|
||||
functor = nullptr;
|
||||
}
|
||||
|
||||
|
||||
PIObject::Connection::Connection() {
|
||||
slot = signal = dest = nullptr;
|
||||
src_o = dest_o = performer = nullptr;
|
||||
functor = nullptr;
|
||||
eventID = 0;
|
||||
args_count = 0;
|
||||
}
|
||||
|
||||
|
||||
bool PIObject::Connection::disconnect() {
|
||||
if (!isValid() || !src_o) return false;
|
||||
bool ndm = dest_o && (src_o != dest_o), ret = false, found = false;
|
||||
PIMutexLocker _ml(src_o->mutex_connect);
|
||||
if (ndm) dest_o->mutex_connect.lock();
|
||||
for (int i = 0; i < src_o->connections.size_s(); ++i) {
|
||||
Connection & cc(src_o->connections[i]);
|
||||
if (cc.eventID == eventID) {
|
||||
if (dest_o && (cc.dest_o == dest_o)) {
|
||||
if (cc.slot == slot)
|
||||
found = true;
|
||||
}
|
||||
if (functor && (cc.functor == functor))
|
||||
found = true;
|
||||
}
|
||||
if (found) {
|
||||
src_o->connections[i].destroy();
|
||||
src_o->connections.remove(i);
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dest_o)
|
||||
dest_o->updateConnectors();
|
||||
if (ndm) dest_o->mutex_connect.unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
PRIVATE_DEFINITION_START(PIObject::Deleter)
|
||||
|
||||
@@ -50,6 +50,54 @@ public:
|
||||
|
||||
virtual ~PIObject();
|
||||
|
||||
//! Helper class for obtain info about if connection successful and disconnect single connection
|
||||
class PIP_EXPORT Connection {
|
||||
friend class PIObject;
|
||||
Connection(void * sl, void * si, const PIString & e = PIString(),
|
||||
PIObject * s_o = nullptr, PIObject * d_o = nullptr,
|
||||
void * d = nullptr, int ac = 0, PIObject * p = nullptr) {
|
||||
slot = sl;
|
||||
signal = si;
|
||||
event = e;
|
||||
eventID = e.hash();
|
||||
src_o = s_o;
|
||||
dest_o = d_o;
|
||||
dest = d;
|
||||
args_count = ac;
|
||||
performer = p;
|
||||
functor = 0;
|
||||
}
|
||||
void destroy();
|
||||
void * slot;
|
||||
void * signal;
|
||||
std::function<void()> * functor;
|
||||
PIString event;
|
||||
uint eventID;
|
||||
PIObject * src_o, * dest_o;
|
||||
PIObject * performer;
|
||||
void * dest;
|
||||
int args_count;
|
||||
public:
|
||||
|
||||
//! Contructs invalid %Connection
|
||||
Connection();
|
||||
|
||||
//! Returns if %Connection is valid
|
||||
bool isValid() const {return signal;}
|
||||
|
||||
//! Returns source object
|
||||
PIObject * sourceObject() const {return src_o;}
|
||||
|
||||
//! Returns destination object or nullptr if this is lambda connection
|
||||
PIObject * destinationObject() const {return dest_o;}
|
||||
|
||||
//! Returns performer object or nullptr if this is non-queued connection
|
||||
PIObject * performerObject() const {return performer;}
|
||||
|
||||
//! Disconnect this %Connection, returns if operation successful
|
||||
bool disconnect();
|
||||
};
|
||||
|
||||
private:
|
||||
uint _signature_;
|
||||
|
||||
@@ -141,21 +189,29 @@ public:
|
||||
PIString methodEHFromAddr(const void * addr) const;
|
||||
|
||||
// / Direct connect
|
||||
static void piConnect(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, void * ev_h, void * e_h, int args, const char * loc);
|
||||
static bool piConnectU(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, const PIString & hname, const char * loc, PIObject * performer = 0);
|
||||
static bool piConnectLS(PIObject * src, const PIString & sig, std::function<void()> * f, const char * loc);
|
||||
static PIObject::Connection piConnect(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, void * ev_h, void * e_h, int args, const char * loc);
|
||||
static PIObject::Connection piConnectU(PIObject * src, const PIString & sig, PIObject * dest_o, void * dest, const PIString & hname, const char * loc, PIObject * performer = 0);
|
||||
static PIObject::Connection piConnectLS(PIObject * src, const PIString & sig, std::function<void()> * f, const char * loc);
|
||||
template <typename INPUT, typename... TYPES>
|
||||
static std::function<void()> * __newFunctor(void(*stat_handler)(void*,TYPES...), INPUT functor) {
|
||||
return (std::function<void()>*)(new std::function<void(TYPES...)>(functor));
|
||||
}
|
||||
|
||||
// / Through names and mixed
|
||||
static void piConnect(const PIString & src, const PIString & sig, void * dest, void * ev_h);
|
||||
static void piConnect(PIObject * src, const PIString & sig, const PIString & dest, void * ev_h);
|
||||
static void piConnect(const PIString & src, const PIString & sig, const PIString & dest, void * ev_h);
|
||||
|
||||
|
||||
//! Disconnect object from all connections with event name "sig", connected to destination object "dest" and handler "ev_h"
|
||||
void piDisconnect(const PIString & sig, PIObject * dest, void * ev_h) {piDisconnect(this, sig, dest, ev_h);}
|
||||
|
||||
//! Disconnect object from all connections with event name "sig", connected to destination object "dest"
|
||||
void piDisconnect(const PIString & sig, PIObject * dest) {piDisconnect(this, sig, dest);}
|
||||
|
||||
//! Disconnect object from all connections with event name "sig"
|
||||
void piDisconnect(const PIString & sig) {piDisconnect(this, sig);}
|
||||
|
||||
|
||||
//! Disconnect object "src" from all connections with event name "sig", connected to destination object "dest" and handler "ev_h"
|
||||
static void piDisconnect(PIObject * src, const PIString & sig, PIObject * dest, void * ev_h);
|
||||
|
||||
//! Disconnect object "src" from all connections with event name "sig", connected to destination object "dest"
|
||||
static void piDisconnect(PIObject * src, const PIString & sig, PIObject * dest);
|
||||
|
||||
//! Disconnect object "src" from all connections with event name "sig"
|
||||
@@ -164,7 +220,7 @@ public:
|
||||
// / Raise events
|
||||
static void raiseEvent(PIObject * sender, const uint eventID) {
|
||||
for (int j = 0; j < sender->connections.size_s(); ++j) {
|
||||
__Connection i(sender->connections[j]);
|
||||
Connection i(sender->connections[j]);
|
||||
if (i.eventID != eventID) continue;
|
||||
if (i.functor) {
|
||||
(*(i.functor))();
|
||||
@@ -193,7 +249,7 @@ public:
|
||||
template <typename T0>
|
||||
static void raiseEvent(PIObject * sender, const uint eventID, const T0 & v0 = T0()) {
|
||||
for (int j = 0; j < sender->connections.size_s(); ++j) {
|
||||
__Connection i(sender->connections[j]);
|
||||
Connection i(sender->connections[j]);
|
||||
if (i.eventID != eventID) continue;
|
||||
if (i.functor) {
|
||||
(*((std::function<void(T0)>*)i.functor))(v0);
|
||||
@@ -224,7 +280,7 @@ public:
|
||||
template <typename T0, typename T1>
|
||||
static void raiseEvent(PIObject * sender, const uint eventID, const T0 & v0 = T0(), const T1 & v1 = T1()) {
|
||||
for (int j = 0; j < sender->connections.size_s(); ++j) {
|
||||
__Connection i(sender->connections[j]);
|
||||
Connection i(sender->connections[j]);
|
||||
if (i.eventID != eventID) continue;
|
||||
if (i.functor) {
|
||||
(*((std::function<void(T0, T1)>*)i.functor))(v0, v1);
|
||||
@@ -259,7 +315,7 @@ public:
|
||||
template <typename T0, typename T1, typename T2>
|
||||
static void raiseEvent(PIObject * sender, const uint eventID, const T0 & v0 = T0(), const T1 & v1 = T1(), const T2 & v2 = T2()) {
|
||||
for (int j = 0; j < sender->connections.size_s(); ++j) {
|
||||
__Connection i(sender->connections[j]);
|
||||
Connection i(sender->connections[j]);
|
||||
if (i.eventID != eventID) continue;
|
||||
if (i.functor) {
|
||||
(*((std::function<void(T0, T1, T2)>*)i.functor))(v0, v1, v2);
|
||||
@@ -296,7 +352,7 @@ public:
|
||||
template <typename T0, typename T1, typename T2, typename T3>
|
||||
static void raiseEvent(PIObject * sender, const uint eventID, const T0 & v0 = T0(), const T1 & v1 = T1(), const T2 & v2 = T2(), const T3 & v3 = T3()) {
|
||||
for (int j = 0; j < sender->connections.size_s(); ++j) {
|
||||
__Connection i(sender->connections[j]);
|
||||
Connection i(sender->connections[j]);
|
||||
if (i.eventID != eventID) continue;
|
||||
if (i.functor) {
|
||||
(*((std::function<void(T0, T1, T2, T3)>*)i.functor))(v0, v1, v2, v3);
|
||||
@@ -425,30 +481,6 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
struct __Connection {
|
||||
__Connection(void * sl = 0, void * si = 0, const PIString & e = PIString(), PIObject * d_o = 0, void * d = 0, int ac = 0, PIObject * p = 0) {
|
||||
slot = sl;
|
||||
signal = si;
|
||||
event = e;
|
||||
eventID = e.hash();
|
||||
dest_o = d_o;
|
||||
dest = d;
|
||||
args_count = ac;
|
||||
performer = p;
|
||||
functor = 0;
|
||||
}
|
||||
void destroy();
|
||||
void * slot;
|
||||
void * signal;
|
||||
std::function<void()> * functor;
|
||||
PIString event;
|
||||
uint eventID;
|
||||
PIObject * dest_o;
|
||||
PIObject * performer;
|
||||
void * dest;
|
||||
int args_count;
|
||||
};
|
||||
|
||||
struct __QueuedEvent {
|
||||
__QueuedEvent(void * sl = 0, void * d = 0, PIObject * d_o = 0, PIObject * s = 0, const PIVector<PIVariantSimple> & v = PIVector<PIVariantSimple>()) {
|
||||
slot = sl;
|
||||
@@ -499,7 +531,7 @@ private:
|
||||
static void callAddrV(void * slot, void * obj, int args, const PIVector<PIVariantSimple> & vl);
|
||||
|
||||
|
||||
PIVector<__Connection> connections;
|
||||
PIVector<Connection> connections;
|
||||
PIMap<uint, PIPair<PIString, PIVariant> > properties_;
|
||||
PISet<PIObject * > connectors;
|
||||
PIVector<__QueuedEvent> events_queue;
|
||||
|
||||
@@ -102,28 +102,36 @@
|
||||
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\". \"Event\" and \"handler\" must has equal argument lists.
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECTU(src, event, dest, handler)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\".
|
||||
/// Event handler will be executed by \"performer\". \"Event\" and \"handler\" must has equal argument lists.
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECTU_QUEUED(src, event, dest, handler, performer)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to lambda-expression \"functor\". \"Event\" and \"functor\" must has equal argument lists.
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECTL(src, event, functor)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\" with return type \"ret\" from object \"dest\" with check of event and handler exists
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECT0(ret, src, event, dest, handler)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\" with return type \"ret\" from object \"dest\" with check of event and handler exists
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECT1(ret, type0, src, event, dest, handler)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\" with return type \"ret\" from object \"dest\" with check of event and handler exists
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECT2(ret, type0, type1, src, event, dest, handler)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\" with return type \"ret\" from object \"dest\" with check of event and handler exists
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECT3(ret, type0, type1, type2, src, event, dest, handler)
|
||||
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\" with return type \"ret\" from object \"dest\" with check of event and handler exists
|
||||
/// \relatesalso PIObject @brief connect event \"event\" from object \"src\" to event handler \"handler\" with return type \"ret\" from object \"dest\" with check of event and handler exists.
|
||||
/// Returns PIObject::Connection
|
||||
#define CONNECT4(ret, type0, type1, type2, type3, src, event, dest, handler)
|
||||
|
||||
/// \relatesalso PIObject @brief CONNECT is synonym of CONNECT0
|
||||
|
||||
@@ -554,7 +554,7 @@ void PIThread::__thread_func_once__() {
|
||||
void PIThread::runOnce(PIObject * object, const char * handler, const PIString & name) {
|
||||
PIThread * t = new PIThread();
|
||||
t->setName(name);
|
||||
if (!PIObject::piConnectU(t, PIStringAscii("started"), object, object, PIStringAscii(handler), "PIThread::runOnce")) {
|
||||
if (!PIObject::piConnectU(t, PIStringAscii("started"), object, object, PIStringAscii(handler), "PIThread::runOnce").isValid()) {
|
||||
delete t;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user