commore  1.0.6-SNAPSHOT
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Commore.h
1 //
2 // Copyright (c) 2006-2007 Raphael David / CANTOR
3 //
4 
5 
6 #ifndef CMR_CMR_INCLUDED
7 #define CMR_CMR_INCLUDED
8 
9 #include "Compiler.h"
10 #include "Type.h"
11 #include "GlobVar.h"
12 
13 namespace commore
14 {
15  const long CMR_OK = 1;
16  const long CMR_NOOP = 2;
17 
18  const long CMR_GENERIC_ERROR = -1000001;
19  const long CMR_NOT_FOUND = -1000002;
20  const long CMR_NOT_IMPLEMENTED = -1000003;
21 
22  const long CMR_ALREADY_EXIST = -1000004;
23  const long CMR_END_OF_DATA = -1000005;
24  const long CMR_INVALID_ANSWER = -1000006;
25 
26  const long CMR_FIRST_ERROR = CMR_GENERIC_ERROR;
27  const long CMR_LAST_ERROR = -1000099;
28 
29  template <class C> void swap(C& c1, C& c2)
30  {
31  C c = c2;
32  c2 = c1;
33  c1 = c;
34  }
35 
36 
37  //TODO set in correct header(s)
38 #define REQ_CHECK_CONNECTION "cmr.check"
39 #define REQ_CHECK_CONNECTION_RETURN "cmr.check_return"
40 #define REQ_CALL "cmr.call"
41 #define REQ_CALL_RETURN "cmr.call_return"
42 
43 #define REQ_SVC_CLASS "svc_class"
44 #define REQ_SVC_NAME "svc_name"
45 #define REQ_IFACE_NAME "iface_name"
46 
47 #define REQ_ARGS_IN "args_in"
48 #define REQ_TIMESTAMP "cmr.req.timestamp"
49 #define REQ_ARGS_OUT "args_out"
50 #define REQ_SESSION_CONTEXT "session_context"
51 #define REQ_APP_RETURN_VALUE "r" // application return value
52 
53 #define SESSION_CONTEXT_SESSION_ID "session_id"
54 
55 
56  const long COMM_FORMAT_BINARY = 0;
57  const long COMM_FORMAT_ASCII_XML = 1;
58 
59  CMREXD extern int init();
60 }
61 
62 #endif