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

NewSimulatorSensor Class Reference

Abstract class for simulating sensors. More...

#include <new_sim_sensor.h>

Inheritance diagram for NewSimulatorSensor:

Inheritance graph
[legend]
Collaboration diagram for NewSimulatorSensor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NewSimulatorSensor (NewSimulatorResource *res)
 Constructor.
 NewSimulatorSensor (NewSimulatorResource *res, SaHpiRdrT rdr, SaHpiSensorReadingT data, SaHpiEventStateT event_state, SaHpiEventStateT event_amask, SaHpiEventStateT event_dmask, SaHpiBoolT enabled, SaHpiBoolT event_enabled)
 Full qualified constructor to fill an object with the parsed data.
virtual ~NewSimulatorSensor ()
 Destructor.
virtual unsigned int Num () const
 Return sensor Number.
SaHpiSensorTypeT Type () const
 Return Sensor Type.
SaHpiEventCategoryT EventCategory () const
 Return Sensor Event Category.
SaHpiBoolT EnableCtrl () const
 Return if Sensor is enabbled or not.
SaHpiSensorEventCtrlT EventCtrl () const
 Return the event change capability of the sensor.
SaHpiEventStateT EventStates () const
 Return Sensor Event States.
SaHpiSensorDataFormatT DataFormat () const
 Return Sensor Data Format.
SaHpiSensorThdDefnT ThresholdDefn () const
 Return Sensor Threshold definitions.
SaHpiUint32T Oem () const
 Return Sensor Oem information.
virtual void HandleNew (NewSimulatorDomain *domain)
 Not clear if this function is really needed.
virtual bool Cmp (const NewSimulatorSensor &s2) const
 Not implemented - to be verified if needed.
void CreateEnableChangeEvent ()
 create and send HPI sensor enable change event
virtual void Dump (NewSimulatorLog &dump) const
 Dump the sensor information.
virtual bool CreateRdr (SaHpiRptEntryT &resource, SaHpiRdrT &rdr)
 create an RDR sensor record
virtual SaErrorT GetSensorReading (SaHpiSensorReadingT &data, SaHpiEventStateT &state)=0
 abstract method for the GetSensorReading command
SaErrorT GetEnable (SaHpiBoolT &enable)
 HPI function saHpiSensorEnableGet().
SaErrorT GetEventEnables (SaHpiBoolT &enables)
 HPI function saHpiSensorEventEnableGet().
SaErrorT GetEventMasks (SaHpiEventStateT &AssertEventMask, SaHpiEventStateT &DeassertEventMask)
 HPI function saHpiSensorEventMasksGet().
SaErrorT SetEnable (const SaHpiBoolT &enable)
 HPI function saHpiSensorEnableSet().
SaErrorT SetEventEnables (const SaHpiBoolT &enables)
 HPI function saHpiSensorEventEnableSet().
SaErrorT SetEventMasks (const SaHpiSensorEventMaskActionT &act, SaHpiEventStateT &AssertEventMask, SaHpiEventStateT &DeassertEventMask)
 HPI function saHpiSensorEventMasksSet().

Protected Member Functions

virtual bool gt (const SaHpiSensorReadingT &val1, const SaHpiSensorReadingT &val2)
 Check if val1 > val2.
virtual bool ge (const SaHpiSensorReadingT &val1, const SaHpiSensorReadingT &val2)
 Check if val1 >= val2.
virtual bool lt (const SaHpiSensorReadingT &val1, const SaHpiSensorReadingT &val2)
 Check if val1 < val2.
virtual bool le (const SaHpiSensorReadingT &val1, const SaHpiSensorReadingT &val2)
 Check if val1 <= val2.
virtual bool eq (const SaHpiSensorReadingT &val1, const SaHpiSensorReadingT &val2)
 Check if val1 == val2.
virtual bool ltZero (const SaHpiSensorReadingT &val1)
 Check if val1 < 0.

Protected Attributes

SaHpiSensorRecT m_sensor_record
 Record with the sensor information.
SaHpiBoolT m_enabled
 Is this sensor enabled.
SaHpiBoolT m_events_enabled
 Are events from this sensor enabled.
SaHpiBoolT m_read_support
 Is the reading supported.
SaHpiEventStateT m_assert_mask
 Events assertion mask.
SaHpiEventStateT m_deassert_mask
 Events deassertion mask.
SaHpiSensorReadingT m_read_data
 SensorReading values.
SaHpiEventStateT m_event_data
 EventState.

Detailed Description

Abstract class for simulating sensors.


Member Function Documentation

bool NewSimulatorSensor::Cmp const NewSimulatorSensor s2  )  const [virtual]
 

Not implemented - to be verified if needed.

if ( m_entity_path != s2.m_entity_path ) return false;

if ( m_sensor_init_scanning != s2.m_sensor_init_scanning ) return false;

if ( m_sensor_init_events != s2.m_sensor_init_events ) return false;

if ( m_sensor_init_type != s2.m_sensor_init_type ) return false;

if ( m_sensor_init_pu_events != s2.m_sensor_init_pu_events ) return false;

if ( m_sensor_init_pu_scanning != s2.m_sensor_init_pu_scanning ) return false;

if ( m_ignore_if_no_entity != s2.m_ignore_if_no_entity ) return false;

if ( m_supports_auto_rearm != s2.m_supports_auto_rearm ) return false;

if ( m_event_support != s2.m_event_support ) return false;

if ( m_sensor_type != s2.m_sensor_type ) return false;

if ( m_event_reading_type != s2.m_event_reading_type ) return false;

if ( m_oem != s2.m_oem ) return false;

if ( IdString() != s2.IdString() ) return false;

Reimplemented in NewSimulatorSensorThreshold.

bool NewSimulatorSensor::CreateRdr SaHpiRptEntryT &  resource,
SaHpiRdrT &  rdr
[virtual]
 

create an RDR sensor record

This method is called by method NewSimulatorRdr::Populate().

Parameters:
resource Address of resource structure
rdr Address of rdr structure
Returns:
true

Reimplemented from NewSimulatorRdr.

Reimplemented in NewSimulatorSensorCommon, and NewSimulatorSensorThreshold.

void NewSimulatorSensor::Dump NewSimulatorLog dump  )  const [virtual]
 

Dump the sensor information.

Parameters:
dump Address of the log

Implements NewSimulatorRdr.

Reimplemented in NewSimulatorSensorCommon, and NewSimulatorSensorThreshold.

bool NewSimulatorSensor::eq const SaHpiSensorReadingT &  val1,
const SaHpiSensorReadingT &  val2
[protected, virtual]
 

Check if val1 == val2.

Parameters:
val1 SensorReading
val2 SensorReading
Returns:
false also in error case

bool NewSimulatorSensor::ge const SaHpiSensorReadingT &  val1,
const SaHpiSensorReadingT &  val2
[protected, virtual]
 

Check if val1 >= val2.

Parameters:
val1 SensorReading
val2 SensorReading
Returns:
false also in error case

SaErrorT NewSimulatorSensor::GetEnable SaHpiBoolT &  enable  ) 
 

HPI function saHpiSensorEnableGet().

See also the description of the function inside the specification or header file. Copying the internal reading values (if a read is allowed).

Parameters:
enable address of enable return value
Returns:
HPI return code

SaErrorT NewSimulatorSensor::GetEventEnables SaHpiBoolT &  enables  ) 
 

HPI function saHpiSensorEventEnableGet().

See also the description of the function inside the specification or header file. Copying the internal reading values (if a read is allowed).

Parameters:
enables address of event enable return value
Returns:
HPI return code

SaErrorT NewSimulatorSensor::GetEventMasks SaHpiEventStateT &  AssertEventMask,
SaHpiEventStateT &  DeassertEventMask
 

HPI function saHpiSensorEventMasksGet().

See also the description of the function inside the specification or header file. Copying the internal reading values (if a read is allowed).

Parameters:
AssertEventMask address of mask to be filled with assertion mask
DeassertEventMask address of mask to be filled with deassertion mask
Returns:
HPI return code

bool NewSimulatorSensor::gt const SaHpiSensorReadingT &  val1,
const SaHpiSensorReadingT &  val2
[protected, virtual]
 

Check if val1 > val2.

Parameters:
val1 SensorReading
val2 SensorReading
Returns:
false also in error case

bool NewSimulatorSensor::le const SaHpiSensorReadingT &  val1,
const SaHpiSensorReadingT &  val2
[protected, virtual]
 

Check if val1 <= val2.

Parameters:
val1 SensorReading
val2 SensorReading
Returns:
false also in error case

bool NewSimulatorSensor::lt const SaHpiSensorReadingT &  val1,
const SaHpiSensorReadingT &  val2
[protected, virtual]
 

Check if val1 < val2.

Parameters:
val1 SensorReading
val2 SensorReading
Returns:
false also in error case

bool NewSimulatorSensor::ltZero const SaHpiSensorReadingT &  val1  )  [protected, virtual]
 

Check if val1 < 0.

Parameters:
val1 SensorReading
Returns:
return false also in error case

SaErrorT NewSimulatorSensor::SetEnable const SaHpiBoolT &  enable  ) 
 

HPI function saHpiSensorEnableSet().

See also the description of the function inside the specification or header file. Copying the internal reading values (if a read is allowed).

Parameters:
enable address of enable value to be set internally
Returns:
HPI return code

SaErrorT NewSimulatorSensor::SetEventEnables const SaHpiBoolT &  enables  ) 
 

HPI function saHpiSensorEventEnableSet().

See also the description of the function inside the specification or header file. Copying the internal reading values (if a read is allowed).

Parameters:
enables address of event enable value to be set internally
Returns:
HPI return code

SaErrorT NewSimulatorSensor::SetEventMasks const SaHpiSensorEventMaskActionT &  act,
SaHpiEventStateT &  AssertEventMask,
SaHpiEventStateT &  DeassertEventMask
 

HPI function saHpiSensorEventMasksSet().

See also the description of the function inside the specification or header file. Copying the internal reading values (if a read is allowed).

Parameters:
act address of variable which includes the action to be done
AssertEventMask address of variable which include new assertion mask data
DeassertEventMask address of variable which include new deassertion mask data
Returns:
HPI return code


The documentation for this class was generated from the following files:
Generated on Mon Apr 26 14:39:44 2010 for New Simulator by  doxygen 1.4.4