now senf could also be located in ../senf
[senf.git] / PPI / Jack.hh
index 5cfbc12..9d57186 100644 (file)
@@ -30,6 +30,7 @@
 #include <boost/utility.hpp>
 #include <boost/type_traits.hpp>
 #include "Connectors.hh"
+#include "Setup.hh"
 
 //#include "Jack.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -38,58 +39,82 @@ namespace senf {
 namespace ppi {
 namespace connector {
 
+    /** \brief Connector Jack base class
+        \see \ref ppi_jacks */
     class Jack
-        : private boost::noncopyable
+        : private boost::noncopyable, private ppi::detail::DisableStandardConnect
     {};
 
+    /** \brief Jack referencing an ActiveInput 
+        \see \ref ppi_jacks */
     class GenericActiveInputJack
         : public Jack
     {
     public:
         explicit GenericActiveInputJack(GenericActiveInput & input);
 
-        GenericActiveInput & connector();
+        GenericActiveInput & connector(); ///< Get referenced connector
+
+        void reset(GenericActiveInput & input); ///< Change connector
+                                        /**< Will update any existing connection accordingly */
 
     private:
-        GenericActiveInput & input_;
+        GenericActiveInput * input_;
     };
 
+    /** \brief Jack referencing an ActiveOutput
+        \see \ref ppi_jacks */
     class GenericActiveOutputJack
         : public Jack
     {
     public:
         explicit GenericActiveOutputJack(GenericActiveOutput & output);
 
-        GenericActiveOutput & connector();
+        GenericActiveOutput & connector(); ///< Get referenced connector
+
+        void reset(GenericActiveOutput & output); ///< Change connector
+                                        /**< Will update any existing connection accordingly */
 
     private:
-        GenericActiveOutput & output_;
+        GenericActiveOutput * output_;
     };
 
+    /** \brief Jack referencing a PassiveInput
+        \see \ref ppi_jacks */
     class GenericPassiveInputJack
         : public Jack
     {
     public:
         explicit GenericPassiveInputJack(GenericPassiveInput & input);
 
-        GenericPassiveInput & connector();
+        GenericPassiveInput & connector(); ///< Get referenced connector
+
+        void reset(GenericPassiveInput & input); ///< Change connector
+                                        /**< Will update any existing connection accordingly */
 
     private:
-        GenericPassiveInput & input_;
+        GenericPassiveInput * input_;
     };
     
+    /** \brief Jack referencing a PassiveOutput
+        \see \ref ppi_jacks */
     class GenericPassiveOutputJack
         : public Jack
     {
     public:
         explicit GenericPassiveOutputJack(GenericPassiveOutput & output);
 
-        GenericPassiveOutput & connector();
+        GenericPassiveOutput & connector(); ///< Get referenced connector
+
+        void reset(GenericPassiveOutput & output); ///< Change connector
+                                        /**< Will update any existing connection accordingly */
 
     private:
-        GenericPassiveOutput & output_;
+        GenericPassiveOutput * output_;
     };
 
+    /** \brief Jack with packet type referencing an ActiveInput
+        \see \ref ppi_jacks */
     template <class PacketType=Packet>
     class ActiveInputJack
         : public GenericActiveInputJack
@@ -97,6 +122,15 @@ namespace connector {
     public:
         explicit ActiveInputJack(ActiveInput<PacketType> & input);
         explicit ActiveInputJack(ActiveInput<> & input);
+        
+        explicit ActiveInputJack(ActiveInputJack & input);
+        explicit ActiveInputJack(ActiveInputJack<> & input);
+
+        void reset(ActiveInput<PacketType> & input);
+        void reset(ActiveInput<> & input);
+        
+        void reset(ActiveInputJack & input);
+        void reset(ActiveInputJack<> & input);
     };
 
 #ifndef DOXYGEN
@@ -106,11 +140,17 @@ namespace connector {
         : public GenericActiveInputJack
     {
     public:
-        explicit ActiveInputJack(ActiveInput<> & input);
+        explicit ActiveInputJack(GenericActiveInput & input);
+        explicit ActiveInputJack(GenericActiveInputJack input);
+
+        void reset(GenericActiveInput & input);
+        void reset(GenericActiveInputJack input);
     };
 
 #endif
 
+    /** \brief Jack with packet type referencing an ActiveOutput
+        \see \ref ppi_jacks */
     template <class PacketType=Packet>
     class ActiveOutputJack
         : public GenericActiveOutputJack
@@ -118,6 +158,15 @@ namespace connector {
     public:
         explicit ActiveOutputJack(ActiveOutput<PacketType> & output);
         explicit ActiveOutputJack(ActiveOutput<> & output);
+
+        explicit ActiveOutputJack(ActiveOutputJack & output);
+        explicit ActiveOutputJack(ActiveOutputJack<> & output);
+
+        void reset(ActiveOutput<PacketType> & output);
+        void reset(ActiveOutput<> & output);
+
+        void reset(ActiveOutputJack & output);
+        void reset(ActiveOutputJack<> & output);
     };
 
 #ifndef DOXYGEN
@@ -127,11 +176,17 @@ namespace connector {
         : public GenericActiveOutputJack
     {
     public:
-        explicit ActiveOutputJack(ActiveOutput<> & output);
+        explicit ActiveOutputJack(GenericActiveOutput & output);
+        explicit ActiveOutputJack(GenericActiveOutputJack & output);
+
+        void reset(GenericActiveOutput & output);
+        void reset(GenericActiveOutputJack & output);
     };
 
 #endif
 
+    /** \brief Jack with packet type referencing a PassiveInput
+        \see \ref ppi_jacks */
     template <class PacketType=Packet>
     class PassiveInputJack
         : public GenericPassiveInputJack
@@ -139,6 +194,15 @@ namespace connector {
     public:
         explicit PassiveInputJack(PassiveInput<PacketType> & input);
         explicit PassiveInputJack(PassiveInput<> & input);
+
+        explicit PassiveInputJack(PassiveInputJack & input);
+        explicit PassiveInputJack(PassiveInputJack<> & input);
+
+        void reset(PassiveInput<PacketType> & input);
+        void reset(PassiveInput<> & input);
+
+        void reset(PassiveInputJack & input);
+        void reset(PassiveInputJack<> & input);
     };
 
 #ifndef DOXYGEN
@@ -148,11 +212,17 @@ namespace connector {
         : public GenericPassiveInputJack
     {
     public:
-        explicit PassiveInputJack(PassiveInput<> & input);
+        explicit PassiveInputJack(GenericPassiveInput & input);
+        explicit PassiveInputJack(GenericPassiveInputJack & input);
+
+        void reset(GenericPassiveInput & input);
+        void reset(GenericPassiveInputJack & input);
     };
 
 #endif
 
+    /** \brief Jack with packet type referencing a PassiveOutput
+        \see \ref ppi_jacks */
     template <class PacketType=Packet>
     class PassiveOutputJack
         : public GenericPassiveOutputJack
@@ -160,6 +230,15 @@ namespace connector {
     public:
         explicit PassiveOutputJack(PassiveOutput<PacketType> & output);
         explicit PassiveOutputJack(PassiveOutput<> & output);
+
+        explicit PassiveOutputJack(PassiveOutputJack & output);
+        explicit PassiveOutputJack(PassiveOutputJack<> & output);
+
+        void reset(PassiveOutput<PacketType> & output);
+        void reset(PassiveOutput<> & output);
+
+        void reset(PassiveOutputJack & output);
+        void reset(PassiveOutputJack<> & output);
     };
 
 #ifndef DOXYGEN
@@ -169,7 +248,11 @@ namespace connector {
         : public GenericPassiveOutputJack
     {
     public:
-        explicit PassiveOutputJack(PassiveOutput<> & output);
+        explicit PassiveOutputJack(GenericPassiveOutput & output);
+        explicit PassiveOutputJack(GenericPassiveOutputJack & output);
+
+        void reset(GenericPassiveOutput & output);
+        void reset(GenericPassiveOutputJack & output);
     };
 
 #endif