00001 #ifndef PHASEMANAGER_I_H 00002 #define PHASEMANAGER_I_H 00003 00004 #include "phases.hh" 00005 #include "Phase_i.h" 00006 #include <deque> 00007 00008 using namespace std; 00009 00011 typedef struct PhaseEntry { 00013 pid_t pid; 00015 time_t timeOffset; 00016 phases::dPhase_var phasevar; 00017 phases::PhaseStatus phasestat; 00018 } phaseentry; 00019 00026 class PhaseManager_i : public POA_phases::PhaseManager,public PortableServer::RefCountServantBase { 00027 public: 00029 PhaseManager_i(CORBA::ORB_var orb); 00031 virtual ~PhaseManager_i(); 00033 virtual CORBA::Short getGracePeriod(); 00035 virtual void setGracePeriod(CORBA::Short sec); 00040 virtual void add(phases::dPhase_ptr dpv,CORBA::Long pid, 00041 const common::ClientData& cd); 00043 virtual CORBA::Short getNphase(); 00045 virtual phases::PhaseManager::StatSeq* getStatus(); 00048 virtual double getLoad(CORBA::Short p); 00050 virtual CORBA::Long getFreeMemory(); 00052 virtual CORBA::Long getAllocatedMemory(); 00054 virtual void update(); 00057 virtual void remove(CORBA::Long i); 00060 virtual void apoptosize(CORBA::Long i); 00062 int verbose; 00063 00064 private: 00066 CORBA::ORB_var orb; 00068 int gracePeriod; 00070 static int identifier; 00072 deque <PhaseEntry> phaselist; 00075 PhaseEntry *getEntry(CORBA::Long i); 00076 }; 00077 #endif