1
#ifndef INCLUDED_AUDIOIO_MANAGER_H
2
#define INCLUDED_AUDIOIO_MANAGER_H
10
* Virtual base class for implementing audio object managers.
12
* Key tasks of an object manager are to recognize
13
* AUDIO_IO objects that are of the type it manages,
14
* provide a communication platform for inter-object
15
* communication, and tracking of objects.
17
* Related design patterns:
20
*�@author Kai Vehmanen
22
class AUDIO_IO_MANAGER : public DYNAMIC_OBJECT<std::string> {
26
/** @name Public API */
30
* Object name used to identify the object type. In most
31
* cases, object name is same for all class instances.
32
* Must be implemented in all subclasses.
34
virtual std::string name(void) const = 0;
37
* More verbose description of the manager type.
39
virtual std::string description(void) const = 0;
42
* Whether 'aobj' is of the type handled by this
47
virtual bool is_managed_type(const AUDIO_IO* aobj) const = 0;
50
* Registers a new managed object.
52
* Ownership of the object is not transfered to this
53
* manager object. It's therefore important to release
54
* all managed objects before they are allocated.
55
* Otherwise the manager object could end up referencing
56
* invalid memory regions.
59
* @post is_managed_type(aobj) == true
61
virtual void register_object(AUDIO_IO* aobj) = 0;
64
* Gets an integer id of the registered object 'aobj'.
66
* @return -1 if not a registered object
68
* @pre is_managed_type(aobj) == true
71
virtual int get_object_id(const AUDIO_IO* aobj) const = 0;
74
* Returns a list of all registered object ids.
76
virtual std::list<int> get_object_list(void) const = 0;
79
* Unregisters object identified by 'id'.
81
* @post std::count(get_object_list().begin(), get_object_list().end(), id) == 0
83
virtual void unregister_object(int id) = 0;