summaryrefslogtreecommitdiff
path: root/comm/OLD/ReqMgr.h
diff options
context:
space:
mode:
authorchatty1993-11-29 11:08:19 +0000
committerchatty1993-11-29 11:08:19 +0000
commitd6bd0c0e8e08660606801e846273d4740947d658 (patch)
tree1bd0c7f4eef00d52768b11762274ca5c886ac0af /comm/OLD/ReqMgr.h
parent86bc9bfd4d2915bc50999437619346b9c2114a43 (diff)
downloadivy-league-d6bd0c0e8e08660606801e846273d4740947d658.zip
ivy-league-d6bd0c0e8e08660606801e846273d4740947d658.tar.gz
ivy-league-d6bd0c0e8e08660606801e846273d4740947d658.tar.bz2
ivy-league-d6bd0c0e8e08660606801e846273d4740947d658.tar.xz
Renamed into UchMsgMgr
Heavy additions.
Diffstat (limited to 'comm/OLD/ReqMgr.h')
-rw-r--r--comm/OLD/ReqMgr.h75
1 files changed, 50 insertions, 25 deletions
diff --git a/comm/OLD/ReqMgr.h b/comm/OLD/ReqMgr.h
index 1b02196..811cca7 100644
--- a/comm/OLD/ReqMgr.h
+++ b/comm/OLD/ReqMgr.h
@@ -17,65 +17,90 @@
#include "ccu/String.h"
#include "ccu/List.h"
+#include "ccu/bool.h"
+
class ofstream;
-class RequestField {
+class MsgField {
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 MsgField (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 {
+class MsgConstructor {
friend int yyparse ();
protected:
- CcuListOf <RequestField> Params;
+ CcuListOf <MsgField> Params;
public:
-inline void AddParameter (RequestField& f) { Params.Append (&f); }
-inline const CcuListOf <RequestField>& GetParameters () const { return Params; }
+inline void AddParameter (MsgField& f) { Params.Append (&f); }
+inline const CcuListOf <MsgField>& GetParameters () const { return Params; }
};
-class RequestType {
+class MsgType {
friend int yyparse ();
+
+public:
+ enum msg_kind { isRequest, isAnswer, isEvent };
+static const char* const ClassSuffix [3];
+static const char* const EnumPrefix [3];
+static const char* const EnumSuffix [3];
+
protected:
CcuString Name;
- CcuListOf <RequestField> Fields;
- CcuListOf <RequestField> Getters;
- CcuListOf <RequestField> Setters;
- CcuListOf <RequestConstructor> Constructors;
+ msg_kind Kind;
+ CcuListOf <MsgField> Fields;
+ CcuListOf <MsgField> Getters;
+ CcuListOf <MsgField> Setters;
+ CcuListOf <MsgConstructor> Constructors;
+ bool DefaultConstructor;
+
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 MsgType (const char* n, msg_kind k) : Name (n), Kind (k), DefaultConstructor (FALSE) {}
+inline void AddField (MsgField* f) { Fields.Append (f); }
+inline void AddConstructor (MsgConstructor* f) { Constructors.Append (f); }
+inline void UseDefaultConstructor () { DefaultConstructor = TRUE; }
inline const char* GetName () const { return Name; }
- void Dump (ofstream&);
- void DumpHeader (ofstream&);
- void DumpSource (ofstream&);
+ void DumpDecl (ofstream&, int);
+ void DumpCode (ofstream&, int);
};
+enum destination { isClient = 1<<0, isServer = 1<<1};
-class UchReqMgr {
+class UchMsgMgr {
friend int yyparse ();
protected:
CcuString Name;
- CcuListOf <RequestType> Requests;
+ CcuListOf <MsgType> Requests;
+ CcuListOf <MsgType> Answers;
+ CcuListOf <MsgType> Events;
void SetName (const char*);
-inline void Add (RequestType* t) { Requests.Append (t); }
+inline void AddRequest (MsgType* t) { Requests.Append (t); }
+inline void AddAnswer (MsgType* t) { Answers.Append (t); }
+inline void AddEvent (MsgType* t) { Events.Append (t); }
+ void DumpCode (const char*, int);
+ void DumpDecl (const char*, int);
+ void DumpEnum (ofstream&, MsgType::msg_kind, CcuListOf <MsgType>&);
+ void DumpClientCode (ofstream&);
+ void DumpServerCode (ofstream&);
public:
- UchReqMgr ();
- ~UchReqMgr ();
+ UchMsgMgr ();
+ ~UchMsgMgr ();
void Read (const char*);
- void Dump (const char*);
- void DumpHeader (const char*);
- void DumpSource (const char*);
+ void DumpClientHeader ();
+ void DumpServerHeader ();
+ void DumpClientSource (const char*);
+ void DumpServerSource (const char*);
+inline const char* GetName () const { return Name; }
};
#endif /* ReqMgr_H_ */
+