From 59dcfa801c5ea40d3e281c6d16f89ad059426fa4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 21 May 2012 23:42:54 +0200 Subject: [PATCH] Consistent ordering for method declarations. --- base/application.h | 43 +++++++++++----------- base/component.h | 6 ++-- base/configcollection.h | 7 ++-- base/configobject.h | 14 ++++---- base/dictionary.h | 6 ++-- base/exception.h | 12 +++---- base/fifo.h | 18 +++++----- base/i2-base.h | 7 ++-- base/memory.h | 6 ++-- base/object.h | 14 ++++---- base/observable.h | 7 ++-- base/socket.h | 26 +++++++------- base/tcpclient.h | 18 +++++----- base/tcpserver.h | 10 +++--- base/tcpsocket.h | 6 ++-- base/timer.h | 22 ++++++------ base/tlsclient.h | 32 ++++++++--------- base/utility.h | 14 ++++---- base/variant.h | 24 ++++++------- components/demo/democomponent.h | 10 +++--- components/discovery/discoverycomponent.h | 10 +++--- icinga/endpoint.h | 30 ++++++++-------- icinga/endpointmanager.h | 23 ++++++------ icinga/icingaapplication.h | 44 +++++++++++------------ icinga/jsonrpcendpoint.h | 22 ++++++------ icinga/virtualendpoint.h | 6 ++-- jsonrpc/jsonrpcclient.h | 6 ++-- jsonrpc/messagepart.h | 12 +++---- jsonrpc/netstring.h | 6 ++-- 29 files changed, 229 insertions(+), 232 deletions(-) diff --git a/base/application.h b/base/application.h index c3ed3a846..3996cd779 100644 --- a/base/application.h +++ b/base/application.h @@ -36,28 +36,6 @@ public: typedef shared_ptr Ptr; typedef weak_ptr 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 > m_Components; /**< Components that - were loaded by the application. */ - vector 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 > m_Components; /**< Components that + were loaded by the application. */ + vector 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 */ }; } diff --git a/base/component.h b/base/component.h index b2d222377..e879f390d 100644 --- a/base/component.h +++ b/base/component.h @@ -31,9 +31,6 @@ namespace icinga */ class I2_BASE_API Component : public Object { -private: - ConfigObject::Ptr m_Config; - public: typedef shared_ptr Ptr; typedef weak_ptr 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); diff --git a/base/configcollection.h b/base/configcollection.h index 21db9af4f..4f448faa6 100644 --- a/base/configcollection.h +++ b/base/configcollection.h @@ -32,9 +32,6 @@ class ConfigHive; */ class I2_BASE_API ConfigCollection : public Object { -private: - weak_ptr m_Hive; - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -54,6 +51,10 @@ public: Observable OnObjectCommitted; Observable OnObjectRemoved; + +private: + weak_ptr m_Hive; + }; } diff --git a/base/configobject.h b/base/configobject.h index 3056e52f2..5ecb6d028 100644 --- a/base/configobject.h +++ b/base/configobject.h @@ -34,13 +34,6 @@ class ConfigHive; */ class I2_BASE_API ConfigObject : public Dictionary { -private: - weak_ptr m_Hive; - - string m_Name; - string m_Type; - bool m_Replicated; - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -60,6 +53,13 @@ public: bool GetReplicated(void) const; void Commit(void); + +private: + weak_ptr m_Hive; + + string m_Name; + string m_Type; + bool m_Replicated; }; } diff --git a/base/dictionary.h b/base/dictionary.h index 83a32c3bf..eef9587f3 100644 --- a/base/dictionary.h +++ b/base/dictionary.h @@ -33,9 +33,6 @@ typedef map::iterator DictionaryIterator; */ class I2_BASE_API Dictionary : public Object { -private: - map m_Data; - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -99,6 +96,9 @@ public: DictionaryIterator End(void); long GetLength(void) const; + +private: + map m_Data; }; } diff --git a/base/exception.h b/base/exception.h index 1630ea758..7b7be4449 100644 --- a/base/exception.h +++ b/base/exception.h @@ -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) \ diff --git a/base/fifo.h b/base/fifo.h index c0a289d00..485eaa2c1 100644 --- a/base/fifo.h +++ b/base/fifo.h @@ -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); }; } diff --git a/base/i2-base.h b/base/i2-base.h index 3af92e031..f33fb0502 100644 --- a/base/i2-base.h +++ b/base/i2-base.h @@ -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 @@ * 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. + * management and to avoid accidental memory leaks and use-after-free + * bugs. * * Observer pattern * diff --git a/base/memory.h b/base/memory.h index 7fe44cc81..4ad0b83de 100644 --- a/base/memory.h +++ b/base/memory.h @@ -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); }; } diff --git a/base/object.h b/base/object.h index dcfb925ef..fb5688f4c 100644 --- a/base/object.h +++ b/base/object.h @@ -29,19 +29,19 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Object : public enable_shared_from_this +class I2_BASE_API Object : protected enable_shared_from_this { -private: - Object(const Object& other); - Object operator=(const Object& rhs); +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; protected: Object(void); virtual ~Object(void); -public: - typedef shared_ptr Ptr; - typedef weak_ptr WeakPtr; +private: + Object(const Object& other); + Object operator=(const Object& rhs); }; /** diff --git a/base/observable.h b/base/observable.h index 6cdab8223..2fb0b7bfd 100644 --- a/base/observable.h +++ b/base/observable.h @@ -44,10 +44,6 @@ class Observable public: typedef function ObserverType; -private: - vector m_Observers; - -public: /** * Adds an observer to this event. * @@ -89,6 +85,9 @@ public: i++; } } + +private: + vector m_Observers; }; } diff --git a/base/socket.h b/base/socket.h index c0115b014..e52e16833 100644 --- a/base/socket.h +++ b/base/socket.h @@ -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 Ptr; typedef weak_ptr 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); }; } diff --git a/base/tcpclient.h b/base/tcpclient.h index 180771596..627467712 100644 --- a/base/tcpclient.h +++ b/base/tcpclient.h @@ -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 Ptr; typedef weak_ptr WeakPtr; @@ -71,6 +62,15 @@ public: virtual bool WantsToWrite(void) const; Observable 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); }; /** diff --git a/base/tcpserver.h b/base/tcpserver.h index 7f58fa454..bdaf7ab33 100644 --- a/base/tcpserver.h +++ b/base/tcpserver.h @@ -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 m_ClientFactory; - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -62,6 +57,11 @@ public: Observable OnNewClient; virtual bool WantsToRead(void) const; + +private: + int ReadableEventHandler(const EventArgs& ea); + + function m_ClientFactory; }; } diff --git a/base/tcpsocket.h b/base/tcpsocket.h index bb6606bdd..fc40a9e0f 100644 --- a/base/tcpsocket.h +++ b/base/tcpsocket.h @@ -30,15 +30,15 @@ namespace icinga */ class I2_BASE_API TcpSocket : public Socket { -private: - void MakeSocket(int family); - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; void Bind(string service, int family); void Bind(string node, string service, int family); + +private: + void MakeSocket(int family); }; } diff --git a/base/timer.h b/base/timer.h index 2be847634..136a10bd7 100644 --- a/base/timer.h +++ b/base/timer.h @@ -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 Ptr; typedef weak_ptr WeakPtr; @@ -77,6 +66,17 @@ public: void Reschedule(time_t next); Observable 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); }; } diff --git a/base/tlsclient.h b/base/tlsclient.h index 5e7cd5062..c92c41c20 100644 --- a/base/tlsclient.h +++ b/base/tlsclient.h @@ -44,6 +44,22 @@ struct I2_BASE_API VerifyCertificateEventArgs : public EventArgs */ class I2_BASE_API TlsClient : public TcpClient { +public: + TlsClient(TcpClientRole role, shared_ptr sslContext); + + shared_ptr GetClientCertificate(void) const; + shared_ptr GetPeerCertificate(void) const; + + virtual void Start(void); + + virtual bool WantsToRead(void) const; + virtual bool WantsToWrite(void) const; + + Observable OnVerifyCertificate; + +protected: + void HandleSSLError(void); + private: shared_ptr m_SSLContext; shared_ptr 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 sslContext); - - shared_ptr GetClientCertificate(void) const; - shared_ptr GetPeerCertificate(void) const; - - virtual void Start(void); - - virtual bool WantsToRead(void) const; - virtual bool WantsToWrite(void) const; - - Observable OnVerifyCertificate; }; TcpClient::Ptr TlsClientFactory(TcpClientRole role, shared_ptr sslContext); diff --git a/base/utility.h b/base/utility.h index 2769bdd8f..13702cd8d 100644 --- a/base/utility.h +++ b/base/utility.h @@ -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 GetX509Certificate(string pemfile); static bool Match(string pattern, string text); + +private: + static bool m_SSLInitialized; + + Utility(void); + + static void InitializeOpenSSL(void); }; } diff --git a/base/variant.h b/base/variant.h index 91a212b7c..4545e1dae 100644 --- a/base/variant.h +++ b/base/variant.h @@ -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; }; } diff --git a/components/demo/democomponent.h b/components/demo/democomponent.h index 1046ccf68..a9334b341 100644 --- a/components/demo/democomponent.h +++ b/components/demo/democomponent.h @@ -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); }; } diff --git a/components/discovery/discoverycomponent.h b/components/discovery/discoverycomponent.h index a513f4cb2..6a93cd1cd 100644 --- a/components/discovery/discoverycomponent.h +++ b/components/discovery/discoverycomponent.h @@ -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 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); }; } diff --git a/icinga/endpoint.h b/icinga/endpoint.h index 2558891d8..a6b245330 100644 --- a/icinga/endpoint.h +++ b/icinga/endpoint.h @@ -32,21 +32,6 @@ class EndpointManager; */ class I2_ICINGA_API Endpoint : public Object { -private: - string m_Identity; /**< The identity of this endpoint. */ - set m_Subscriptions; /**< The topics this endpoint is - subscribed to. */ - set 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 m_EndpointManager; /**< The endpoint manager - this endpoint is - registered with. */ - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -96,6 +81,21 @@ public: Observable OnIdentityChanged; Observable OnSessionEstablished; + +private: + string m_Identity; /**< The identity of this endpoint. */ + set m_Subscriptions; /**< The topics this endpoint is + subscribed to. */ + set 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 m_EndpointManager; /**< The endpoint manager + this endpoint is + registered with. */ }; } diff --git a/icinga/endpointmanager.h b/icinga/endpointmanager.h index 0fc4eab91..6a6ac8a7c 100644 --- a/icinga/endpointmanager.h +++ b/icinga/endpointmanager.h @@ -40,17 +40,6 @@ struct I2_ICINGA_API NewEndpointEventArgs : public EventArgs */ class I2_ICINGA_API EndpointManager : public Object { - string m_Identity; - shared_ptr m_SSLContext; - - vector m_Servers; - vector m_Endpoints; - - void RegisterServer(JsonRpcServer::Ptr server); - void UnregisterServer(JsonRpcServer::Ptr server); - - int NewClientHandler(const NewClientEventArgs& ncea); - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -76,8 +65,18 @@ public: Endpoint::Ptr GetEndpointByIdentity(string identity) const; Observable OnNewEndpoint; -}; +private: + string m_Identity; + shared_ptr m_SSLContext; + + vector m_Servers; + vector m_Endpoints; + + void RegisterServer(JsonRpcServer::Ptr server); + void UnregisterServer(JsonRpcServer::Ptr server); + + int NewClientHandler(const NewClientEventArgs& ncea); } #endif /* ENDPOINTMANAGER_H */ diff --git a/icinga/icingaapplication.h b/icinga/icingaapplication.h index 0f25b4d6a..cf7172975 100644 --- a/icinga/icingaapplication.h +++ b/icinga/icingaapplication.h @@ -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 Ptr; typedef weak_ptr 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); }; } diff --git a/icinga/jsonrpcendpoint.h b/icinga/jsonrpcendpoint.h index e2221bdea..7601e1eb9 100644 --- a/icinga/jsonrpcendpoint.h +++ b/icinga/jsonrpcendpoint.h @@ -31,17 +31,6 @@ namespace icinga */ class I2_ICINGA_API JsonRpcEndpoint : public Endpoint { -private: - shared_ptr m_SSLContext; - string m_Address; - JsonRpcClient::Ptr m_Client; - map 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 Ptr; typedef weak_ptr WeakPtr; @@ -62,6 +51,17 @@ public: virtual void ProcessResponse(Endpoint::Ptr sender, const ResponseMessage& message); virtual void Stop(void); + +private: + shared_ptr m_SSLContext; + string m_Address; + JsonRpcClient::Ptr m_Client; + map m_PendingCalls; + + int NewMessageHandler(const NewMessageEventArgs& nmea); + int ClientClosedHandler(const EventArgs& ea); + int ClientErrorHandler(const SocketErrorEventArgs& ea); + int VerifyCertificateHandler(const VerifyCertificateEventArgs& ea); }; } diff --git a/icinga/virtualendpoint.h b/icinga/virtualendpoint.h index 9947131de..b86bd7e40 100644 --- a/icinga/virtualendpoint.h +++ b/icinga/virtualendpoint.h @@ -41,9 +41,6 @@ struct I2_ICINGA_API NewRequestEventArgs : public EventArgs */ class I2_ICINGA_API VirtualEndpoint : public Endpoint { -private: - map< string, Observable > m_TopicHandlers; - public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; @@ -60,6 +57,9 @@ public: virtual void ProcessResponse(Endpoint::Ptr sender, const ResponseMessage& message); virtual void Stop(void); + +private: + map< string, Observable > m_TopicHandlers; }; } diff --git a/jsonrpc/jsonrpcclient.h b/jsonrpc/jsonrpcclient.h index a4deb0526..314ebbb6c 100644 --- a/jsonrpc/jsonrpcclient.h +++ b/jsonrpc/jsonrpcclient.h @@ -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 Ptr; typedef weak_ptr WeakPtr; @@ -54,6 +51,9 @@ public: virtual void Start(void); Observable OnNewMessage; + +private: + int DataAvailableHandler(const EventArgs&); }; JsonRpcClient::Ptr JsonRpcClientFactory(TcpClientRole role, shared_ptr sslContext); diff --git a/jsonrpc/messagepart.h b/jsonrpc/messagepart.h index cbfad7fac..19ae4b161 100644 --- a/jsonrpc/messagepart.h +++ b/jsonrpc/messagepart.h @@ -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); }; } diff --git a/jsonrpc/netstring.h b/jsonrpc/netstring.h index bd21b2f3f..66b2bc23c 100644 --- a/jsonrpc/netstring.h +++ b/jsonrpc/netstring.h @@ -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); }; }