#ifndef __Dispatcher_h_ #define __Dispatcher_h_ #include "../shared/ThreadClass.h" #include "../shared/Messages.h" #include "GridReaderBase.h" #include "GridFiller.h" #include "DataNodeThread.h" class Dispatcher : private ThreadClass { public: class StartRequest : public Request { public: std::string symbol; GridPrototypeRef prototype; StartRequest() : Request(NULL) { } }; private: enum { mtStart, mtCandleTime, mtDump, mtQuit }; RequestQueue _incoming; IntradayCandleManager *_candleManager; GridFiller _gridFiller; void update(GridInstance *grid, time_t time); protected: void threadFunction(); public: Dispatcher(DataNodeThread &dataNodeThread); ~Dispatcher(); void start(StartRequest *startRequest); void start(std::string symbol, GridPrototypeRef prototype); }; #endif