#ifndef CORAX_H #define CORAX_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "tools/parser.h" #include "models/player.h" class Corax: public QObject { Q_OBJECT public: Corax(QObject *parent = 0); ~Corax(); static Corax* corax; private: bool started; W::Server *server; W::Logger *logger; W::ParentReporter* parentReporter; M::Attributes* attributes; U::Commands* commands; U::Connector* connector; W::Dispatcher *dispatcher; std::map caches; std::map parsers; std::map players; handler(clearCache); handler(parseDirectory); handler(givePlayer); public slots: void start(); void stop(); private slots: void onModelServiceMessage(const QString& msg); void onConnectionCountChanged(uint64_t count); void onParserDone(const W::String& path); void onCacheCountChange(uint64_t count); void onNodeConnected(const W::String& name); void onNodeDisconnected(const W::String& name); private: void addCache(ResourceCache* cache); void createCaches(); void createHandlers(); private: class SingletonError: public Utils::Exception { public: SingletonError():Exception(){} std::string getMessage() const{return "Corax is a singleton, there was an attempt to construct it at the second time";} }; }; #endif // CORAX_H