diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp index 58f2f0433..efb572c69 100644 --- a/src/lib/scoped-collection.hpp +++ b/src/lib/scoped-collection.hpp @@ -92,7 +92,7 @@ namespace lib { * * All child objects reside in a common chunk of storage * and are owned and managed by this collection holder. - * Array style access and iteration. + * Array style access and iteration is provided. */ template < class I ///< the nominal Base/Interface class for a family of types diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp index ed61ef864..b6b22658a 100644 --- a/src/proc/play/output-slot-connection.hpp +++ b/src/proc/play/output-slot-connection.hpp @@ -110,8 +110,8 @@ namespace play { virtual void discard (BuffHandle const&) =0; virtual void shutDown () =0; }; - - + + /** * Extension point for Implementation. @@ -131,7 +131,22 @@ namespace play { }; - /** + + + /* ===== Building blocks for OutputSlot implementation ===== */ + + /** Base for OutputSlot standard implementation */ + class OutputSlotImplBase + : public OutputSlot + { + protected: + template + class ConnectionManager; + }; + + + /** + * Maintaining a list of active connections. * Base class for the typical implementation approach. * Using this class is \em not mandatory. But obviously, * we'd get to manage a selection of Connection objects @@ -148,7 +163,7 @@ namespace play { * manages a collection of active Connection subclass objects. */ template - class ConnectionStateManager + class OutputSlotImplBase::ConnectionManager : public OutputSlot::ConnectionState { typedef lib::ScopedCollection Connections; @@ -172,7 +187,7 @@ namespace play { { UNIMPLEMENTED ("find out about timing constraints"); //////////////////////////TICKET #831 } - + bool isActive() const { @@ -191,7 +206,7 @@ namespace play { init() ///< derived classes need to invoke this to build the actual connections { //////////////////////////TICKET #878 really build all at once? or on demand? - connections_.populate_by (&ConnectionStateManager::buildConnection, this); + connections_.populate_by (&ConnectionManager::buildConnection, this); } typedef typename Connections::ElementHolder& ConnectionStorage; @@ -201,13 +216,13 @@ namespace play { virtual void buildConnection(ConnectionStorage) =0; - ConnectionStateManager(uint numChannels) + ConnectionManager(uint numChannels) : connections_(numChannels) { } public: virtual - ~ConnectionStateManager() + ~ConnectionManager() { } diff --git a/tests/core/proc/play/diagnostic-output-slot.hpp b/tests/core/proc/play/diagnostic-output-slot.hpp index 38fb9fbce..fcd15300d 100644 --- a/tests/core/proc/play/diagnostic-output-slot.hpp +++ b/tests/core/proc/play/diagnostic-output-slot.hpp @@ -254,33 +254,12 @@ namespace play { }; - /** - * Special diagnostic connection state implementation, - * establishing diagnostic output connections for each channel, - * thus allowing to verify the handling of individual buffers - */ - class SimulatedOutputSequences - : public ConnectionStateManager - { - typedef ConnectionStateManager _Base; - - void - buildConnection(ConnectionStorage storage) - { - storage.create(); - } - - public: - SimulatedOutputSequences (uint numChannels) - : _Base(numChannels) - { - init(); - } - }; - - - + + + + + /******************************************************************** * Helper for unit tests: Mock output sink. @@ -296,7 +275,7 @@ namespace play { * remains in memory until shutdown of the current executable */ class DiagnosticOutputSlot - : public OutputSlot + : public OutputSlotImplBase { static const uint MAX_CHANNELS = 5; @@ -311,6 +290,32 @@ namespace play { } + /** + * Special diagnostic connection state implementation, + * establishing diagnostic output connections for each channel, + * thus allowing to verify the handling of individual buffers + */ + class SimulatedOutputSequences + : public ConnectionManager + { + typedef ConnectionManager _Base; + + void + buildConnection(ConnectionStorage storage) + { + storage.create(); + } + + public: + SimulatedOutputSequences (uint numChannels) + : _Base(numChannels) + { + init(); + } + }; + + + /** hook into the OutputSlot frontend */ ConnectionState* buildState()