From 53284e215e3d3351a7d7e9c4b68f14b427fb4377 Mon Sep 17 00:00:00 2001 From: coryan Date: Wed, 1 Nov 2000 22:17:39 +0000 Subject: ChangeLogTag:Wed Nov 1 14:11:48 2000 Carlos O'Ryan --- ace/Service_Object.h | 121 ++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 59 deletions(-) (limited to 'ace/Service_Object.h') diff --git a/ace/Service_Object.h b/ace/Service_Object.h index de4e7aaca66..c74de19141c 100644 --- a/ace/Service_Object.h +++ b/ace/Service_Object.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Service_Object.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file Service_Object.h + * + * $Id$ + * + * @author Doug Schmidt + */ +//============================================================================= + #ifndef ACE_SERVICE_OBJECT_H #define ACE_SERVICE_OBJECT_H @@ -27,51 +24,55 @@ #include "ace/Event_Handler.h" #define ACE_Component ACE_Service_Object +/** + * @class ACE_Service_Object + * + * @brief Provide the abstract base class common to all service + * implementations. + * + * Classes that inherit from are capable + * of being registered with the (due to the + * , as well as being dynamically linked by + * the (due to the ). + */ class ACE_Export ACE_Service_Object : public ACE_Event_Handler, public ACE_Shared_Object { - // = TITLE - // Provide the abstract base class common to all service - // implementations. - // - // = DESCRIPTION - // Classes that inherit from are capable - // of being registered with the (due to the - // , as well as being dynamically linked by - // the (due to the ). public: // = Initialization and termination methods. + /// Constructor. ACE_Service_Object (ACE_Reactor * = 0); - // Constructor. + /// Destructor. virtual ~ACE_Service_Object (void); - // Destructor. + /// Temporarily disable a service without removing it completely. virtual int suspend (void); - // Temporarily disable a service without removing it completely. + /// Re-enable a previously suspended service. virtual int resume (void); - // Re-enable a previously suspended service. }; // Forward decl. class ACE_Service_Type_Impl; +/** + * @class ACE_Service_Type + * + * @brief Keeps track of information related to the various + * subclasses. + * + * This class acts as the interface of the "Bridge" pattern. + */ class ACE_Export ACE_Service_Type { - // = TITLE - // Keeps track of information related to the various - // subclasses. - // - // = DESCRIPTION - // This class acts as the interface of the "Bridge" pattern. public: enum { + /// Delete the payload object. DELETE_OBJ = 1, - // Delete the payload object. + /// Delete the enclosing object. DELETE_THIS = 2 - // Delete the enclosing object. }; // = Initialization and termination methods. @@ -96,62 +97,64 @@ public: int active (void) const; void active (int); + /// Calls on void fini (void); - // Calls on + /// Check if the service has been fini'ed. int fini_called (void) const; - // Check if the service has been fini'ed. + /// Dump the state of an object. void dump (void) const; - // Dump the state of an object. + /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. private: + /// Humanly readible name of svc. const ACE_TCHAR *name_; - // Humanly readible name of svc. + /// Pointer to C++ object that implements the svc. const ACE_Service_Type_Impl *type_; - // Pointer to C++ object that implements the svc. + /// Handle to shared object file (non-zero if dynamically linked). ACE_SHLIB_HANDLE handle_; - // Handle to shared object file (non-zero if dynamically linked). + /// 1 if svc is currently active, otherwise 0. int active_; - // 1 if svc is currently active, otherwise 0. + /// 1 if on has already been called, otherwise 0. int fini_already_called_; - // 1 if on has already been called, otherwise 0. }; +/** + * @class ACE_Service_Object_Ptr + * + * @brief This is a smart pointer that holds onto the associated + * * until the current scope is left, at + * which point the object's hook is called and the + * service_object_ gets deleted. + * + * This class is similar to the Standard C++ Library class + * . It is used in conjunction with statically linked + * , as shown in the + * ./netsvcs/server/main.cpp example. + */ class ACE_Export ACE_Service_Object_Ptr { - // = TITLE - // This is a smart pointer that holds onto the associated - // * until the current scope is left, at - // which point the object's hook is called and the - // service_object_ gets deleted. - // - // = DESCRIPTION - // This class is similar to the Standard C++ Library class - // . It is used in conjunction with statically linked - // , as shown in the - // ./netsvcs/server/main.cpp example. public: // = Initialization and termination methods. + /// Acquire ownership of the . ACE_Service_Object_Ptr (ACE_Service_Object *so); - // Acquire ownership of the . + /// Release the held by calling its hook. ~ACE_Service_Object_Ptr (void); - // Release the held by calling its hook. + /// Smart pointer to access the underlying . ACE_Service_Object *operator-> (); - // Smart pointer to access the underlying . private: + /// Holds the service object until we're done. ACE_Service_Object *service_object_; - // Holds the service object until we're done. }; #if defined (__ACE_INLINE__) -- cgit v1.2.1