SensorEntity Struct Reference

Inherited by NPL::CNPLSensor.

Inheritance diagram for SensorEntity:

Inheritance graph
[legend]
Collaboration diagram for SensorEntity:

Collaboration graph
[legend]
List of all members.

Detailed Description

Structure: SensorEntity.

Description: Base class for managed Sensor entity in NPL. We allow each entity to have one target address of string type, so that the entity can be easily referenced in NPL network layer through this address. We allow each sensor entity to be associated with only one name, if multiple addresses are assigned to the the sensor entity, the same sensor entities will be referenced. Sensor entity is by default lazily initialized, unless they are called to be initialized.


Public Types

enum  SensorType { original = 0 }

Public Member Functions

virtual SensorType GetType ()
void addref ()
 add reference count of the Sensor.
bool delref ()
 delete reference count of the Sensor.
 SensorEntity (const SensorKey &key)
SensorKeyGetKey ()
virtual HRESULT InitSensorObjects ()
virtual HRESULT DeleteSensorObjects ()
void LoadSensor ()
 load asset.
void UnloadSensor ()
 unload asset.
void GarbageCollectMe ()
 if its reference count is zero, unload this Sensor object.

Public Attributes

SensorKey m_key
bool bIsInitialized


Member Function Documentation

void SensorEntity::addref (  ) 

add reference count of the Sensor.

One may later order the Sensor manager to remove all Sensor whose reference count has dropped to 0

bool SensorEntity::delref (  ) 

delete reference count of the Sensor.

One may later order the Sensor manager to remove all Sensor whose reference count has dropped to 0

Returns:
: return true if the the reference count is zero after decreasing it

void SensorEntity::LoadSensor (  ) 

load asset.

this function will only load the asset if it has not been initialized. since ParaEngine uses lazy loading, it is highly advised that user calls this function as often as possible to ensure that the asset is active; otherwise, they may get invalid resource pointers. Some derived class will call this function automatically, during resource pointer retrieval function. E.g. During each frame render routine, call this function if the asset is used.

void SensorEntity::UnloadSensor (  ) 

unload asset.

Normally this function is called automatically by resource manager. So never call this function manually, unless you really mean it.

void SensorEntity::GarbageCollectMe (  ) 

if its reference count is zero, unload this Sensor object.

any reference holder of this object can call this function to free its resources, if they believe that it will not be needed for quite some time in future.


Generated on Mon Dec 1 14:34:42 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2