ALBA
|
#include <albaDeviceSet.h>
Public Member Functions | |
ALBA_ID_DEC (DEVICE_ADD) | |
ALBA_ID_DEC (DEVICE_REMOVE) | |
ALBA_ID_DEC (DEVICE_ADDED) | |
ALBA_ID_DEC (DEVICE_REMOVING) | |
albaTypeMacro (albaDeviceSet, albaDevice) | |
virtual void | AddDevice (albaDevice *device) |
albaDevice * | GetDeviceByIndex (int idx) |
albaDevice * | GetDevice (albaID id) |
albaDevice * | GetDevice (const char *name) |
int | GetNumberOfDevices () |
int | RemoveDeviceByIndex (int idx, bool force=false) |
int | RemoveDevice (albaID id, bool force=false) |
int | RemoveDevice (albaDevice *device, bool force=false) |
int | RemoveDevice (const char *name, bool force=false) |
void | RemoveAllDevices (bool force=false) |
virtual void | OnEvent (albaEventBase *event) |
std::list< albaDevice * > * | GetDevices () |
Public Member Functions inherited from albaDevice | |
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) | |
Public Member Functions inherited from albaAgentThreaded | |
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) |
Public Member Functions inherited from albaAgentEventQueue | |
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 () |
Public Member Functions inherited from albaAgent | |
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 () |
Public Member Functions inherited from albaReferenceCounted | |
albaReferenceCounted () | |
virtual | ~albaReferenceCounted () |
albaAbstractTypeMacro (albaReferenceCounted, albaObject) | |
virtual void | Delete () |
void | Register (void *obj) |
virtual void | UnRegister (void *obj) |
int | GetReferenceCount () |
void | SetReferenceCount (int) |
Public Member Functions inherited from albaObject | |
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) | |
Public Member Functions inherited from albaObserver | |
albaObserver () | |
virtual | ~albaObserver () |
virtual void | OnEvent (albaEventBase *e)=0 |
Public Member Functions inherited from albaEventBroadcaster | |
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) |
Public Member Functions inherited from albaEventSender | |
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) |
Public Member Functions inherited from albaStorable | |
albaStorable () | |
int | Store (albaStorageElement *element) |
int | Restore (albaStorageElement *element) |
albaObject * | CastToObject () |
bool | IsStorable () |
Protected Member Functions | |
albaDeviceSet () | |
virtual | ~albaDeviceSet () |
virtual int | InternalStore (albaStorageElement *node) |
virtual int | InternalRestore (albaStorageElement *node) |
virtual int | InternalInitialize () |
virtual void | InternalShutdown () |
Protected Member Functions inherited from albaDevice | |
albaDevice () | |
virtual | ~albaDevice () |
virtual int | InternalInitialize () |
virtual void | CreateGui () |
virtual int | InternalStore (albaStorageElement *node) |
virtual int | InternalRestore (albaStorageElement *node) |
Protected Member Functions inherited from albaAgentThreaded | |
albaAgentThreaded () | |
virtual | ~albaAgentThreaded () |
virtual void | RequestForDispatching () |
void | StopThread () |
virtual int | InternalInitialize () |
virtual void | InternalShutdown () |
virtual int | InternalUpdate () |
int | GetActiveFlag () |
void | SignalNewMessage () |
void | WaitForNewMessage () |
Protected Member Functions inherited from albaAgentEventQueue | |
albaAgentEventQueue () | |
virtual | ~albaAgentEventQueue () |
albaEventBase * | PopEvent () |
int | PopEvent (albaEventBase &event) |
virtual int | PopEvent (albaEventBase *&event) |
bool | GetDispatched () |
void | SetDispatched (bool value=true) |
virtual void | RequestForDispatching () |
Protected Member Functions inherited from albaAgent | |
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 | |
Public Types inherited from albaDevice | |
enum | DEVICE_MINIMUM_ID { MIN_DEVICE_ID =1000000 } |
enum | DEVICE_WIDGET_ID { ID_NAME =MINID , ID_ACTIVATE , ID_SHUTDOWN , ID_AUTO_START , ID_LAST } |
Public Types inherited from albaAgentEventQueue | |
enum | DispatchModalities { SelfProcessMode = 0 , BroadcastMode } |
enum | PopModalities { SingleEventMode = 0 , MultipleEventMode } |
enum | PushModalities { DispatchEventMode =0 , PollingMode } |
Static Public Member Functions inherited from albaObject | |
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 Public Member Functions inherited from albaStorable | |
static albaStorable * | SafeCastToObject (albaObject *o) |
Protected Types inherited from albaEventBroadcaster | |
typedef std::list< albaObserver * > | albaObserversList |
Static Protected Member Functions inherited from albaAgentThreaded | |
static void | UpdateLoop (mmuThreadInfoStruct *data) |
This class manages a set of usb-devices, and stores a list of all child devices' pointers.
It also dispatches some commands to child devices, e.g. initializzation commands. Being also an event queue, this class gathers events coming from all devices (e.g. running on different threads) and serializes their dispatching.
Definition at line 38 of file albaDeviceSet.h.
|
protected |
|
protectedvirtual |
albaDeviceSet::albaTypeMacro | ( | albaDeviceSet | , |
albaDevice | |||
) |
New channel for settings.
New channel for settings
|
virtual |
Add a new device.
If the returned value is false the operation has failed!
albaDevice * albaDeviceSet::GetDeviceByIndex | ( | int | idx | ) |
Return a device in the set given its ID.
albaDevice * albaDeviceSet::GetDevice | ( | albaID | id | ) |
Return a device in the set given its ID.
albaDevice * albaDeviceSet::GetDevice | ( | const char * | name | ) |
Return a device in the set given its name.
int albaDeviceSet::GetNumberOfDevices | ( | ) |
Return the number of devices assigned to this manager.
int albaDeviceSet::RemoveDeviceByIndex | ( | int | idx, |
bool | force = false |
||
) |
Remove a device from the manager's list given its ID.
int albaDeviceSet::RemoveDevice | ( | albaID | id, |
bool | force = false |
||
) |
Remove a device from the manager's list given its ID.
int albaDeviceSet::RemoveDevice | ( | albaDevice * | device, |
bool | force = false |
||
) |
Remove a device from the manager's list.
int albaDeviceSet::RemoveDevice | ( | const char * | name, |
bool | force = false |
||
) |
Remove a device from the manager's list given its name.
void albaDeviceSet::RemoveAllDevices | ( | bool | force = false | ) |
Remove all devices (as as RemoveAllSenders())
|
virtual |
Reimplemented to manage AddDevice event.
Reimplemented from albaDevice.
|
inline |
Return the list of devices pluged into this device set.
Definition at line 99 of file albaDeviceSet.h.
|
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.
Reimplemented from albaDevice.
|
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.
Reimplemented from albaDevice.
|
protectedvirtual |
Initialization automatically initialize subdevices.
Reimplemented from albaDevice.
|
protectedvirtual |
shutdown also subdevices
Reimplemented from albaAgentThreaded.
|
protected |
Definition at line 114 of file albaDeviceSet.h.
|
protected |
Definition at line 116 of file albaDeviceSet.h.