ALBA
|
#include <albaDevice.h>
Public Types | |
enum | DEVICE_MINIMUM_ID { MIN_DEVICE_ID =1000000 } |
enum | DEVICE_WIDGET_ID { ID_NAME =MINID , ID_ACTIVATE , ID_SHUTDOWN , ID_AUTO_START , ID_LAST } |
![]() | |
enum | DispatchModalities { SelfProcessMode = 0 , BroadcastMode } |
enum | PopModalities { SingleEventMode = 0 , MultipleEventMode } |
enum | PushModalities { DispatchEventMode =0 , PollingMode } |
Public Member Functions | |
albaTypeMacro (albaDevice, albaAgentThreaded) | |
unsigned long | GetID () |
void | SetID (unsigned long id) |
virtual void | SetName (const char *name) |
void | SetAutoStart (bool flag) |
bool | GetAutoStart () |
void | AutoStartOn () |
void | AutoStartOff () |
virtual int | Start () |
virtual void | Stop () |
virtual int | StartUp () |
void | SetPersistentFlag (bool flag) |
bool | GetPersistentFlag () |
bool | IsPersistent () |
albaGUI * | GetGui () |
virtual void | UpdateGui () |
virtual void | OnEvent (albaEventBase *event) |
ALBA_ID_DEC (DEVICE_STARTED) | |
ALBA_ID_DEC (DEVICE_STOPPED) | |
![]() | |
ALBA_ID_DEC (AGENT_ASYNC_DISPATCH) | |
albaTypeMacro (albaAgentThreaded, albaAgentEventQueue) | |
int | GetThreaded () |
void | SetThreaded (int flag) |
int | Update () |
virtual void | OnEvent (albaEventBase *event) |
void | AsyncSendEvent (albaObserver *target, albaEventBase *event, albaID channel=MCH_UP) |
void | AsyncSendEvent (albaObserver *target, void *sender, albaID id, albaID channel=MCH_UP, void *data=NULL) |
void | AsyncInvokeEvent (albaEventBase *event, albaID channel=MCH_UP) |
void | AsyncInvokeEvent (albaID id, albaID channel=MCH_UP, void *data=NULL) |
![]() | |
ALBA_ID_DEC (EVENT_DISPATCH) | |
albaTypeMacro (albaAgentEventQueue, albaAgent) | |
bool | PushEvent (albaEventBase &event) |
virtual bool | PushEvent (albaEventBase *event) |
bool | PushEvent (albaID event_id, void *sender, void *data=NULL) |
albaEventBase * | PeekEvent () |
albaEventBase * | PeekLastEvent () |
int | GetQueueSize () |
bool | IsQueueEmpty () |
virtual bool | DispatchEvents () |
void | SetDequeueMode (int mode) |
int | GetDequeueMode () |
void | SetDequeueModeToMultipleEvent () |
void | SetDequeueModeToSingleEvent () |
void | SetDispatchMode (int mode) |
int | GetDispatchMode () |
void | SetDispatchModeToSelfProcess () |
void | SetDispatchModeToBroadcast () |
void | SetPushMode (int mode) |
int | GetPushMode () |
void | SetPushModeToDispatchEvent () |
void | SetPushModeToPolling () |
![]() | |
albaAbstractTypeMacro (albaAgent, albaReferenceCounted) | |
ALBA_ID_DEC (AGENT_INITIALIZE) | |
void | AddObserver (albaObserver *listener, albaID channel=MCH_UP) |
void | RemoveObserver (albaObserver *listener) |
void | RemoveAllObservers () |
virtual void | OnEvent (albaEventBase *event) |
bool | HasObservers (albaID channel) |
void | GetObservers (albaID channel, std::vector< albaObserver * > &olist) |
int | Initialize () |
void | Shutdown () |
int | IsInitialized () |
virtual void | SetName (const char *name) |
const char * | GetName () |
![]() | |
albaReferenceCounted () | |
virtual | ~albaReferenceCounted () |
albaAbstractTypeMacro (albaReferenceCounted, albaObject) | |
virtual void | Delete () |
void | Register (void *obj) |
virtual void | UnRegister (void *obj) |
int | GetReferenceCount () |
void | SetReferenceCount (int) |
![]() | |
albaObject () | |
virtual | ~albaObject () |
virtual void | Delete () |
virtual const char * | GetTypeName () const |
virtual bool | IsA (const char *type_name) const |
virtual bool | IsA (const albaTypeID &type_id) const |
virtual albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () const |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObject (const albaObject &c) | |
![]() | |
albaObserver () | |
virtual | ~albaObserver () |
virtual void | OnEvent (albaEventBase *e)=0 |
![]() | |
albaEventBroadcaster (void *owner=NULL) | |
virtual | ~albaEventBroadcaster () |
albaEventBroadcaster (const albaEventBroadcaster &c) | |
void | AddObserver (albaObserver *obj) |
void | AddObserver (albaObserver &obj) |
albaObserverCallback * | AddObserverCallback (void(*f)(void *sender, albaID eid, void *clientdata, void *calldata)) |
bool | RemoveObserver (albaObserver *obj) |
void | RemoveAllObservers () |
bool | IsObserver (albaObserver *obj) |
bool | HasObservers () |
void | GetObservers (std::vector< albaObserver * > &olist) |
void | InvokeEvent (albaEventBase &e) |
void | InvokeEvent (albaEventBase *e) |
void | InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL) |
void | SetChannel (albaID ch) |
albaID | GetChannel () |
virtual void | SetListener (albaObserver *o) |
![]() | |
albaEventSender () | |
virtual void | SetListener (albaObserver *o) |
virtual albaObserver * | GetListener () |
virtual bool | HasListener () |
virtual void | InvokeEvent (albaEventBase &e) |
virtual void | InvokeEvent (albaEventBase *e) |
virtual void | InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL) |
![]() | |
albaStorable () | |
int | Store (albaStorageElement *element) |
int | Restore (albaStorageElement *element) |
albaObject * | CastToObject () |
bool | IsStorable () |
Protected Member Functions | |
albaDevice () | |
virtual | ~albaDevice () |
virtual int | InternalInitialize () |
virtual void | CreateGui () |
virtual int | InternalStore (albaStorageElement *node) |
virtual int | InternalRestore (albaStorageElement *node) |
![]() | |
albaAgentThreaded () | |
virtual | ~albaAgentThreaded () |
virtual void | RequestForDispatching () |
void | StopThread () |
virtual int | InternalInitialize () |
virtual void | InternalShutdown () |
virtual int | InternalUpdate () |
int | GetActiveFlag () |
void | SignalNewMessage () |
void | WaitForNewMessage () |
![]() | |
albaAgentEventQueue () | |
virtual | ~albaAgentEventQueue () |
albaEventBase * | PopEvent () |
int | PopEvent (albaEventBase &event) |
virtual int | PopEvent (albaEventBase *&event) |
bool | GetDispatched () |
void | SetDispatched (bool value=true) |
virtual void | RequestForDispatching () |
![]() | |
albaAgent () | |
virtual | ~albaAgent () |
virtual int | InternalInitialize () |
virtual void | InternalShutdown () |
void | InvokeEvent (albaEventBase &event, albaID channel=-1) |
void | InvokeEvent (albaEventBase *event, albaID channel=-1) |
void | InvokeEvent (void *sender, int id, albaID channel=MCH_UP, void *data=NULL) |
virtual int | InternalStore (albaStorageElement *node)=0 |
virtual int | InternalRestore (albaStorageElement *node)=0 |
Additional Inherited Members | |
![]() | |
static const char * | GetStaticTypeName () |
static bool | IsStaticType (const char *type_name) |
static bool | IsStaticType (const albaTypeID &type_id) |
static const albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
![]() | |
static albaStorable * | SafeCastToObject (albaObject *o) |
![]() | |
typedef std::list< albaObserver * > | albaObserversList |
![]() | |
static void | UpdateLoop (mmuThreadInfoStruct *data) |
This abstract class manages function calls coming from devices and issue specific events to interactors.
Usually all evetns sent by devices are synchronized with the application by sending a request for dispatching to the device manager. Devices are typically managed by the device manager object, whose responsible for keeping a list of the allocated devices, storing this list and all devices configurations, and restoring all devices from a saved file. Devices are devided in two cathegories, persistent and non persistent. The first ones are not saved and restored, but have a life span corresponding to the application's one.
Definition at line 39 of file albaDevice.h.
non persistent device IDs start from ALBA_MIN_DEVICE_ID.
This means I cannot have more then MIN_DEVICE_ID persistent devices (i.e. devices defined by application, e.g. Mouse and remote devices...)
Enumerator | |
---|---|
MIN_DEVICE_ID |
Definition at line 45 of file albaDevice.h.
Enumerator | |
---|---|
ID_NAME | |
ID_ACTIVATE | |
ID_SHUTDOWN | |
ID_AUTO_START | |
ID_LAST |
Definition at line 60 of file albaDevice.h.
|
protected |
|
protectedvirtual |
albaDevice::albaTypeMacro | ( | albaDevice | , |
albaAgentThreaded | |||
) |
|
inline |
Get the ID for this device.
This is usually set by albaDeviceSet
Definition at line 73 of file albaDevice.h.
|
inline |
Set ID for this device.
This is usually set by albaDeviceSet
Definition at line 77 of file albaDevice.h.
|
virtual |
Set the Device name and rise an event to advise consumers.
Reimplemented from albaAgent.
|
inline |
Set the AutoStart flag.
This makes the device automatically restart net time the application is started
Definition at line 84 of file albaDevice.h.
|
inline |
Definition at line 85 of file albaDevice.h.
|
inline |
Enable autostarting of this device.
Definition at line 89 of file albaDevice.h.
|
inline |
Disable autostarting of this device.
Definition at line 93 of file albaDevice.h.
|
virtual |
use this function to start (initialize) the device
|
virtual |
use this function to stop (shutdown) the device
|
inlinevirtual |
This checks AutoStart flag and if true Initialize the device Return false if AutoStart is OFF or initialization failed.
Definition at line 104 of file albaDevice.h.
|
inline |
set peristent flag: a persistent device is not stored/restored and neither removed when settings are loaded from disk.
It's created by application logic and not by user! Example of persistent devices are mouse and remote devices
Definition at line 111 of file albaDevice.h.
|
inline |
Definition at line 112 of file albaDevice.h.
|
inline |
return true if it's a persistent device.
Definition at line 115 of file albaDevice.h.
albaGUI * albaDevice::GetGui | ( | ) |
Return pointer to the GUI.
|
virtual |
used to force Gui to update its content
Reimplemented in albaDeviceButtonsPadTracker.
|
virtual |
process events sent to the device
Reimplemented from albaAgentThreaded.
Reimplemented in albaDeviceButtonsPadMouse, albaDeviceButtonsPadTracker, and albaDeviceSet.
|
protectedvirtual |
start device
Reimplemented from albaAgentThreaded.
Reimplemented in albaDeviceButtonsPadTracker, albaDeviceButtonsPadTrackerP5Glove, albaDeviceSet, and albaDeviceTrackerWIIMote.
|
protectedvirtual |
Create the dialog that show the interface for settings.
Reimplemented in albaDeviceButtonsPadTracker.
|
protectedvirtual |
This is used to allow nested serialization of subclasses.
This function is called by Store and is reimplemented in subclasses. Each subclass can store its own subelements which are closed inside the "Device" element. Reimplemented functions should first call Superclass implementation.
Implements albaStorable.
Reimplemented in albaDeviceButtonsPadTracker, and albaDeviceSet.
|
protectedvirtual |
This function fills in the device with settings restored from the node.
Subclasses should reimplement it to restore custom settings. Reimplemented functions should first call Superclass implementation.
Implements albaStorable.
Reimplemented in albaDeviceButtonsPadTracker, and albaDeviceSet.
|
protected |
Definition at line 150 of file albaDevice.h.
|
protected |
Definition at line 151 of file albaDevice.h.
|
protected |
Definition at line 152 of file albaDevice.h.
|
protected |
Definition at line 153 of file albaDevice.h.
|
protected |
Definition at line 154 of file albaDevice.h.
|
protected |
Definition at line 155 of file albaDevice.h.