Go to the documentation of this file.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 int stype = ACE_Service_Type::INVALID_TYPE);
00048 virtual ~ACE_Service_Type_Impl (void);
00049
00050
00051 virtual int suspend (void) const = 0;
00052 virtual int resume (void) const = 0;
00053 virtual int init (int argc, ACE_TCHAR *argv[]) const = 0;
00054 virtual int fini (void) const;
00055 virtual int info (ACE_TCHAR **str, size_t len) const = 0;
00056
00057
00058 void *object (void) const;
00059
00060
00061 const ACE_TCHAR *name (void) const;
00062
00063
00064 void name (const ACE_TCHAR *);
00065
00066
00067 void dump (void) const;
00068
00069
00070 int service_type (void) const;
00071
00072
00073 void service_type (int stype);
00074
00075
00076 ACE_ALLOC_HOOK_DECLARE;
00077
00078 protected:
00079
00080 const ACE_TCHAR *name_;
00081
00082
00083
00084 void *obj_;
00085
00086
00087 ACE_Service_Object_Exterminator gobbler_;
00088
00089
00090 u_int flags_;
00091
00092
00093
00094
00095 int service_type_;
00096 };
00097
00098
00099
00100
00101
00102
00103
00104 class ACE_Export ACE_Service_Object_Type : public ACE_Service_Type_Impl
00105 {
00106 public:
00107
00108 ACE_Service_Object_Type (void *so,
00109 const ACE_TCHAR *name,
00110 u_int flags = 0,
00111 ACE_Service_Object_Exterminator gobbler = 0,
00112 int stype = ACE_Service_Type::SERVICE_OBJECT);
00113
00114 ~ACE_Service_Object_Type (void);
00115
00116
00117 virtual int suspend (void) const;
00118 virtual int resume (void) const;
00119 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00120 virtual int fini (void) const;
00121 virtual int info (ACE_TCHAR **str, size_t len) const;
00122
00123 private:
00124
00125 mutable int initialized_;
00126 };
00127
00128
00129
00130
00131
00132
00133
00134 class ACE_Export ACE_Module_Type : public ACE_Service_Type_Impl
00135 {
00136 public:
00137
00138 ACE_Module_Type (void *m,
00139 const ACE_TCHAR *identifier,
00140 u_int flags = 0,
00141 int stype = ACE_Service_Type::MODULE);
00142
00143 ~ACE_Module_Type (void);
00144
00145
00146 virtual int suspend (void) const;
00147 virtual int resume (void) const;
00148 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00149 virtual int fini (void) const;
00150 virtual int info (ACE_TCHAR **str, size_t len) const;
00151
00152
00153 ACE_Module_Type *link (void) const;
00154
00155
00156 void link (ACE_Module_Type *);
00157
00158
00159 void dump (void) const;
00160
00161
00162 ACE_ALLOC_HOOK_DECLARE;
00163
00164 private:
00165
00166 ACE_Module_Type *link_;
00167 };
00168
00169
00170
00171
00172
00173
00174
00175 class ACE_Export ACE_Stream_Type : public ACE_Service_Type_Impl
00176 {
00177 public:
00178
00179 ACE_Stream_Type (void *s,
00180 const ACE_TCHAR *identifier,
00181 u_int flags = 0,
00182 int stype = ACE_Service_Type::STREAM);
00183
00184 ~ACE_Stream_Type (void);
00185
00186
00187 virtual int suspend (void) const;
00188 virtual int resume (void) const;
00189 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00190 virtual int fini (void) const;
00191 virtual int info (ACE_TCHAR **str, size_t len) const;
00192
00193
00194 int push (ACE_Module_Type *new_module);
00195
00196
00197 int remove (ACE_Module_Type *module);
00198
00199
00200 ACE_Module_Type *find (const ACE_TCHAR *module_name) const;
00201
00202
00203 void dump (void) const;
00204
00205
00206 ACE_ALLOC_HOOK_DECLARE;
00207
00208 private:
00209
00210 ACE_Module_Type *head_;
00211 };
00212
00213 ACE_END_VERSIONED_NAMESPACE_DECL
00214
00215 #if defined (__ACE_INLINE__)
00216 #include "ace/Service_Types.inl"
00217 #endif
00218
00219 #include "ace/post.h"
00220
00221 #endif