/* * 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 Params; public: inline void AddParameter (RequestField& f) { Params.Append (&f); } inline const CcuListOf & GetParameters () const { return Params; } }; class RequestType { friend int yyparse (); protected: CcuString Name; CcuListOf Fields; CcuListOf Getters; CcuListOf Setters; CcuListOf 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 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_ */