summaryrefslogtreecommitdiff
path: root/ace/Service_Object.h
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-09-12 03:37:51 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-09-12 03:37:51 +0000
commitf324b831958855fb9f9f8030d9ae9fadcb410b82 (patch)
treeb7abff4feff6894c93ec2ec491fcc93a0df9199c /ace/Service_Object.h
parentb28d9da6e806044a8f8079cc902d3b295b4d484f (diff)
downloadATCD-f324b831958855fb9f9f8030d9ae9fadcb410b82.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Service_Object.h')
-rw-r--r--ace/Service_Object.h82
1 files changed, 51 insertions, 31 deletions
diff --git a/ace/Service_Object.h b/ace/Service_Object.h
index ac7131b8266..0c83733f1e5 100644
--- a/ace/Service_Object.h
+++ b/ace/Service_Object.h
@@ -22,7 +22,14 @@
class ACE_Export ACE_Service_Object : public ACE_Event_Handler, public ACE_Shared_Object
// = TITLE
- // Provide the abstract base class common to all services
+ // Provide the abstract base class common to all service
+ // implementations.
+ //
+ // = DESCRIPTION
+ // Classes that inherit from <ACE_Service_Objects> are capable
+ // of being registered with the <ACE_Reactor> (due to the
+ // <ACE_Event_Handler>, as well as being dynamically linked by
+ // the <ACE_Service_Config> (due to the <ACE_Shared_Object>).
{
public:
// = Initialization and termination methods.
@@ -30,44 +37,54 @@ public:
virtual ~ACE_Service_Object (void);
virtual int suspend (void);
- // Temporarily disable a service without removing it completely
+ // Temporarily disable a service without removing it completely.
+
virtual int resume (void);
- // Re-enable a previously suspended service
+ // Re-enable a previously suspended service.
};
+// Forward decl.
+class ACE_Service_Type_Impl;
+
class ACE_Export ACE_Service_Type
// = TITLE
- // Provide the class hierarchy that defines the contents of
- // the Service Repository search structure.
+ // Keeps track of information related to the various
+ // <ACE_Service_Type_Impl> subclasses.
+ //
+ // = DESCRIPTION
+ // This class acts as the interface of the "Bridge" pattern.
{
public:
enum
{
- DELETE_OBJ = 1, // Delete the payload object.
- DELETE_THIS = 2 // Delete the enclosing object.
+ DELETE_OBJ = 1,
+ // Delete the payload object.
+
+ DELETE_THIS = 2
+ // Delete the enclosing object.
};
// = Initialization and termination methods.
- ACE_Service_Type (const void *object,
- const char *s_name,
- u_int flags = 0);
- virtual ~ACE_Service_Type (void);
+ ACE_Service_Type (const char *n,
+ ACE_Service_Type_Impl *o,
+ const ACE_SHLIB_HANDLE handle,
+ int active);
+ ~ACE_Service_Type (void);
+
+ const char *name (void) const;
+ void name (const char *);
- // = Pure virtual interface (must be defined by the subclass).
- virtual int suspend (void) const = 0;
- virtual int resume (void) const = 0;
- virtual int init (int argc, char *argv[]) const = 0;
- virtual int fini (void) const;
- virtual int info (char **str, size_t len) const = 0;
+ const ACE_Service_Type_Impl *type (void) const;
+ void type (const ACE_Service_Type_Impl *,
+ int active = 1);
- const void *object (void) const;
- // The pointer to the service.
+ ACE_SHLIB_HANDLE handle (void) const;
+ void handle (const ACE_SHLIB_HANDLE);
- const char *name (void) const;
- // Get the name of the service.
-
- void name (const char *);
- // Set the name of the service.
+ void suspend (void) const;
+ void resume (void) const;
+ int active (void) const;
+ void active (int);
void dump (void) const;
// Dump the state of an object.
@@ -75,15 +92,18 @@ public:
ACE_ALLOC_HOOK_DECLARE;
// Declare the dynamic allocation hooks.
-protected:
- const char *name_;
- // Name of the service.
+private:
+ const char *name_;
+ // Humanly readible name of svc.
+
+ const ACE_Service_Type_Impl *type_;
+ // Pointer to C++ object that implements the svc.
- const void *obj_;
- // Pointer to object that implements the service.
+ ACE_SHLIB_HANDLE handle_;
+ // Handle to shared object file (non-zero if dynamically linked).
- u_int flags_;
- // Flags that control serivce behavior (particularly deletion).
+ int active_;
+ // 1 if svc is currently active, otherwise 0.
};
class ACE_Export ACE_Service_Object_Ptr