diff --git a/main.cpp b/main.cpp index 2004c105..ebf271aa 100644 --- a/main.cpp +++ b/main.cpp @@ -72,13 +72,15 @@ int main(int argc, char *argv[]) { s.rootTile()->addTile(list); s.waitForFinish();*/ - PIDeque d; + /*PIDeque d; d.resize(atoi(argv[1])); while (1) { d.push_back(1); d.pop_front(); piCout << d.size() << d.capacity() << d._start(); - } + }*/ + //PIVector o; + //o[0] = o[1]; return 0; } diff --git a/src/core/piobject.h b/src/core/piobject.h index 9d6b1425..a90174cc 100755 --- a/src/core/piobject.h +++ b/src/core/piobject.h @@ -421,11 +421,14 @@ class PIP_EXPORT PIObject public: //! Contructs PIObject with name "name" - PIObject(const PIString & name = PIString()); + explicit PIObject(const PIString & name = PIString()); virtual ~PIObject(); private: + explicit PIObject(const PIObject & ); + void operator =(const PIObject & ); + uint _signature_; public: diff --git a/src/piversion.h b/src/piversion.h index 413d3b35..29a49d52 100644 --- a/src/piversion.h +++ b/src/piversion.h @@ -3,8 +3,8 @@ #define PIVERSION_H #define PIP_VERSION_MAJOR 0 -#define PIP_VERSION_MINOR 7 -#define PIP_VERSION_REVISION 2 +#define PIP_VERSION_MINOR 8 +#define PIP_VERSION_REVISION 0 #define PIP_VERSION_SUFFIX "" #endif // PIVERSION_H diff --git a/src/thread/pimutex.cpp b/src/thread/pimutex.cpp index ff9a7287..5873eb60 100755 --- a/src/thread/pimutex.cpp +++ b/src/thread/pimutex.cpp @@ -48,12 +48,6 @@ PIMutex::~PIMutex() { } -PIMutex & PIMutex::operator =(const PIMutex & other) { - init(); - return *this; -} - - void PIMutex::lock() { #ifdef WINDOWS WaitForSingleObject(mutex, INFINITE); diff --git a/src/thread/pimutex.h b/src/thread/pimutex.h index e32e8cdd..9f807aba 100755 --- a/src/thread/pimutex.h +++ b/src/thread/pimutex.h @@ -34,13 +34,12 @@ public: //! Constructs unlocked mutex explicit PIMutex(); + + explicit PIMutex(const PIMutex & ); ~PIMutex(); - PIMutex & operator =(const PIMutex & other); - - //! \brief Lock mutex //! \details If mutex is unlocked it set to locked state and returns immediate. //! If mutex is already locked function blocks until mutex will be unlocked @@ -59,6 +58,8 @@ public: bool isLocked() const; private: + void operator =(const PIMutex & ); + void init(); void destroy(); diff --git a/src/thread/pitimer.cpp b/src/thread/pitimer.cpp index 192ac966..4d66116f 100755 --- a/src/thread/pitimer.cpp +++ b/src/thread/pitimer.cpp @@ -105,6 +105,64 @@ bool _PITimerBase::stop() { +class _PITimerImp_Thread: public _PITimerBase { +public: + _PITimerImp_Thread(); + virtual ~_PITimerImp_Thread(); +protected: + void prepareStart(double interval_ms); + bool threadFunc(); // returns true if repeat is needed + int wait_dt, wait_dd, wait_tick; +private: + virtual bool startTimer(double interval_ms); + virtual bool stopTimer(); + static void threadFuncS(void * d) {((_PITimerImp_Thread*)d)->threadFunc();} + void adjustTimes(); + + PIThread thread_; + PISystemTime st_time, st_inc, st_wait, st_odt; +}; + + +#ifdef PIP_TIMER_RT +struct _PITimerImp_RT_Private_; +class _PITimerImp_RT: public _PITimerBase { +public: + _PITimerImp_RT(); + virtual ~_PITimerImp_RT(); +protected: +private: + virtual bool startTimer(double interval_ms); + virtual bool stopTimer(); + + int ti; + _PITimerImp_RT_Private_ * priv; +}; +#endif + + +class _PITimerImp_Pool: public _PITimerImp_Thread { +public: + _PITimerImp_Pool(); + virtual ~_PITimerImp_Pool() {stop();} +private: + class Pool: public PIThread { + public: + Pool(); + ~Pool(); + static Pool * instance(); + void add(_PITimerImp_Pool * t); + void remove(_PITimerImp_Pool * t); + void run(); + PIVector<_PITimerImp_Pool * > timers, to_remove; + }; + virtual bool startTimer(double interval_ms); + virtual bool stopTimer(); +}; + + + + _PITimerImp_Thread::_PITimerImp_Thread() { thread_.setName("__S__PITimerImp_Thread::thread"); wait_dt = 100; diff --git a/src/thread/pitimer.h b/src/thread/pitimer.h index 3eb1b449..07740b6c 100755 --- a/src/thread/pitimer.h +++ b/src/thread/pitimer.h @@ -71,63 +71,6 @@ protected: -class _PITimerImp_Thread: public _PITimerBase { -public: - _PITimerImp_Thread(); - virtual ~_PITimerImp_Thread(); -protected: - void prepareStart(double interval_ms); - bool threadFunc(); // returns true if repeat is needed - int wait_dt, wait_dd, wait_tick; -private: - virtual bool startTimer(double interval_ms); - virtual bool stopTimer(); - static void threadFuncS(void * d) {((_PITimerImp_Thread*)d)->threadFunc();} - void adjustTimes(); - - PIThread thread_; - PISystemTime st_time, st_inc, st_wait, st_odt; -}; - - -#ifdef PIP_TIMER_RT -struct _PITimerImp_RT_Private_; -class _PITimerImp_RT: public _PITimerBase { -public: - _PITimerImp_RT(); - virtual ~_PITimerImp_RT(); -protected: -private: - virtual bool startTimer(double interval_ms); - virtual bool stopTimer(); - - int ti; - _PITimerImp_RT_Private_ * priv; -}; -#endif - - -class _PITimerImp_Pool: public _PITimerImp_Thread { -public: - _PITimerImp_Pool(); - virtual ~_PITimerImp_Pool() {stop();} -private: - class Pool: public PIThread { - public: - Pool(); - ~Pool(); - static Pool * instance(); - void add(_PITimerImp_Pool * t); - void remove(_PITimerImp_Pool * t); - void run(); - PIVector<_PITimerImp_Pool * > timers, to_remove; - }; - virtual bool startTimer(double interval_ms); - virtual bool stopTimer(); -}; - - - class PITimer: public PIObject { PIOBJECT_SUBCLASS(PITimer, PIObject)