Fawkes API Fawkes Development Version

eclipse_thread.h

00001 
00002 /***************************************************************************
00003  *  eclipse_thread.h - Fawkes Readylog ECLiPSe Thread
00004  *
00005  *  Created: Wed Jul 16 10:20:51 2009
00006  *  Copyright  2009  Daniel Beck
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
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: /* methods */
00063   bool load_file( const char* filename );
00064   bool register_interface( fawkes::Interface* interface );
00065 
00066  private: /* members */
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 /* __PLUGINS_READYLOG_AGENT_ECLIPSE_THREAD_H_ */
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends