00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLUGINS_READYLOG_AGENT_ECLIPSE_THREAD_H_
00024 #define __PLUGINS_READYLOG_AGENT_ECLIPSE_THREAD_H_
00025
00026 #include <core/threading/thread.h>
00027 #include <aspect/logging.h>
00028 #include <aspect/configurable.h>
00029 #include <aspect/blackboard.h>
00030
00031 #include <map>
00032 #include <string>
00033 #include <vector>
00034
00035 namespace fawkes {
00036 class Interface;
00037 }
00038
00039 class EclipseAgentThread
00040 : public fawkes::Thread,
00041 public fawkes::BlackBoardAspect,
00042 public fawkes::ConfigurableAspect,
00043 public fawkes::LoggingAspect
00044 {
00045 public:
00046 EclipseAgentThread();
00047 virtual ~EclipseAgentThread();
00048
00049 virtual void init();
00050 virtual void finalize();
00051 virtual void once();
00052
00053 void post_event( const char* );
00054 void read_interfaces();
00055 void write_interfaces();
00056
00057 fawkes::Interface* get_registered_interface( const char* id );
00058 fawkes::Logger* get_logger();
00059
00060 static EclipseAgentThread* instance();
00061
00062 private:
00063 bool load_file( const char* filename );
00064 bool register_interface( fawkes::Interface* interface );
00065
00066 private:
00067 static EclipseAgentThread* m_instance;
00068
00069 bool m_initialized;
00070
00071 std::vector< fawkes::Interface* > m_reading_ifaces;
00072 std::vector< fawkes::Interface* > m_writing_ifaces;
00073
00074 std::map< std::string, fawkes::Interface* > m_registered_interfaces;
00075 };
00076
00077 #endif