Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/pauldt/projects/IDEA/IDEA-ALL/IDEA-DEV/Core/ReactivePlanner/Includes/ReactivePlannerRunner.hh

Go to the documentation of this file.
00001 // -*- Mode: c++ -*-
00002 //     File: $Source: /home/cvs/ISG-Repository/IDEA-DEV/Core/ReactivePlanner/Includes/ReactivePlannerRunner.hh,v $
00003 //      Tag: $Name: DR_01_11_06 $
00004 //      CVS: $Id: ReactivePlannerRunner.hh,v 1.3 2005/12/30 22:22:19 rijsman Exp $
00005 //     Info: $CVSROOT/IDEA_DEV/COPYRIGHT
00006 
00007 #ifndef _H_PLAN_RUNNER
00008 #define _H_PLAN_RUNNER
00009 
00010 #include "ThreadTools.hh" 
00011 
00012 #include "TimeBasics.hh"
00013 #include "Utilities.hh"
00014 
00015 #include "TimeEventHandler.hh"
00016 
00017 namespace IDEA 
00018 {
00019   class AgentRelay;
00020   class AgentTimingService;
00021   class PslDatabase;
00022   class ReactivePlanner;
00023 
00029   class ReactivePlannerRunner:
00030     public ACE_Task_Base,
00031     public TimeEventHandler
00032   {
00033   public:       
00037     ReactivePlannerRunner( const AgentRelay* agentRelay, 
00038                            const AgentTimingService* timingService,
00039                            const PslDatabase* database );
00043     ~ReactivePlannerRunner();
00047     const ReactivePlanner* getReactivePlanner() const;
00051     bool isActive() const;
00055     void run(); 
00059     void stop();
00060   protected:
00064     void handleWakeupCall( const Time&  time );
00068     void handleRebootCall( const Time&  time );
00069   private:
00075     void handleReactivePlanningCycle();
00079     void activate();
00083     void deActivate();
00087     void scheduleNextWakeup() const;
00091     int svc(void);
00095     void sendMessages() const;
00099     ReactivePlannerRunner();
00103     ReactivePlannerRunner(const ReactivePlannerRunner &);
00107     ReactivePlannerRunner & operator=(const ReactivePlannerRunner &);
00108 
00109     typedef ACE_Thread_Mutex MutexLock;
00110     typedef ACE_Thread_Condition< MutexLock > ConditionVariable;
00111 
00112     bool m_Active;
00113     MutexLock m_Mutex;
00114     ConditionVariable* m_StartCondition;
00115     ReactivePlanner* m_ReactivePlanner;
00116     const PslDatabase* m_Database;
00117     const AgentTimingService* m_AgentTimingService;
00118     const AgentRelay* m_AgentRelay;
00119   }; 
00120 
00121 } // namespace IDEA
00122 
00123 #endif //#ifndef _H_PLAN_RUNNER
00124 
00125 //  EOF

Contact information
© IDEA
Generated on Fri Feb 3 17:09:41 2006 for IDEA.