]> granicus.if.org Git - icinga2/commitdiff
Consistent ordering for method declarations.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 21 May 2012 21:42:54 +0000 (23:42 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 21 May 2012 21:42:54 +0000 (23:42 +0200)
29 files changed:
base/application.h
base/component.h
base/configcollection.h
base/configobject.h
base/dictionary.h
base/exception.h
base/fifo.h
base/i2-base.h
base/memory.h
base/object.h
base/observable.h
base/socket.h
base/tcpclient.h
base/tcpserver.h
base/tcpsocket.h
base/timer.h
base/tlsclient.h
base/utility.h
base/variant.h
components/demo/democomponent.h
components/discovery/discoverycomponent.h
icinga/endpoint.h
icinga/endpointmanager.h
icinga/icingaapplication.h
icinga/jsonrpcendpoint.h
icinga/virtualendpoint.h
jsonrpc/jsonrpcclient.h
jsonrpc/messagepart.h
jsonrpc/netstring.h

index c3ed3a8467281cd81cd1a5dbe80a093f41ad2dea..3996cd7797eef3b18d78f48bdbfd2d820ccd3ef1 100644 (file)
@@ -36,28 +36,6 @@ public:
        typedef shared_ptr<Application> Ptr;
        typedef weak_ptr<Application> WeakPtr;
 
-private:
-       static Application::Ptr m_Instance;
-
-       bool m_ShuttingDown; /**< Whether the application is in the process of
-                                 shutting down. */
-       ConfigHive::Ptr m_ConfigHive; /**< The application's configuration. */
-       map< string, shared_ptr<Component> > m_Components; /**< Components that
-                                       were loaded by the application. */
-       vector<string> m_Arguments; /**< Command-line arguments */
-       bool m_Debugging; /**< Whether debugging is enabled. */
-
-#ifndef _WIN32
-       static void SigIntHandler(int signum);
-#else /* _WIN32 */
-       static BOOL WINAPI CtrlHandler(DWORD type);
-#endif /* _WIN32 */
-
-protected:
-       void RunEventLoop(void);
-       string GetExeDirectory(void) const;
-
-public:
        Application(void);
        ~Application(void);
 
@@ -81,6 +59,27 @@ public:
        void AddComponentSearchDir(const string& componentDirectory);
 
        bool IsDebugging(void) const;
+
+protected:
+       void RunEventLoop(void);
+       string GetExeDirectory(void) const;
+
+private:
+       static Application::Ptr m_Instance;
+
+       bool m_ShuttingDown; /**< Whether the application is in the process of
+                                 shutting down. */
+       ConfigHive::Ptr m_ConfigHive; /**< The application's configuration. */
+       map< string, shared_ptr<Component> > m_Components; /**< Components that
+                                       were loaded by the application. */
+       vector<string> m_Arguments; /**< Command-line arguments */
+       bool m_Debugging; /**< Whether debugging is enabled. */
+
+#ifndef _WIN32
+       static void SigIntHandler(int signum);
+#else /* _WIN32 */
+       static BOOL WINAPI CtrlHandler(DWORD type);
+#endif /* _WIN32 */
 };
 
 }
index b2d22237742e8cbb36ad4169b7c2de604e4ba4f2..e879f390d47af834cb50155f8aa2998b5209d33f 100644 (file)
@@ -31,9 +31,6 @@ namespace icinga
  */
 class I2_BASE_API Component : public Object
 {
-private:
-       ConfigObject::Ptr m_Config;
-
 public:
        typedef shared_ptr<Component> Ptr;
        typedef weak_ptr<Component> WeakPtr;
@@ -44,6 +41,9 @@ public:
        virtual string GetName(void) const = 0;
        virtual void Start(void) = 0;
        virtual void Stop(void) = 0;
+
+private:
+       ConfigObject::Ptr m_Config;
 };
 
 typedef Component *(*CreateComponentFunction)(void);
index 21db9af4f7031fdeeae8b97a74ab967656d060fd..4f448faa60d2dd04b655931a8782030df23d3cc9 100644 (file)
@@ -32,9 +32,6 @@ class ConfigHive;
  */
 class I2_BASE_API ConfigCollection : public Object
 {
-private:
-       weak_ptr<ConfigHive> m_Hive;
-
 public:
        typedef shared_ptr<ConfigCollection> Ptr;
        typedef weak_ptr<ConfigCollection> WeakPtr;
@@ -54,6 +51,10 @@ public:
 
        Observable<EventArgs> OnObjectCommitted;
        Observable<EventArgs> OnObjectRemoved;
+
+private:
+       weak_ptr<ConfigHive> m_Hive;
+
 };
 
 }
index 3056e52f2c489c0d337081affa6ad1183ac76267..5ecb6d0282e664c6391d5c756c3ebd92466107bf 100644 (file)
@@ -34,13 +34,6 @@ class ConfigHive;
  */
 class I2_BASE_API ConfigObject : public Dictionary
 {
-private:
-       weak_ptr<ConfigHive> m_Hive;
-
-       string m_Name;
-       string m_Type;
-       bool m_Replicated;
-
 public:
        typedef shared_ptr<ConfigObject> Ptr;
        typedef weak_ptr<ConfigObject> WeakPtr;
@@ -60,6 +53,13 @@ public:
        bool GetReplicated(void) const;
 
        void Commit(void);
+
+private:
+       weak_ptr<ConfigHive> m_Hive;
+
+       string m_Name;
+       string m_Type;
+       bool m_Replicated;
 };
 
 }
index 83a32c3bfe74aee5788acc7ae94fe780b01dd86a..eef9587f39c0cb7e8017dc484e2fb2776ff38a59 100644 (file)
@@ -33,9 +33,6 @@ typedef map<string, Variant>::iterator DictionaryIterator;
  */
 class I2_BASE_API Dictionary : public Object
 {
-private:
-       map<string, Variant> m_Data;
-
 public:
        typedef shared_ptr<Dictionary> Ptr;
        typedef weak_ptr<Dictionary> WeakPtr;
@@ -99,6 +96,9 @@ public:
        DictionaryIterator End(void);
 
        long GetLength(void) const;
+
+private:
+       map<string, Variant> m_Data;
 };
 
 }
index 1630ea758b976ac6c7ef123313d7fb5aad475a7a..7b7be4449ecee826f04105dfe3b09317023cb1fe 100644 (file)
@@ -30,12 +30,6 @@ namespace icinga
  */
 class I2_BASE_API Exception : public exception
 {
-private:
-       char *m_Message;
-
-protected:
-       void SetMessage(const char *message);
-
 public:
        Exception(void);
        Exception(const char *message);
@@ -44,6 +38,12 @@ public:
        const char *GetMessage(void) const;
 
        virtual const char *what(void) const throw();
+
+protected:
+       void SetMessage(const char *message);
+
+private:
+       char *m_Message;
 };
 
 #define DEFINE_EXCEPTION_CLASS(klass)                                  \
index c0a289d008e28684f6f1c6aa495bd6469e4e2ecc..485eaa2c1e3388ed8261b7a0ed0d894729f0db59 100644 (file)
@@ -30,15 +30,6 @@ namespace icinga
  */
 class I2_BASE_API FIFO : public Object
 {
-private:
-       char *m_Buffer;
-       size_t m_DataSize;
-       size_t m_AllocSize;
-       size_t m_Offset;
-
-       void ResizeBuffer(size_t newSize);
-       void Optimize(void);
-
 public:
        static const size_t BlockSize = 16 * 1024;
 
@@ -55,6 +46,15 @@ public:
 
        size_t Read(void *buffer, size_t count);
        size_t Write(const void *buffer, size_t count);
+
+private:
+       char *m_Buffer;
+       size_t m_DataSize;
+       size_t m_AllocSize;
+       size_t m_Offset;
+
+       void ResizeBuffer(size_t newSize);
+       void Optimize(void);
 };
 
 }
index 3af92e0314bca49583d34ef53c95a00e3b9afaf0..f33fb0502337d2a68cf748e467729faf4036d47e 100644 (file)
@@ -24,8 +24,8 @@
  * @mainpage Icinga Documentation
  *
  * Icinga implements a framework for run-time-loadable components which can
- * pass messages between them. These components can either be hosted in the
- * same process or in several host processes (either on the same machine or
+ * pass messages between each other. These components can either be hosted in
+ * the same process or in several host processes (either on the same machine or
  * on different machines).
  *
  * The framework's code critically depends on the following patterns:
@@ -34,7 +34,8 @@
  * <item>Smart pointers
  *
  * The shared_ptr and weak_ptr template classes are used to simplify memory
- * management and to avoid accidental memory leaks and use-after-free bugs.</item>
+ * management and to avoid accidental memory leaks and use-after-free
+ * bugs.</item>
  *
  * <item>Observer pattern
  *
index 7fe44cc810fffc549fc591bca98409743e3a5de3..4ad0b83de1c93fe4a1e257ca1366f47666f6ff88 100644 (file)
@@ -32,14 +32,14 @@ DEFINE_EXCEPTION_CLASS(OutOfMemoryException);
  */
 class I2_BASE_API Memory
 {
-private:
-       Memory(void);
-
 public:
        static void *Allocate(size_t size);
        static void *Reallocate(void *ptr, size_t size);
        static char *StrDup(const char *str);
        static void Free(void *ptr);
+
+private:
+       Memory(void);
 };
 
 }
index dcfb925efb03cc5c65352a41c57784f659f7d02c..fb5688f4c2c11d957914627c20ed36a0961e1423 100644 (file)
@@ -29,19 +29,19 @@ namespace icinga
  *
  * @ingroup base
  */
-class I2_BASE_API Object : public enable_shared_from_this<Object>
+class I2_BASE_API Object : protected enable_shared_from_this<Object>
 {
-private:
-       Object(const Object& other);
-       Object operator=(const Object& rhs);
+public:
+       typedef shared_ptr<Object> Ptr;
+       typedef weak_ptr<Object> WeakPtr;
 
 protected:
        Object(void);
        virtual ~Object(void);
 
-public:
-       typedef shared_ptr<Object> Ptr;
-       typedef weak_ptr<Object> WeakPtr;
+private:
+       Object(const Object& other);
+       Object operator=(const Object& rhs);
 };
 
 /**
index 6cdab8223889595882a62d1e426db16dc48b204a..2fb0b7bfd3b7e9118338cd0744e025417b2a55e4 100644 (file)
@@ -44,10 +44,6 @@ class Observable
 public:
        typedef function<int (const TArgs&)> ObserverType;
 
-private:
-       vector<ObserverType> m_Observers;
-
-public:
        /**
         * Adds an observer to this event.
         *
@@ -89,6 +85,9 @@ public:
                                i++;
                }
        }
+
+private:
+       vector<ObserverType> m_Observers;
 };
 
 }
index c0115b0145a64c048d4684064a6aaa0ddcf8436f..e52e16833df65f56278f359dbd9081615e310779 100644 (file)
@@ -40,19 +40,6 @@ struct I2_BASE_API SocketErrorEventArgs : public EventArgs
  */
 class I2_BASE_API Socket : public Object
 {
-private:
-       SOCKET m_FD; /**< The socket descriptor. */
-
-       int ExceptionEventHandler(const EventArgs& ea);
-
-       static string GetAddressFromSockaddr(sockaddr *address, socklen_t len);
-
-protected:
-       Socket(void);
-
-       void HandleSocketError(void);
-       virtual void CloseInternal(bool from_dtor);
-
 public:
        typedef shared_ptr<Socket> Ptr;
        typedef weak_ptr<Socket> WeakPtr;
@@ -83,6 +70,19 @@ public:
 
        string GetClientAddress(void);
        string GetPeerAddress(void);
+
+protected:
+       Socket(void);
+
+       void HandleSocketError(void);
+       virtual void CloseInternal(bool from_dtor);
+
+private:
+       SOCKET m_FD; /**< The socket descriptor. */
+
+       int ExceptionEventHandler(const EventArgs& ea);
+
+       static string GetAddressFromSockaddr(sockaddr *address, socklen_t len);
 };
 
 }
index 1807715967e881529a8f95914b657376a6d3bf2c..627467712efc3d124fe4c9e4e1415785d6e6bfa5 100644 (file)
@@ -43,15 +43,6 @@ enum TcpClientRole
  */
 class I2_BASE_API TcpClient : public TcpSocket
 {
-private:
-       TcpClientRole m_Role;
-
-       FIFO::Ptr m_SendQueue;
-       FIFO::Ptr m_RecvQueue;
-
-       virtual int ReadableEventHandler(const EventArgs& ea);
-       virtual int WritableEventHandler(const EventArgs& ea);
-
 public:
        typedef shared_ptr<TcpClient> Ptr;
        typedef weak_ptr<TcpClient> WeakPtr;
@@ -71,6 +62,15 @@ public:
        virtual bool WantsToWrite(void) const;
 
        Observable<EventArgs> OnDataAvailable;
+
+private:
+       TcpClientRole m_Role;
+
+       FIFO::Ptr m_SendQueue;
+       FIFO::Ptr m_RecvQueue;
+
+       virtual int ReadableEventHandler(const EventArgs& ea);
+       virtual int WritableEventHandler(const EventArgs& ea);
 };
 
 /**
index 7f58fa45479e110e7c13010988a9ac75c16b21bc..bdaf7ab334d0255077602b0444c9349a2bf991b2 100644 (file)
@@ -41,11 +41,6 @@ struct I2_BASE_API NewClientEventArgs : public EventArgs
  */
 class I2_BASE_API TcpServer : public TcpSocket
 {
-private:
-       int ReadableEventHandler(const EventArgs& ea);
-
-       function<TcpClient::Ptr()> m_ClientFactory;
-
 public:
        typedef shared_ptr<TcpServer> Ptr;
        typedef weak_ptr<TcpServer> WeakPtr;
@@ -62,6 +57,11 @@ public:
        Observable<NewClientEventArgs> OnNewClient;
 
        virtual bool WantsToRead(void) const;
+
+private:
+       int ReadableEventHandler(const EventArgs& ea);
+
+       function<TcpClient::Ptr()> m_ClientFactory;
 };
 
 }
index bb6606bdd8102068422287ef91a59539afa9a375..fc40a9e0f4f6f9dc0524f4d69dbfcd3214d7e717 100644 (file)
@@ -30,15 +30,15 @@ namespace icinga
  */
 class I2_BASE_API TcpSocket : public Socket
 {
-private:
-       void MakeSocket(int family);
-
 public:
        typedef shared_ptr<TcpSocket> Ptr;
        typedef weak_ptr<TcpSocket> WeakPtr;
 
        void Bind(string service, int family);
        void Bind(string node, string service, int family);
+
+private:
+       void MakeSocket(int family);
 };
 
 }
index 2be847634742269ea0cbd68d238746d5bd9885c1..136a10bd787f537c8f7974114187d8f24d398090 100644 (file)
@@ -41,17 +41,6 @@ struct I2_BASE_API TimerEventArgs : public EventArgs
  */
 class I2_BASE_API Timer : public Object
 {
-private:
-       EventArgs m_UserArgs; /**< User-specified event arguments. */
-       unsigned int m_Interval; /**< The interval of the timer. */
-       time_t m_Next; /**< When the next event should happen. */
-
-       static time_t NextCall; /**< When the next event should happen (for all timers). */
-
-       static void RescheduleTimers(void);
-
-       void Call(void);
-
 public:
        typedef shared_ptr<Timer> Ptr;
        typedef weak_ptr<Timer> WeakPtr;
@@ -77,6 +66,17 @@ public:
        void Reschedule(time_t next);
 
        Observable<TimerEventArgs> OnTimerExpired;
+
+private:
+       EventArgs m_UserArgs; /**< User-specified event arguments. */
+       unsigned int m_Interval; /**< The interval of the timer. */
+       time_t m_Next; /**< When the next event should happen. */
+
+       static time_t NextCall; /**< When the next event should happen (for all timers). */
+
+       static void RescheduleTimers(void);
+
+       void Call(void);
 };
 
 }
index 5e7cd5062331926c2708ae9fb3199ef8226ead4a..c92c41c20fe716c4b24f993ea1155b721ab6b148 100644 (file)
@@ -44,6 +44,22 @@ struct I2_BASE_API VerifyCertificateEventArgs : public EventArgs
  */
 class I2_BASE_API TlsClient : public TcpClient
 {
+public:
+       TlsClient(TcpClientRole role, shared_ptr<SSL_CTX> sslContext);
+
+       shared_ptr<X509> GetClientCertificate(void) const;
+       shared_ptr<X509> GetPeerCertificate(void) const;
+
+       virtual void Start(void);
+
+       virtual bool WantsToRead(void) const;
+       virtual bool WantsToWrite(void) const;
+
+       Observable<VerifyCertificateEventArgs> OnVerifyCertificate;
+
+protected:
+       void HandleSSLError(void);
+
 private:
        shared_ptr<SSL_CTX> m_SSLContext;
        shared_ptr<SSL> m_SSL;
@@ -62,22 +78,6 @@ private:
        static void NullCertificateDeleter(X509 *certificate);
 
        static int SSLVerifyCertificate(int ok, X509_STORE_CTX *x509Context);
-
-protected:
-       void HandleSSLError(void);
-
-public:
-       TlsClient(TcpClientRole role, shared_ptr<SSL_CTX> sslContext);
-
-       shared_ptr<X509> GetClientCertificate(void) const;
-       shared_ptr<X509> GetPeerCertificate(void) const;
-
-       virtual void Start(void);
-
-       virtual bool WantsToRead(void) const;
-       virtual bool WantsToWrite(void) const;
-
-       Observable<VerifyCertificateEventArgs> OnVerifyCertificate;
 };
 
 TcpClient::Ptr TlsClientFactory(TcpClientRole role, shared_ptr<SSL_CTX> sslContext);
index 2769bdd8f07a02c2692acb780073a3db0158eb6c..13702cd8d1a3f241fe7230687384776627fa032f 100644 (file)
@@ -30,13 +30,6 @@ namespace icinga
  */
 class I2_BASE_API Utility
 {
-private:
-       static bool m_SSLInitialized;
-
-       Utility(void);
-
-       static void InitializeOpenSSL(void);
-
 public:
        /**
         * Returns a human-readable type name of an object (using RTTI).
@@ -69,6 +62,13 @@ public:
        static shared_ptr<X509> GetX509Certificate(string pemfile);
 
        static bool Match(string pattern, string text);
+
+private:
+       static bool m_SSLInitialized;
+
+       Utility(void);
+
+       static void InitializeOpenSSL(void);
 };
 
 }
index 91a212b7c78f9ecc234bb958ad5011bc48d48d69..4545e1daee3fd1f15a6162f226e297378881d344 100644 (file)
@@ -44,18 +44,6 @@ enum VariantType
  */
 class I2_BASE_API Variant
 {
-private:
-       mutable VariantType m_Type; /**< The type of the Variant. */
-
-       mutable long m_IntegerValue; /**< The value of the Variant
-                                         if m_Type == VariantInteger */
-       mutable string m_StringValue; /**< The value of the Variant
-                                          if m_Type == VariantString */
-       mutable Object::Ptr m_ObjectValue; /**< The value of the Variant
-                                               if m_Type == VariantObject */
-
-       void Convert(VariantType newType) const;
-
 public:
        inline Variant(void) : m_Type(VariantEmpty) { }
 
@@ -86,6 +74,18 @@ public:
        operator long(void) const;
        operator string(void) const;
        operator Object::Ptr(void) const;
+
+private:
+       mutable VariantType m_Type; /**< The type of the Variant. */
+
+       mutable long m_IntegerValue; /**< The value of the Variant
+                                         if m_Type == VariantInteger */
+       mutable string m_StringValue; /**< The value of the Variant
+                                          if m_Type == VariantString */
+       mutable Object::Ptr m_ObjectValue; /**< The value of the Variant
+                                               if m_Type == VariantObject */
+
+       void Convert(VariantType newType) const;
 };
 
 }
index 1046ccf6825947974a8e725f275490e6fd823798..a9334b3414b5dfb77e53a1c1e66173911e90eb4a 100644 (file)
@@ -28,17 +28,17 @@ namespace icinga
  */
 class DemoComponent : public IcingaComponent
 {
+public:
+       virtual string GetName(void) const;
+       virtual void Start(void);
+       virtual void Stop(void);
+
 private:
        Timer::Ptr m_DemoTimer;
        VirtualEndpoint::Ptr m_DemoEndpoint;
 
        int DemoTimerHandler(const TimerEventArgs& tea);
        int HelloWorldRequestHandler(const NewRequestEventArgs& nrea);
-
-public:
-       virtual string GetName(void) const;
-       virtual void Start(void);
-       virtual void Stop(void);
 };
 
 }
index a513f4cb28da9602f880533d23bad353faa70cca..6a93cd1cdf258a3cf6cda3a65a909ee0b3be506e 100644 (file)
@@ -46,6 +46,11 @@ public:
  */
 class DiscoveryComponent : public IcingaComponent
 {
+public:
+       virtual string GetName(void) const;
+       virtual void Start(void);
+       virtual void Stop(void);
+
 private:
        VirtualEndpoint::Ptr m_DiscoveryEndpoint;
        map<string, ComponentDiscoveryInfo::Ptr> m_Components;
@@ -76,11 +81,6 @@ private:
        bool HasMessagePermission(Dictionary::Ptr roles, string messageType, string message);
 
        static const int RegistrationTTL = 300;
-
-public:
-       virtual string GetName(void) const;
-       virtual void Start(void);
-       virtual void Stop(void);
 };
 
 }
index 2558891d864116e04cec95f434e52219a17734ba..a6b2453304678d963a9f10d0e0aa3d74d17dda74 100644 (file)
@@ -32,21 +32,6 @@ class EndpointManager;
  */
 class I2_ICINGA_API Endpoint : public Object
 {
-private:
-       string m_Identity; /**< The identity of this endpoint. */
-       set<string> m_Subscriptions; /**< The topics this endpoint is
-                                         subscribed to. */
-       set<string> m_Publications; /**< The topics this endpoint is
-                                        publishing. */
-       bool m_ReceivedWelcome; /**< Have we received a welcome message
-                                    from this endpoint? */
-       bool m_SentWelcome; /**< Have we sent a welcome message to this
-                                endpoint? */
-
-       weak_ptr<EndpointManager> m_EndpointManager; /**< The endpoint manager
-                                                         this endpoint is
-                                                         registered with. */
-
 public:
        typedef shared_ptr<Endpoint> Ptr;
        typedef weak_ptr<Endpoint> WeakPtr;
@@ -96,6 +81,21 @@ public:
 
        Observable<EventArgs> OnIdentityChanged;
        Observable<EventArgs> OnSessionEstablished;
+
+private:
+       string m_Identity; /**< The identity of this endpoint. */
+       set<string> m_Subscriptions; /**< The topics this endpoint is
+                                         subscribed to. */
+       set<string> m_Publications; /**< The topics this endpoint is
+                                        publishing. */
+       bool m_ReceivedWelcome; /**< Have we received a welcome message
+                                    from this endpoint? */
+       bool m_SentWelcome; /**< Have we sent a welcome message to this
+                                endpoint? */
+
+       weak_ptr<EndpointManager> m_EndpointManager; /**< The endpoint manager
+                                                         this endpoint is
+                                                         registered with. */
 };
 
 }
index 0fc4eab91288eecc3d73ff4d270fd04dd75eafe8..6a6ac8a7c1c1002de98042dc8ee5e720ec5ff201 100644 (file)
@@ -40,17 +40,6 @@ struct I2_ICINGA_API NewEndpointEventArgs : public EventArgs
  */
 class I2_ICINGA_API EndpointManager : public Object
 {
-       string m_Identity;
-       shared_ptr<SSL_CTX> m_SSLContext;
-
-       vector<JsonRpcServer::Ptr> m_Servers;
-       vector<Endpoint::Ptr> m_Endpoints;
-
-       void RegisterServer(JsonRpcServer::Ptr server);
-       void UnregisterServer(JsonRpcServer::Ptr server);
-
-       int NewClientHandler(const NewClientEventArgs& ncea);
-
 public:
        typedef shared_ptr<EndpointManager> Ptr;
        typedef weak_ptr<EndpointManager> WeakPtr;
@@ -76,8 +65,18 @@ public:
        Endpoint::Ptr GetEndpointByIdentity(string identity) const;
 
        Observable<NewEndpointEventArgs> OnNewEndpoint;
-};
 
+private:
+       string m_Identity;
+       shared_ptr<SSL_CTX> m_SSLContext;
+
+       vector<JsonRpcServer::Ptr> m_Servers;
+       vector<Endpoint::Ptr> m_Endpoints;
+
+       void RegisterServer(JsonRpcServer::Ptr server);
+       void UnregisterServer(JsonRpcServer::Ptr server);
+
+       int NewClientHandler(const NewClientEventArgs& ncea);
 }
 
 #endif /* ENDPOINTMANAGER_H */
index 0f25b4d6adfc262a7551d1594d3e509dc5fcc052..cf717297584ce8ca214c26cccd14f11d5e47d354 100644 (file)
@@ -30,29 +30,6 @@ namespace icinga
  */
 class I2_ICINGA_API IcingaApplication : public Application
 {
-private:
-       EndpointManager::Ptr m_EndpointManager;
-
-       string m_PrivateKeyFile;
-       string m_PublicKeyFile;
-       string m_CAKeyFile;
-       string m_Node;
-       string m_Service;
-
-       int NewComponentHandler(const EventArgs& ea);
-       int DeletedComponentHandler(const EventArgs& ea);
-
-       int NewIcingaConfigHandler(const EventArgs& ea);
-       int DeletedIcingaConfigHandler(const EventArgs& ea);
-
-       int NewRpcListenerHandler(const EventArgs& ea);
-       int DeletedRpcListenerHandler(const EventArgs& ea);
-
-       int NewRpcConnectionHandler(const EventArgs& ea);
-       int DeletedRpcConnectionHandler(const EventArgs& ea);
-
-       int TestTimerHandler(const TimerEventArgs& tea);
-
 public:
        typedef shared_ptr<IcingaApplication> Ptr;
        typedef weak_ptr<IcingaApplication> WeakPtr;
@@ -75,6 +52,27 @@ public:
 
        void SetService(string service);
        string GetService(void) const;
+
+private:
+       EndpointManager::Ptr m_EndpointManager;
+
+       string m_PrivateKeyFile;
+       string m_PublicKeyFile;
+       string m_CAKeyFile;
+       string m_Node;
+       string m_Service;
+
+       int NewComponentHandler(const EventArgs& ea);
+       int DeletedComponentHandler(const EventArgs& ea);
+
+       int NewIcingaConfigHandler(const EventArgs& ea);
+       int DeletedIcingaConfigHandler(const EventArgs& ea);
+
+       int NewRpcListenerHandler(const EventArgs& ea);
+       int DeletedRpcListenerHandler(const EventArgs& ea);
+
+       int NewRpcConnectionHandler(const EventArgs& ea);
+       int DeletedRpcConnectionHandler(const EventArgs& ea);
 };
 
 }
index e2221bdeab0ae35dfa8ebdb2c554c56b2b2b0b9c..7601e1eb9a22a0104c6242dab57b6d266cbe0aa1 100644 (file)
@@ -31,17 +31,6 @@ namespace icinga
  */
 class I2_ICINGA_API JsonRpcEndpoint : public Endpoint
 {
-private:
-       shared_ptr<SSL_CTX> m_SSLContext;
-       string m_Address;
-       JsonRpcClient::Ptr m_Client;
-       map<string, Endpoint::Ptr> m_PendingCalls;
-
-       int NewMessageHandler(const NewMessageEventArgs& nmea);
-       int ClientClosedHandler(const EventArgs& ea);
-       int ClientErrorHandler(const SocketErrorEventArgs& ea);
-       int VerifyCertificateHandler(const VerifyCertificateEventArgs& ea);
-
 public:
        typedef shared_ptr<JsonRpcEndpoint> Ptr;
        typedef weak_ptr<JsonRpcEndpoint> WeakPtr;
@@ -62,6 +51,17 @@ public:
        virtual void ProcessResponse(Endpoint::Ptr sender, const ResponseMessage& message);
 
        virtual void Stop(void);
+
+private:
+       shared_ptr<SSL_CTX> m_SSLContext;
+       string m_Address;
+       JsonRpcClient::Ptr m_Client;
+       map<string, Endpoint::Ptr> m_PendingCalls;
+
+       int NewMessageHandler(const NewMessageEventArgs& nmea);
+       int ClientClosedHandler(const EventArgs& ea);
+       int ClientErrorHandler(const SocketErrorEventArgs& ea);
+       int VerifyCertificateHandler(const VerifyCertificateEventArgs& ea);
 };
 
 }
index 9947131de4e5f7371d8f1e3ad60a90801f2d40b6..b86bd7e40bb6f09a6ada1c223f4811dcb2dbd90b 100644 (file)
@@ -41,9 +41,6 @@ struct I2_ICINGA_API NewRequestEventArgs : public EventArgs
  */
 class I2_ICINGA_API VirtualEndpoint : public Endpoint
 {
-private:
-       map< string, Observable<NewRequestEventArgs> > m_TopicHandlers;
-
 public:
        typedef shared_ptr<VirtualEndpoint> Ptr;
        typedef weak_ptr<VirtualEndpoint> WeakPtr;
@@ -60,6 +57,9 @@ public:
        virtual void ProcessResponse(Endpoint::Ptr sender, const ResponseMessage& message);
 
        virtual void Stop(void);
+
+private:
+       map< string, Observable<NewRequestEventArgs> > m_TopicHandlers;
 };
 
 }
index a4deb052670fe6200e1d4c0861ef082a9242aafc..314ebbb6ca23971b4649a99bc840b0810a526ac9 100644 (file)
@@ -40,9 +40,6 @@ struct I2_JSONRPC_API NewMessageEventArgs : public EventArgs
  */
 class I2_JSONRPC_API JsonRpcClient : public TlsClient
 {
-private:
-       int DataAvailableHandler(const EventArgs&);
-
 public:
        typedef shared_ptr<JsonRpcClient> Ptr;
        typedef weak_ptr<JsonRpcClient> WeakPtr;
@@ -54,6 +51,9 @@ public:
        virtual void Start(void);
 
        Observable<NewMessageEventArgs> OnNewMessage;
+
+private:
+       int DataAvailableHandler(const EventArgs&);
 };
 
 JsonRpcClient::Ptr JsonRpcClientFactory(TcpClientRole role, shared_ptr<SSL_CTX> sslContext);
index cbfad7fac8691b7bc582c29ed4c4e8a3461627a9..19ae4b161326dd4b889971bad52488e4c83ee553 100644 (file)
@@ -34,12 +34,6 @@ typedef ::cJSON json_t;
  */
 class I2_JSONRPC_API MessagePart
 {
-private:
-       Dictionary::Ptr m_Dictionary;
-
-       static Dictionary::Ptr GetDictionaryFromJson(json_t *json);
-       static json_t *GetJsonFromDictionary(const Dictionary::Ptr& dictionary);
-
 public:
        MessagePart(void);
        MessagePart(string json);
@@ -93,6 +87,12 @@ public:
 
        DictionaryIterator Begin(void);
        DictionaryIterator End(void);
+
+private:
+       Dictionary::Ptr m_Dictionary;
+
+       static Dictionary::Ptr GetDictionaryFromJson(json_t *json);
+       static json_t *GetJsonFromDictionary(const Dictionary::Ptr& dictionary);
 };
 
 }
index bd21b2f3f184bbbfe34eac4d82a4d5015f6bf17a..66b2bc23ca932ecae8a223b106d989bb805079e4 100644 (file)
@@ -39,12 +39,12 @@ DEFINE_EXCEPTION_CLASS(InvalidNetstringException);
  */
 class I2_JSONRPC_API Netstring
 {
-private:
-       Netstring(void);
-
 public:
        static bool ReadStringFromFIFO(FIFO::Ptr fifo, string *message);
        static void WriteStringToFIFO(FIFO::Ptr fifo, const string& message);
+
+private:
+       Netstring(void);
 };
 
 }