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 private:
00111
00112 mutable int initialized_;
00113 };
00114
00115
00116
00117
00118
00119
00120
00121 class ACE_Export ACE_Module_Type : public ACE_Service_Type_Impl
00122 {
00123 public:
00124
00125 ACE_Module_Type (void *m,
00126 const ACE_TCHAR *identifier,
00127 u_int flags = 0);
00128
00129 ~ACE_Module_Type (void);
00130
00131
00132 virtual int suspend (void) const;
00133 virtual int resume (void) const;
00134 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00135 virtual int fini (void) const;
00136 virtual int info (ACE_TCHAR **str, size_t len) const;
00137
00138
00139 ACE_Module_Type *link (void) const;
00140
00141
00142 void link (ACE_Module_Type *);
00143
00144
00145 void dump (void) const;
00146
00147
00148 ACE_ALLOC_HOOK_DECLARE;
00149
00150 private:
00151
00152 ACE_Module_Type *link_;
00153 };
00154
00155
00156
00157
00158
00159
00160
00161 class ACE_Export ACE_Stream_Type : public ACE_Service_Type_Impl
00162 {
00163 public:
00164
00165 ACE_Stream_Type (void *s,
00166 const ACE_TCHAR *identifier,
00167 u_int flags = 0);
00168
00169 ~ACE_Stream_Type (void);
00170
00171
00172 virtual int suspend (void) const;
00173 virtual int resume (void) const;
00174 virtual int init (int argc, ACE_TCHAR *argv[]) const;
00175 virtual int fini (void) const;
00176 virtual int info (ACE_TCHAR **str, size_t len) const;
00177
00178
00179 int push (ACE_Module_Type *new_module);
00180
00181
00182 int remove (ACE_Module_Type *module);
00183
00184
00185 ACE_Module_Type *find (const ACE_TCHAR *mod_name) const;
00186
00187
00188 void dump (void) const;
00189
00190
00191 ACE_ALLOC_HOOK_DECLARE;
00192
00193 private:
00194
00195 ACE_Module_Type *head_;
00196 };
00197
00198 ACE_END_VERSIONED_NAMESPACE_DECL
00199
00200 #if defined (__ACE_INLINE__)
00201 #include "ace/Service_Types.inl"
00202 #endif
00203
00204 #include "ace/post.h"
00205
00206 #endif