00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACE_SERVICE_TYPE_H
00014 #define ACE_SERVICE_TYPE_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "ace/Service_Object.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class ACE_Export ACE_Service_Type_Impl
00040 {
00041 public:
00042
00043 ACE_Service_Type_Impl (void *object,
00044 const ACE_TCHAR *s_name,
00045 u_int flags = 0,
00046 ACE_Service_Object_Exterminator gobbler = 0);
00047 virtual ~ACE_Service_Type_Impl (void);
00048
00049
00050 virtual int suspend (void) const = 0;
00051 virtual int resume (void) const = 0;
00052 virtual int init (int argc, ACE_TCHAR *argv[]) const = 0;
00053 virtual int fini (void) const;
00054 virtual int info (ACE_TCHAR **str, size_t len) const = 0;
00055
00056
00057 void *object (void) const;
00058
00059
00060 const ACE_TCHAR *name (void) const;
00061
00062
00063 void name (const ACE_TCHAR *);
00064
00065
00066 void dump (void) const;
00067
00068
00069 ACE_ALLOC_HOOK_DECLARE;
00070
00071 protected:
00072
00073 const ACE_TCHAR *name_;
00074
00075
00076
00077 void *obj_;
00078
00079
00080 ACE_Service_Object_Exterminator gobbler_;
00081
00082
00083 u_int flags_;
00084 };
00085
00086
00087
00088
00089
00090
00091
00092 class ACE_Export ACE_Service_Object_Type : public ACE_Service_Type_Impl
00093 {
00094 public:
00095
00096 ACE_Service_Object_Type (void *so,
00097 const ACE_TCHAR *name,
00098 u_int flags = 0,
00099 ACE_Service_Object_Exterminator gobbler = 0);
00100
00101 ~ACE_Service_Object_Type (void);
00102
00103
00104 virtual int suspend (void) const;
00105 virtual int resume (void) const;
00106 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00107 virtual int fini (void) const;
00108 virtual int info (ACE_TCHAR **str, size_t len) const;
00109 };
00110
00111
00112
00113
00114
00115
00116
00117 class ACE_Export ACE_Module_Type : public ACE_Service_Type_Impl
00118 {
00119 public:
00120
00121 ACE_Module_Type (void *m,
00122 const ACE_TCHAR *identifier,
00123 u_int flags = 0);
00124
00125 ~ACE_Module_Type (void);
00126
00127
00128 virtual int suspend (void) const;
00129 virtual int resume (void) const;
00130 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00131 virtual int fini (void) const;
00132 virtual int info (ACE_TCHAR **str, size_t len) const;
00133
00134
00135 ACE_Module_Type *link (void) const;
00136
00137
00138 void link (ACE_Module_Type *);
00139
00140
00141 void dump (void) const;
00142
00143
00144 ACE_ALLOC_HOOK_DECLARE;
00145
00146 private:
00147
00148 ACE_Module_Type *link_;
00149 };
00150
00151
00152
00153
00154
00155
00156
00157 class ACE_Export ACE_Stream_Type : public ACE_Service_Type_Impl
00158 {
00159 public:
00160
00161 ACE_Stream_Type (void *s,
00162 const ACE_TCHAR *identifier,
00163 u_int flags = 0);
00164
00165 ~ACE_Stream_Type (void);
00166
00167
00168 virtual int suspend (void) const;
00169 virtual int resume (void) const;
00170 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00171 virtual int fini (void) const;
00172 virtual int info (ACE_TCHAR **str, size_t len) const;
00173
00174
00175 int push (ACE_Module_Type *new_module);
00176
00177
00178 int remove (ACE_Module_Type *module);
00179
00180
00181 ACE_Module_Type *find (const ACE_TCHAR *mod_name) const;
00182
00183
00184 void dump (void) const;
00185
00186
00187 ACE_ALLOC_HOOK_DECLARE;
00188
00189 private:
00190
00191 ACE_Module_Type *head_;
00192 };
00193
00194 ACE_END_VERSIONED_NAMESPACE_DECL
00195
00196 #if defined (__ACE_INLINE__)
00197 #include "ace/Service_Types.inl"
00198 #endif
00199
00200 #include "ace/post.h"
00201
00202 #endif