git-svn-id: svn://db.shs.com.ru/pip@496 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-05-07 09:36:13 +00:00
parent b9c609ecad
commit e33406b283
10 changed files with 56 additions and 40 deletions

View File

@@ -266,13 +266,6 @@ PIChar PIChar::toLower() const {
}
#ifdef PIP_STD_IOSTREAM
std::ostream & operator <<(std::ostream & s, const PIChar & v) {
s << v.toCharPtr();
return s;
}
#endif
PICout operator <<(PICout s, const PIChar & v) {
s.space();
s.setControl(0, true);

View File

@@ -157,11 +157,6 @@ private:
};
#ifdef PIP_STD_IOSTREAM
//! Output operator to \c std::ostream
std::ostream & operator <<(std::ostream & s, const PIChar & v);
#endif
//! Output operator to \a PICout
PICout operator <<(PICout s, const PIChar & v);

View File

@@ -101,7 +101,7 @@ bool PIObject::execute(const PIString & method, const PIVector<PIVariant> & vl)
bool ok = findSuitableMethodV(method, vl.size_s(), ac, func);
if (!ok)
return false;
callAddrV(func.addrV, this, ac, vl);
callAddrV(func.addrV, toThis(), ac, vl);
return true;
}
@@ -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, this, this, performer, vl));
performer->postQueuedEvent(QueuedEvent(func.addrV, toThis(), this, performer, vl));
performer->proc_event_queue = true;
return true;
}
@@ -399,6 +399,12 @@ void PIObject::postQueuedEvent(const PIObject::QueuedEvent & e) {
}
void * PIObject::toThis() const {
//piCout << ptrOffset() << (void*)this << (void*)((char*)this - ptrOffset());
return (void*)((char*)this - ptrOffset());
}
PIMutex & PIObject::__meta_mutex() {
static PIMutex ret;
return ret;

View File

@@ -195,7 +195,8 @@
public: \
static const PIString __classNameS() {return PIStringAscii(#name);} \
virtual const char * className() const {return #name;} \
private:
private: \
virtual int ptrOffset() const {name * o = (name*)100; return int(llong((PIObject*)o) - llong(o));}
#define PIOBJECT_PARENT(name) \
class __##name##_ParentInitializer__ { \
@@ -885,6 +886,8 @@ private:
__MetaFunc methodEH(const void * addr) const;
void updateConnectors();
void postQueuedEvent(const QueuedEvent & e);
void * toThis() const;
virtual int ptrOffset() const {return 0;}
static PIVector<PIObject * > & objects();
static void callAddrV(void * slot, void * obj, int args, const PIVector<PIVariant> & vl);

View File

@@ -75,6 +75,8 @@ inline PIString StdWString2PIString(const std::wstring & v) {
//! \relatesalso PIChar \brief Output operator to \c std::ostream
inline std::ostream & operator <<(std::ostream & s, const PIChar & v) {s << v.toCharPtr(); return s;}
//! \relatesalso PIString \brief Return concatenated string
inline PIString operator +(const PIString & f, const std::string & str) {PIString s(f); s += StdString2PIString(str); return s;}

View File

@@ -22,7 +22,7 @@
#include "piprocess.h"
class PIP_EXPORT PICodec: private PIProcess
class PIP_EXPORT PICodec: protected PIProcess
{
PIOBJECT(PICodec)
public:

View File

@@ -38,7 +38,7 @@
/// bool exec(const PIString & program, const PIStringList & args)
/// void terminate()
/// bool waitForFinish(int timeout_msecs = 60000)
class PIP_EXPORT PIProcess: private PIThread
class PIP_EXPORT PIProcess: protected PIThread
{
PIOBJECT_SUBCLASS(PIProcess, PIThread)
public: