/* executor.h */ /** * Copyright - See the COPYRIGHT that is included with this distribution. * EPICS pvDataCPP is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ #ifndef EXECUTOR_H #define EXECUTOR_H #include #include #include #include #include #include namespace epics { namespace pvData { class Command; class Executor; typedef std::tr1::shared_ptr CommandPtr; typedef std::tr1::shared_ptr ExecutorPtr; class Command { public: POINTER_DEFINITIONS(Command); virtual ~Command(){} virtual void command() = 0; private: CommandPtr next; friend class Executor; }; class Executor : public Runnable{ public: POINTER_DEFINITIONS(Executor); Executor(String threadName,ThreadPriority priority); ~Executor(); void execute(CommandPtr const &node); virtual void run(); private: CommandPtr head; CommandPtr tail; epics::pvData::Mutex mutex; epics::pvData::Event moreWork; epics::pvData::Event stopped; epics::pvData::Thread thread; }; }} #endif /* EXECUTOR_H */