Some adjustments for Ubuntu 8.04
[senf.git] / Console / Server.ih
index d31f713..3ca80a1 100644 (file)
@@ -29,6 +29,7 @@
 // Custom includes
 #include <boost/iostreams/concepts.hpp>
 #include <boost/iostreams/stream.hpp>
+#include <set>
 
 ///////////////////////////////ih.p////////////////////////////////////////
 
@@ -40,9 +41,30 @@ namespace console {
 
 namespace detail {
 
+    class ServerManager
+    {
+    public:
+        typedef boost::intrusive_ptr<Server> ptr;
+
+    protected:
+
+    private:
+        static void add(ptr server);
+        static void remove(ptr server);
+
+        static ServerManager & instance();
+
+        typedef std::set<ptr> Servers;
+        Servers servers_;
+
+        friend class senf::console::Server;
+    };
+
     /** \brief Internal: Nonblocking boost::iostreams::sink
 
         The sink discards data if the output socket would.
+
+        \fixme Don't throw exceptions ... set stream error indicator (if at all)
      */
     class NonblockingSocketSink 
         : public boost::iostreams::sink
@@ -149,7 +171,7 @@ namespace detail {
         virtual void v_enablePrompt();
         virtual void v_translate(std::string & data);
 
-        void newData(senf::Scheduler::EventId event);
+        void newData(int event);
 
         SchedulerBinding binding_;
         std::string buffer_;