Utils/Logger: Reorganize source code
[senf.git] / Utils / Logger / AreaRegistry.ih
similarity index 58%
rename from Utils/Logger/Defaults.hh
rename to Utils/Logger/AreaRegistry.ih
index a6d6340..362c3f6 100644 (file)
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 /** \file
-    \brief Defaults public header */
+    \brief AreaRegistry internal header */
 
-#ifndef HH_Defaults_
-#define HH_Defaults_ 1
+#ifndef IH_AreaRegistry_
+#define IH_AreaRegistry_ 1
 
 // Custom includes
-#include "Stream.hh"
-#include "Area.hh"
+#include <string>
+#include <vector>
 
-//#include "Defaults.mpp"
-///////////////////////////////hh.p////////////////////////////////////////
+///////////////////////////////ih.p////////////////////////////////////////
 
 namespace senf {
 namespace log {
+namespace detail {
 
-    SENF_LOG_DEF_STREAM(Debug, MESSAGE, DISABLED, DISABLED);
+    class StreamBase;
 
-    SENF_LOG_DEF_AREA_I(DefaultArea,
-                        std::string v_name() const { return ""; });
+    /** \brief Internal: Area base class */
+    struct AreaBase
+    {
+        virtual ~AreaBase() {};
+        
+        std::string fullName() const;
+        virtual std::string v_name() const;
 
-}}
+        void init();
 
-///////////////////////////////hh.e////////////////////////////////////////
-//#include "Defaults.cci"
-//#include "Defaults.ct"
-//#include "Defaults.cti"
+        unsigned streamLimit(StreamBase const & stream) const;
+        void setStreamLimit(StreamBase const & stream, unsigned value) const;
+
+    private:
+        typedef std::vector<unsigned> StreamLimits;
+        // mutable since this is a cache and may therefore change at unexpected places ...
+        mutable StreamLimits streamLimits_;
+    };
+
+}}}
+
+
+///////////////////////////////ih.e////////////////////////////////////////
 #endif
 
 \f