00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_PARSE_NODE_H
00015 #define ACE_PARSE_NODE_H
00016
00017 #include "ace/pre.h"
00018
00019 #include "ace/config-all.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif
00024
00025 #if (ACE_USES_CLASSIC_SVC_CONF == 1)
00026
00027 #include "ace/DLL.h"
00028 #include "ace/Svc_Conf.h"
00029
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031
00032
00033 class ACE_Service_Config;
00034 class ACE_Service_Type;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class ACE_Parse_Node
00047 {
00048 public:
00049 ACE_Parse_Node (void);
00050 explicit ACE_Parse_Node (const ACE_TCHAR *name);
00051 virtual ~ACE_Parse_Node (void);
00052
00053 ACE_Parse_Node *link (void) const;
00054 void link (ACE_Parse_Node *);
00055
00056
00057 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno) = 0;
00058
00059 const ACE_TCHAR *name (void) const;
00060 void print (void) const;
00061
00062
00063 void dump (void) const;
00064
00065
00066 ACE_ALLOC_HOOK_DECLARE;
00067
00068 private:
00069 const ACE_TCHAR *name_;
00070 ACE_Parse_Node *next_;
00071
00072 private:
00073 ACE_UNIMPLEMENTED_FUNC (ACE_Parse_Node (const ACE_Parse_Node&))
00074 ACE_UNIMPLEMENTED_FUNC (ACE_Parse_Node& operator= (const ACE_Parse_Node&))
00075 };
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 class ACE_Suspend_Node : public ACE_Parse_Node
00087 {
00088 public:
00089 ACE_Suspend_Node (const ACE_TCHAR *name);
00090 ~ACE_Suspend_Node (void);
00091
00092 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00093
00094
00095 void dump (void) const;
00096
00097
00098 ACE_ALLOC_HOOK_DECLARE;
00099
00100 private:
00101 ACE_UNIMPLEMENTED_FUNC (ACE_Suspend_Node (const ACE_Suspend_Node&))
00102 ACE_UNIMPLEMENTED_FUNC (ACE_Suspend_Node& operator= (const ACE_Suspend_Node&))
00103 };
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 class ACE_Resume_Node : public ACE_Parse_Node
00115 {
00116 public:
00117 ACE_Resume_Node (const ACE_TCHAR *name);
00118 ~ACE_Resume_Node (void);
00119
00120 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00121
00122
00123 void dump (void) const;
00124
00125
00126 ACE_ALLOC_HOOK_DECLARE;
00127
00128 private:
00129 ACE_UNIMPLEMENTED_FUNC (ACE_Resume_Node (const ACE_Resume_Node&))
00130 ACE_UNIMPLEMENTED_FUNC (ACE_Resume_Node& operator= (const ACE_Resume_Node&))
00131 };
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 class ACE_Remove_Node : public ACE_Parse_Node
00143 {
00144 public:
00145 ACE_Remove_Node (const ACE_TCHAR *name);
00146 ~ACE_Remove_Node (void);
00147
00148 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00149
00150
00151 void dump (void) const;
00152
00153
00154 ACE_ALLOC_HOOK_DECLARE;
00155
00156 private:
00157 ACE_UNIMPLEMENTED_FUNC (ACE_Remove_Node (const ACE_Remove_Node&))
00158 ACE_UNIMPLEMENTED_FUNC (ACE_Remove_Node& operator= (const ACE_Remove_Node&))
00159 };
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 class ACE_Static_Node : public ACE_Parse_Node
00171 {
00172 public:
00173 ACE_Static_Node (const ACE_TCHAR *name, ACE_TCHAR *params = 0);
00174 virtual ~ACE_Static_Node (void);
00175
00176 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00177 virtual const ACE_Service_Type *record (const ACE_Service_Gestalt *g) const;
00178
00179 ACE_TCHAR *parameters (void) const;
00180
00181
00182 void dump (void) const;
00183
00184
00185 ACE_ALLOC_HOOK_DECLARE;
00186
00187 private:
00188
00189 ACE_TCHAR *parameters_;
00190
00191 private:
00192 ACE_UNIMPLEMENTED_FUNC (ACE_Static_Node (const ACE_Static_Node&))
00193 ACE_UNIMPLEMENTED_FUNC (ACE_Static_Node& operator= (const ACE_Static_Node&))
00194 };
00195
00196
00197 class ACE_Service_Type_Factory;
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 class ACE_Dynamic_Node : public ACE_Static_Node
00209 {
00210 public:
00211 ACE_Dynamic_Node (ACE_Service_Type_Factory const *, ACE_TCHAR *params);
00212
00213 virtual ~ACE_Dynamic_Node (void);
00214
00215
00216 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00217
00218
00219 void dump (void) const;
00220
00221
00222 ACE_ALLOC_HOOK_DECLARE;
00223
00224 private:
00225
00226 ACE_Auto_Ptr<const ACE_Service_Type_Factory> factory_;
00227
00228 private:
00229 ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Node (const ACE_Dynamic_Node&))
00230 ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Node& operator= (const ACE_Dynamic_Node&))
00231 };
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242 class ACE_Stream_Node : public ACE_Parse_Node
00243 {
00244 public:
00245 ACE_Stream_Node (const ACE_Static_Node *, const ACE_Parse_Node *);
00246 virtual ~ACE_Stream_Node (void);
00247
00248 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00249
00250
00251 void dump (void) const;
00252
00253
00254 ACE_ALLOC_HOOK_DECLARE;
00255
00256 private:
00257
00258 const ACE_Static_Node *node_;
00259 const ACE_Parse_Node *mods_;
00260
00261 private:
00262 ACE_UNIMPLEMENTED_FUNC (ACE_Stream_Node (const ACE_Stream_Node&))
00263 ACE_UNIMPLEMENTED_FUNC (ACE_Stream_Node& operator= (const ACE_Stream_Node&))
00264 };
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274 class ACE_Dummy_Node : public ACE_Parse_Node
00275 {
00276 public:
00277 ACE_Dummy_Node (const ACE_Static_Node *, const ACE_Parse_Node *);
00278 ~ACE_Dummy_Node (void);
00279
00280 virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00281
00282
00283 void dump (void) const;
00284
00285
00286 ACE_ALLOC_HOOK_DECLARE;
00287
00288 private:
00289
00290 const ACE_Static_Node *node_;
00291 const ACE_Parse_Node *mods_;
00292
00293 private:
00294 ACE_UNIMPLEMENTED_FUNC (ACE_Dummy_Node (const ACE_Dummy_Node&))
00295 ACE_UNIMPLEMENTED_FUNC (ACE_Dummy_Node& operator= (const ACE_Dummy_Node&))
00296 };
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307 class ACE_Location_Node
00308 {
00309 public:
00310 ACE_Location_Node (void);
00311 const ACE_DLL &dll (void);
00312 const ACE_TCHAR *pathname (void) const;
00313 void pathname (const ACE_TCHAR *h);
00314 int dispose (void) const;
00315
00316 virtual ~ACE_Location_Node (void);
00317 virtual void set_symbol (void *h);
00318
00319
00320
00321 virtual void *symbol (ACE_Service_Gestalt *cfgptr,
00322 int &yyerrno,
00323 ACE_Service_Object_Exterminator * = 0) = 0;
00324
00325
00326 void dump (void) const;
00327
00328
00329 ACE_ALLOC_HOOK_DECLARE;
00330
00331 protected:
00332 int open_dll (int & yyerrno);
00333
00334
00335 const ACE_TCHAR *pathname_;
00336
00337
00338
00339
00340
00341
00342 int must_delete_;
00343
00344
00345 ACE_DLL dll_;
00346
00347
00348 void *symbol_;
00349
00350 private:
00351 ACE_UNIMPLEMENTED_FUNC (ACE_Location_Node (const ACE_Location_Node&))
00352 ACE_UNIMPLEMENTED_FUNC (ACE_Location_Node& operator= (const ACE_Location_Node&))
00353 };
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364 class ACE_Object_Node : public ACE_Location_Node
00365 {
00366 public:
00367 ACE_Object_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *obj_name);
00368 virtual void *symbol (ACE_Service_Gestalt *config,
00369 int &yyerrno,
00370 ACE_Service_Object_Exterminator * = 0);
00371 virtual ~ACE_Object_Node (void);
00372
00373
00374 void dump (void) const;
00375
00376
00377 ACE_ALLOC_HOOK_DECLARE;
00378
00379 private:
00380
00381 const ACE_TCHAR *object_name_;
00382
00383 private:
00384 ACE_UNIMPLEMENTED_FUNC (ACE_Object_Node (const ACE_Object_Node&))
00385 ACE_UNIMPLEMENTED_FUNC (ACE_Object_Node& operator= (const ACE_Object_Node&))
00386 };
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397 class ACE_Function_Node : public ACE_Location_Node
00398 {
00399 public:
00400 ACE_Function_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *func_name);
00401 virtual void *symbol (ACE_Service_Gestalt *config,
00402 int &yyerrno,
00403 ACE_Service_Object_Exterminator *gobbler = 0);
00404 virtual ~ACE_Function_Node (void);
00405
00406
00407 void dump (void) const;
00408
00409
00410 ACE_ALLOC_HOOK_DECLARE;
00411
00412 private:
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431 ACE_TCHAR * make_func_name (ACE_TCHAR const * func_name);
00432
00433 private:
00434
00435
00436 const ACE_TCHAR *function_name_;
00437
00438 private:
00439 ACE_UNIMPLEMENTED_FUNC (ACE_Function_Node (const ACE_Function_Node&))
00440 ACE_UNIMPLEMENTED_FUNC (ACE_Function_Node& operator= (const ACE_Function_Node&))
00441 };
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454 class ACE_Static_Function_Node : public ACE_Location_Node
00455 {
00456 public:
00457 explicit ACE_Static_Function_Node (const ACE_TCHAR *func_name);
00458 virtual void *symbol (ACE_Service_Gestalt *config,
00459 int &yyerrno,
00460 ACE_Service_Object_Exterminator * = 0);
00461 virtual ~ACE_Static_Function_Node (void);
00462
00463
00464 void dump (void) const;
00465
00466
00467 ACE_ALLOC_HOOK_DECLARE;
00468
00469 private:
00470
00471 const ACE_TCHAR *function_name_;
00472
00473 private:
00474 ACE_UNIMPLEMENTED_FUNC (ACE_Static_Function_Node (const ACE_Static_Function_Node&))
00475 ACE_UNIMPLEMENTED_FUNC (ACE_Static_Function_Node& operator= (const ACE_Static_Function_Node&))
00476 };
00477
00478
00479
00480
00481 class ACE_Service_Type_Factory
00482 {
00483 public:
00484 ACE_Service_Type_Factory (ACE_TCHAR const *name,
00485 int type,
00486 ACE_Location_Node *location,
00487 int active);
00488
00489 ~ACE_Service_Type_Factory (void);
00490
00491 ACE_Service_Type *make_service_type (ACE_Service_Gestalt *pcfg) const;
00492
00493 ACE_TCHAR const* name (void) const;
00494
00495
00496 ACE_ALLOC_HOOK_DECLARE;
00497
00498 private:
00499
00500
00501
00502
00503 ACE_UNIMPLEMENTED_FUNC
00504 (ACE_Service_Type_Factory(const ACE_Service_Type_Factory&))
00505
00506 ACE_UNIMPLEMENTED_FUNC
00507 (ACE_Service_Type_Factory& operator=(const ACE_Service_Type_Factory&))
00508
00509 private:
00510 ACE_TString name_;
00511 int type_;
00512 ACE_Auto_Ptr<ACE_Location_Node> location_;
00513 int is_active_;
00514 };
00515
00516 ACE_END_VERSIONED_NAMESPACE_DECL
00517
00518 #endif
00519
00520 #include "ace/post.h"
00521
00522 #endif