diff options
Diffstat (limited to 'comm/OLD/ReqMgr.h')
-rw-r--r-- | comm/OLD/ReqMgr.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/comm/OLD/ReqMgr.h b/comm/OLD/ReqMgr.h new file mode 100644 index 0000000..1b02196 --- /dev/null +++ b/comm/OLD/ReqMgr.h @@ -0,0 +1,81 @@ +/* + * The Unix Channel + * + * by Michel Beaudouin-Lafon + * + * Copyright 1993 + * Centre d'Etudes de la Navigation Aerienne (CENA) + * + * Request management, by Stephane Chatty + * + * $Id$ + * $CurLog$ + */ + +#ifndef ReqMgr_H_ +#define ReqMgr_H_ + +#include "ccu/String.h" +#include "ccu/List.h" +class ofstream; + +class RequestField { +protected: + CcuString Name; + CcuString Type; + CcuString Impl; +public: +inline RequestField (const char* n, const char* t, const char* i) : Name (n), Type (t), Impl (i) {} +inline const char* GetName () const { return Name; } +inline const char* GetType () const { return Type; } +inline const char* GetImpl () const { return Impl; } +}; + +class RequestConstructor { +friend int yyparse (); +protected: + CcuListOf <RequestField> Params; +public: +inline void AddParameter (RequestField& f) { Params.Append (&f); } +inline const CcuListOf <RequestField>& GetParameters () const { return Params; } +}; + +class RequestType { +friend int yyparse (); +protected: + CcuString Name; + CcuListOf <RequestField> Fields; + CcuListOf <RequestField> Getters; + CcuListOf <RequestField> Setters; + CcuListOf <RequestConstructor> Constructors; + +public: +inline RequestType (const char* n) : Name (n) { } +inline void AddField (RequestField* f) { Fields.Append (f); } +inline void AddConstructor (RequestConstructor* f) { Constructors.Append (f); } +inline const char* GetName () const { return Name; } + void Dump (ofstream&); + void DumpHeader (ofstream&); + void DumpSource (ofstream&); +}; + + +class UchReqMgr { +friend int yyparse (); + +protected: + CcuString Name; + CcuListOf <RequestType> Requests; + void SetName (const char*); +inline void Add (RequestType* t) { Requests.Append (t); } + +public: + UchReqMgr (); + ~UchReqMgr (); + void Read (const char*); + void Dump (const char*); + void DumpHeader (const char*); + void DumpSource (const char*); +}; + +#endif /* ReqMgr_H_ */ |