Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

new_sim_hotswap.h

Go to the documentation of this file.
00001 
00020 #ifndef __NEW_SIM_HOTSWAP_H__
00021 #define __NEW_SIM_HOTSWAP_H__
00022 
00023 #include <openhpi.h>
00024 #include <oh_utils.h>
00025 
00026 #ifndef __NEW_SIM_UTILS_H__
00027 #include "new_sim_utils.h"
00028 #endif
00029 
00030 #ifndef __NEW_SIM_TIMER_THREAD_H__
00031 #include "new_sim_timer_thread.h"
00032 #endif
00033 
00034 extern "C" {
00035 #include "SaHpi.h"
00036 }
00037 
00038 class NewSimulatorResource;
00039 class NewSimulatorLog;
00040 class NewSimulatorTimerThread;
00041 
00047 class NewSimulatorHotSwap : public NewSimulatorTimerThread {
00048 private:
00050    SaHpiTimeoutT           m_insert_time;
00052    SaHpiTimeoutT           m_extract_time;
00054    cTime                   m_start;
00056    bool                   m_running;
00058    SaHpiHsStateT           m_state;
00060    NewSimulatorResource    *m_res;
00061    
00062    SaErrorT TriggerTransition( SaHpiHsStateT state );
00063    void SendEvent( SaHpiHsStateT newState, SaHpiHsStateT prevState, 
00064                     SaHpiHsCauseOfStateChangeT cause, SaHpiSeverityT severity );
00065      
00066    
00067 protected:
00068     virtual bool TriggerAction();
00069       
00070 public:
00071    NewSimulatorHotSwap( NewSimulatorResource *res );
00072    NewSimulatorHotSwap( NewSimulatorResource *res, SaHpiTimeoutT insertTime,
00073                         SaHpiTimeoutT extractTime, SaHpiHsStateT startState );
00074   ~NewSimulatorHotSwap();
00075 
00076   // Dump 
00077   void Dump( NewSimulatorLog &dump ) const;
00079   SaHpiHsStateT GetState() { return m_state; }
00081   SaHpiTimeoutT GetExtractTimeout() { return m_extract_time; }
00082   
00083   // Start a resource
00084   SaErrorT StartResource( oh_event *e );
00085   // Set the timeout values
00086   void SetTimeouts( SaHpiTimeoutT insert, SaHpiTimeoutT extract );
00087   
00088   // HPI functions
00089   SaErrorT CancelPolicy();
00090   SaErrorT SetActive();
00091   SaErrorT SetInactive();
00092   SaErrorT GetExtractTimeout(SaHpiTimeoutT &timeout);
00093   SaErrorT SetExtractTimeout(SaHpiTimeoutT timeout);
00094   SaErrorT GetState( SaHpiHsStateT &state );
00095   SaErrorT ActionRequest( SaHpiHsActionT action );
00096   
00097 };
00098 
00099 
00100 #endif

Generated on Mon Apr 26 14:36:48 2010 for New Simulator by  doxygen 1.4.4