ALBA
albaInteractorSER.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaInteractorSER
5 Authors: Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaInteractorSER_h
17#define __albaInteractorSER_h
18
19#include "albaInteractor.h"
20#include "albaAction.h"
21#include "albaStorable.h"
22#include <map>
23
24//----------------------------------------------------------------------------
25// forward declarations
26//----------------------------------------------------------------------------
27class albaDevice;
28class albaString;
29
42class ALBA_EXPORT albaInteractorSER : public albaInteractor, public albaStorable
43{
44public:
46
50 void BindDeviceToAction(albaDevice *device,const char *action_name);
54 void UnBindDeviceFromAction(albaDevice *device,const char *action_name);
57
59 void GetDeviceBindings(albaDevice *device,std::vector<albaAction *> &actions);
63 int BindAction(const char *action,albaInteractor *agent);
67 int UnBindAction(const char *action,albaInteractor *agent);
68
70 albaAction *AddAction(const char *name, float priority = 0.0, int type = albaAction::SHARED_ACTION);
71 void AddAction(albaAction *action, float priority = 0.0);
72
74 albaAction *GetAction(const char *name);
75
76 typedef std::map<albaString,albaAutoPointer<albaAction> > mmuActionsMap;
77
79 void GetActions(std::vector<albaAction *> &actions);
80 const mmuActionsMap *GetActions() {return &m_Actions;}
81
82protected:
85
88
90
91private:
92 albaInteractorSER(const albaInteractorSER&); // Not implemented.
93 void operator=(const albaInteractorSER&); // Not implemented.
94};
95
96#endif
Class used to route events from devices to interactors.
Definition: albaAction.h:35
@ SHARED_ACTION
Definition: albaAction.h:46
This abstract class manages function calls coming from devices and issue specific events to interacto...
Definition: albaDevice.h:40
Class implementing static routing from devices to interactors passing through actions.
virtual int InternalStore(albaStorageElement *node)
This is called by Store() and must be reimplemented by subclasses.
albaAction * GetAction(const char *name)
Get an action router.
void GetDeviceBindings(albaDevice *device, std::vector< albaAction * > &actions)
return list of device bindings to actions
albaTypeMacro(albaInteractorSER, albaInteractor)
void BindDeviceToAction(albaDevice *device, const char *action_name)
Un/Bind a device to an action.
albaAction * AddAction(const char *name, float priority=0.0, int type=albaAction::SHARED_ACTION)
Define a new action router.
virtual int InternalRestore(albaStorageElement *node)
This is called by Restore() and must be reimplemented by subclasses The element from which the object...
const mmuActionsMap * GetActions()
void UnBindDeviceFromAction(albaDevice *device, const char *action_name)
Un/Bind a device to an action.
void GetActions(std::vector< albaAction * > &actions)
Return the actions container.
mmuActionsMap m_Actions
takes a list of the active actions
void BindDeviceToAction(albaDevice *device, albaAction *action)
Un/Bind a device to an action.
int UnBindAction(const char *action, albaInteractor *agent)
Unbind an agent from the specified action.
void UnBindDeviceFromAction(albaDevice *device, albaAction *action)
Un/Bind a device to an action.
void UnBindDeviceFromAllActions(albaDevice *device)
Unbind a device from all actions: used when a device is removed.
void AddAction(albaAction *action, float priority=0.0)
virtual ~albaInteractorSER()
std::map< albaString, albaAutoPointer< albaAction > > mmuActionsMap
int BindAction(const char *action, albaInteractor *agent)
Bind an agent to the specified action.
Abstract class for ALBA interactors This class provides base interface and features of ALBA continuou...
albaStorable is an interface for serializable objects.
Definition: albaStorable.h:41
Abstract class representing the interface for the unit of information stored in the storage.
albaString - performs common string operations on c-strings.
Definition: albaString.h:43