UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
UrcDB1.hpp
1 /* UrcDB1.hpp */
2 /* $Id: UrcDB1.hpp,v 1.3 2006/02/02 07:31:24 ibadm Exp $ */
3 #ifndef __UrcDB1_hpp
4 #define __UrcDB1_hpp
5 
6 #include <ldb/dbnamedefs.h>
7 #include <zm/UrcClient.hpp>
8 #include <zm/UrcServer.hpp>
9 
10 
12 const char UrcDB1access_ro[] = "ro";
13 
15 const char UrcDB1access_rw[] = "rw";
16 
18 const char UrcDB1protocol[] = "UrcDB1";
19 
20 /*
21  * Enumerated DB1 protocol parts
22  */
23 
25 const char UrcDB1appName[] = "UrcDB1appName";
27 const char UrcDB1project[] = "UrcDB1project";
29 const char UrcDB1object[] = "UrcDB1object";
31 const char UrcDB1access[] = "UrcDB1access";
32 
38 const char UrcDB1notifyEnv[] = "UrcDB1notifyClient";
39 
42 const char UrcDB1exactEnv[] = "UrcDB1exactClient";
43 
44 
45 
52 class UrcDB1protoDef : public RecDef
53 {
54 public:
55 
56  UrcDB1protoDef () {
57  DomainSet dset;
58  dset.add_domain(UrcDB1appName, CHAR_1, 32);
59  dset.add_domain(UrcDB1project, CHAR_1, PROJECT_LEN);
60  dset.add_domain(UrcDB1object, CHAR_1, DB_FILE_NAME_LEN);
61  dset.add_domain(UrcDB1access, CHAR_1, 2);
62  RecDef::constructor(UrcDB1protocol, dset);
63  };
64 };
65 
66 
67 #ifdef __UrcDB1_vars
68 #define EXTERN
69 #else
70 #define EXTERN extern
71 #endif /* __UrcDB1_vars */
72 
74 EXTERN UrcDB1protoDef UrcDB1def;
75 
76 #undef EXTERN
77 
78 
84 {
85 public:
86 
89  : protocol(proto) {};
90 
92  void set_app_name (const char* szAppName);
93 
95  void set_db_object (const char* szDbName);
96 
98  void set_db_object (const dbNameStruct& rDbName);
99 
101  void set_project (const char* szProject);
102 
104  void set_access_mode (const char* szMode);
105 
106 private:
107 
109  UrcProtocol *protocol;
110 };
111 
112 
121 {
122 public:
123 
126  UrcDB1Server (Widget wToplevel);
127 
128 };
129 
130 
137 {
138 public:
139 
141  UrcDB1Client (Display* xdisplay);
142 
144  UrcDB1Client (Display* xdisplay, Window wid);
145 
153  UrcDB1Client (Widget wToplevel, long lExact);
154 
157  void prepare_server_env ();
158 
162  virtual Logic select_for_broadcast (Window wid);
163 
166  virtual void good_bye_server (Window wid);
167 
170 
172  virtual Logic match_window (Window wid);
173 
176  virtual Logic match_server ();
177 
178 private:
179 
181  UrcProtocol match_storage;
182 
184  Widget client_toplevel;
185 
187  long client_id;
188 
191  static void notify_handler (Widget w, XtPointer pUserData,
192  XEvent* pEvent,
193  Boolean *bContinueToDispatch);
194 
195 };
196 
197 
198 #endif /* UrcDB1.hpp */
void set_access_mode(const char *szMode)
void add_domain(const char *name, AtomType atype, unsigned dim, CategoryId categ=UC_NONE, void *opt=NULL)
Definition: UrcClient.hpp:20
Definition: dbnamedefs.h:67
Definition: UrcDB1.hpp:136
virtual Logic select_for_broadcast(Window wid)
Definition: UrcDB1.hpp:52
Definition: DmnSet.hpp:32
UrcDB1protoMethods match
Definition: UrcDB1.hpp:169
void constructor(const char *rtname, const DomainAr &dmns)
void set_db_object(const char *szDbName)
Definition: UrcDB1.hpp:120
UrcDB1Server(Widget wToplevel)
void set_project(const char *szProject)
virtual void good_bye_server(Window wid)
void set_app_name(const char *szAppName)
Definition: UrcProtocol.hpp:22
UrcDB1protoMethods(UrcProtocol *proto)
Definition: UrcDB1.hpp:88
UrcDB1Client(Display *xdisplay)
virtual Logic match_window(Window wid)
void prepare_server_env()
Definition: UrcDB1.hpp:83
Definition: UrcServer.hpp:18
Definition: RecDef.hpp:19
virtual Logic match_server()