NuiLib-Full
Utility Library for working with NUI devices.
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
NuiLib::INuiFactory Class Reference

The interface for factory classes which instantiate NuiLib objects. More...

#include <NuiLib-API.h>

Inheritance diagram for NuiLib::INuiFactory:
NuiLib::IObservable NuiLib::INuiFactoryExtension NuiLib::KinectFactory TestFactory

Public Member Functions

virtual ~INuiFactory ()
 Delete all components this factory created.
virtual bool Init ()=0
 Initialise the factory.
virtual void SetAutoPoll (bool)=0
 Set whether the factory auto polls.
virtual bool GetAutoPoll ()=0
 Get whether the factory auto polls.
virtual void Poll ()=0
 Force the factory to poll the Nui device for new data.
virtual Scalar GetScalar (string name)=0
 Look up a Scalar from its name.
virtual Condition GetCondition (string name)=0
 Look up a Condition from its name.
virtual Vector GetVector (string name)=0
 Look up a Vector from its name.
virtual string ToXML ()=0
 Write all components created by this factory, and their relationships, to XML.
virtual void LoadXML (string xml)=0
 Initialise the factory based on an XML string.
virtual void ** GetNuiDevices ()=0
 Get an array of pointers to the actual NUI devices that are powering the system.
- Public Member Functions inherited from NuiLib::IObservable
void AddListener (function< void(IObservable *)> listener)
 Add a listener that will called whenever the observabled changes.

Protected Member Functions

 INuiFactory (string type, string name)
 Initialise the factory.
- Protected Member Functions inherited from NuiLib::IObservable
virtual ~IObservable ()
void Trigger ()
 Trigger this observable.

Detailed Description

The interface for factory classes which instantiate NuiLib objects.

Contains generic template code which can instantiate any classes with the correct format. Deals with Vectors, Scalars and Conditions. Also provides some extra control over how polling is done.


Constructor & Destructor Documentation

NuiLib::INuiFactory::INuiFactory ( string  type,
string  name 
)
inlineprotected

Initialise the factory.

Specifies the type of the factory and its name.

Parameters:
typeThe type of factory this is.
nameThe name of this factory.
INuiFactory::~INuiFactory ( )
virtual

Delete all components this factory created.


Member Function Documentation

virtual bool NuiLib::INuiFactory::GetAutoPoll ( )
pure virtual

Get whether the factory auto polls.

If true the factory will automatically update all entities it has regstered whenever the Nui device sends and update or only update them when the Poll method is called.

Parameters:
valueTrue to auto poll. False to only poll when the method is called.
See also:
Poll
SetAutoPoll

Implemented in NuiLib::KinectFactory, and TestFactory.

virtual Condition NuiLib::INuiFactory::GetCondition ( string  name)
pure virtual

Look up a Condition from its name.

Designed to be used after a call to LoadFromXML. LoadFromXML imports a series of components. GetCondition then gets a given condition. If no scalar is found with the given name a zero Condition is returned.

Implemented in NuiLib::INuiFactoryExtension.

virtual void** NuiLib::INuiFactory::GetNuiDevices ( )
pure virtual

Get an array of pointers to the actual NUI devices that are powering the system.

Depending on which factory implementation is linked the actual devices returned will be different.

Implemented in NuiLib::KinectFactory.

virtual Scalar NuiLib::INuiFactory::GetScalar ( string  name)
pure virtual

Look up a Scalar from its name.

Designed to be used after a call to LoadFromXML. LoadFromXML imports a series of components. GetScalar then gets a given scalar. If no scalar is found with the given name a zero Scalar is returned.

Implemented in NuiLib::INuiFactoryExtension.

virtual Vector NuiLib::INuiFactory::GetVector ( string  name)
pure virtual

Look up a Vector from its name.

Designed to be used after a call to LoadFromXML. LoadFromXML imports a series of components. GetVector then gets a given vector. If no vector is found with the given name a zero Vector is returned.

Implemented in NuiLib::INuiFactoryExtension.

virtual bool NuiLib::INuiFactory::Init ( )
pure virtual

Initialise the factory.

Any logic to do with starting up the factory should go here.

Implemented in NuiLib::KinectFactory, and TestFactory.

virtual void NuiLib::INuiFactory::LoadXML ( string  xml)
pure virtual

Initialise the factory based on an XML string.

Not currently implemented.

Parameters:
xmlThe XML string to load.

Implemented in NuiLib::INuiFactoryExtension, and NuiLib::KinectFactory.

virtual void NuiLib::INuiFactory::Poll ( )
pure virtual

Force the factory to poll the Nui device for new data.

When the device has been polled all entities which take data from the device will be updated. If AutoPoll is false calling this method is the only time the device will be polled.

See also:
SetAutoPoll

Implemented in NuiLib::KinectFactory, and TestFactory.

virtual void NuiLib::INuiFactory::SetAutoPoll ( bool  )
pure virtual

Set whether the factory auto polls.

If true the factory will automatically update all entities it has created whenever the Nui device sends and update or only update them when the Poll method is called.

Parameters:
valueTrue to auto poll. False to only poll when the method is called.
See also:
Poll
GetAutoPoll

Implemented in NuiLib::KinectFactory, and TestFactory.

virtual string NuiLib::INuiFactory::ToXML ( )
pure virtual

Write all components created by this factory, and their relationships, to XML.

Not currently implemented.

Implemented in NuiLib::INuiFactoryExtension, and NuiLib::KinectFactory.


The documentation for this class was generated from the following files: