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

new_sim_inventory.h

Go to the documentation of this file.
00001 
00021 #ifndef __NEW_SIM_INVENTORY_H__
00022 #define __NEW_SIM_INVENTORY_H__
00023 
00024 
00025 extern "C" {
00026 #include "SaHpi.h"
00027 }
00028 
00029 
00030 #ifndef __NEW_SIM_RDR_H__
00031 #include "new_sim_rdr.h"
00032 #endif
00033 
00034 #ifndef __NEW_SIM_INVENTORY_DATA_H__
00035 #include "new_sim_inventory_data.h"
00036 #endif
00037 
00038 class  NewSimulatorDomain;
00039 
00046 class NewSimulatorInventory : public NewSimulatorRdr {
00047 
00048 private:
00050   SaHpiInventoryRecT        m_inv_rec;
00052   SaHpiIdrInfoT             m_inv_info;
00053   
00055   cArray<NewSimulatorInventoryArea>  m_areas;
00057   SaHpiEntryIdT m_area_id;
00058   
00059 public:
00060   NewSimulatorInventory( NewSimulatorResource *res );
00061   NewSimulatorInventory( NewSimulatorResource *res, SaHpiRdrT rdr );
00062   NewSimulatorInventory( NewSimulatorResource *res,
00063                            SaHpiRdrT rdr,
00064                            SaHpiIdrInfoT inv_info );
00065                       
00066   virtual ~NewSimulatorInventory();
00067 
00068   
00070   virtual unsigned int Num() const { return ( unsigned int ) m_inv_rec.IdrId; }
00071 
00073   SaHpiEntryIdT ValidAreaId() { return ++m_area_id; }
00074 
00076   bool IsReadOnly() { return (bool) m_inv_info.ReadOnly; }
00077 
00079   void IncUpdateCount() { m_inv_info.UpdateCount++; }
00080   
00081   // Find and add Area
00082   NewSimulatorInventoryArea *FindInventoryArea( NewSimulatorInventoryArea *area );
00083   bool AddInventoryArea( NewSimulatorInventoryArea *area );
00084   bool SetData( SaHpiInventoryRecT idrRec );
00085   bool SetInfo( SaHpiIdrInfoT idrInfo );
00086 
00087   // create a RDR record
00088   virtual bool CreateRdr( SaHpiRptEntryT &resource, SaHpiRdrT &rdr );
00089   
00090   // Official HPI functions
00091   SaErrorT  GetIdrInfo( SaHpiIdrInfoT &idrInfo );
00092   SaErrorT  GetAreaHeader( SaHpiIdrAreaTypeT type, SaHpiEntryIdT areaId,
00093                            SaHpiEntryIdT &nextId, SaHpiIdrAreaHeaderT &header);
00094   SaErrorT  AddArea( SaHpiIdrAreaTypeT type, SaHpiEntryIdT &newId );
00095   SaErrorT  AddAreaById( SaHpiIdrAreaTypeT type, SaHpiEntryIdT id );
00096   SaErrorT  DeleteArea( SaHpiEntryIdT id );
00097   
00098   // Identify the correct area and call the HPI functions of the area afterwards
00099   SaErrorT  GetField( SaHpiEntryIdT areaId, SaHpiIdrFieldTypeT fieldType,
00100                       SaHpiEntryIdT fieldId, SaHpiEntryIdT &nextId,
00101                       SaHpiIdrFieldT &field );
00102   SaErrorT  AddField( SaHpiIdrFieldT &field );
00103   SaErrorT  AddFieldById( SaHpiIdrFieldT &field );
00104   SaErrorT  SetField( SaHpiIdrFieldT field );
00105   SaErrorT  DeleteField( SaHpiEntryIdT areaId, SaHpiEntryIdT fieldId );
00106   
00107   
00108   virtual void Dump( NewSimulatorLog &dump ) const;
00109 };
00110 
00111 
00112 #endif

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