/* arrayPerformance.h */ /** * Copyright - See the COPYRIGHT that is included with this distribution. * EPICS pvData is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ /** * @author mrk * @date 2013.08.08 */ #ifndef ARRAYPERFORMANCE_H #define ARRAYPERFORMANCE_H #include #include #include #include #include namespace epics { namespace pvDatabase { class ArrayPerformance; typedef std::tr1::shared_ptr ArrayPerformancePtr; class ArrayPerformanceThread; typedef std::tr1::shared_ptr ArrayPerformanceThreadPtr; class ArrayPerformance : public PVRecord { public: POINTER_DEFINITIONS(ArrayPerformance); static ArrayPerformancePtr create( epics::pvData::String const & recordName, size_t size, double delay); virtual ~ArrayPerformance(); virtual bool init(); virtual void start(); virtual void process(); virtual void destroy(); private: ArrayPerformance(epics::pvData::String const & recordName, epics::pvData::PVStructurePtr const & pvStructure, size_t size, double delay); size_t size; double delay; bool isDestroyed; epics::pvData::PVLongArrayPtr pvValue; epics::pvData::PVTimeStamp pvTimeStamp; epics::pvData::TimeStamp timeStamp; ArrayPerformanceThreadPtr arrayPerformanceThread; friend class ArrayPerformanceThread; }; class ArrayPerformanceThread : public epicsThreadRunable { public: ArrayPerformanceThread(ArrayPerformancePtr const & arrayPerformance); virtual ~ArrayPerformanceThread(){}; void init(); void start(); virtual void run(); void destroy(); private: ArrayPerformancePtr arrayPerformance; bool isDestroyed; bool runReturned; epics::pvData::String threadName; epics::pvData::Mutex mutex; epics::pvData::int64 value; std::auto_ptr thread; }; }} #endif /* ARRAYPERFORMANCE_H */