some unimportant clean-ups ;)
[senf.git] / PPI / Connectors.hh
index 0874551..4f18a78 100644 (file)
@@ -23,8 +23,8 @@
 /** \file
     \brief Connectors public header */
 
-#ifndef HH_Connectors_
-#define HH_Connectors_ 1
+#ifndef HH_SENF_PPI_Connectors_
+#define HH_SENF_PPI_Connectors_ 1
 
 // Custom includes
 #include <deque>
@@ -36,6 +36,7 @@
 #include "predecl.hh"
 #include "detail/Callback.hh"
 #include "Queueing.hh"
+#include "ModuleManager.hh"
 
 //#include "Connectors.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -122,7 +123,7 @@ namespace connector {
         to the containing module)
      */
     class Connector
-        : boost::noncopyable
+        : ModuleManager::Initializable, boost::noncopyable
     {
     public:
         Connector & peer() const;       ///< Get peer connected to this connector
@@ -130,6 +131,8 @@ namespace connector {
 
         bool connected() const;         ///< \c true, if connector connected, \c false otherwise
 
+        void disconnect();              ///< Disconnect connector from peer
+
     protected:
         Connector();
         virtual ~Connector();
@@ -140,8 +143,6 @@ namespace connector {
         virtual std::type_info const & packetTypeID();
 
         void setModule(module::Module & module);
-        void init();        
-        virtual void v_init() = 0;        
 
         Connector * peer_;
         module::Module * module_;
@@ -349,7 +350,7 @@ namespace connector {
         InputConnector();
 
     private:
-        void enqueue(Packet p);
+        void enqueue(Packet const & p);
 
         virtual void v_requestEvent();
         virtual void v_enqueueEvent();
@@ -370,9 +371,9 @@ namespace connector {
         : public virtual Connector
     {
     public:
-        void operator()(Packet p);      ///< Send out a packet
+        void operator()(Packet const & p);      ///< Send out a packet
 
-        void write(Packet p);           ///< Alias for operator()(Packet p)
+        void write(Packet const & p);           ///< Alias for operator()(Packet p)
 
         InputConnector & peer() const;
 
@@ -525,7 +526,7 @@ namespace connector {
     {
     public:
         PacketType operator()();        ///< Read packet
-                                        /**< \throws std::bad_cast, if the %connector receives a
+                                        /**< \throws std::bad_cast if the %connector receives a
                                              Packet which is not of type \a PacketType.
                                              \returns newly read packet reference. */
         PacketType read();              ///< Alias for operator()
@@ -548,7 +549,7 @@ namespace connector {
     {
     public:
         PacketType operator()();        ///< Read packet
-                                        /**< \throws std::bad_cast, if the %connector receives a
+                                        /**< \throws std::bad_cast if the %connector receives a
                                              Packet which is not of type \a PacketType.
                                              \returns newly read packet reference. */
         PacketType read();              ///< Alias for operator()