Go to the documentation of this file.00001 #ifndef cdbDAOProxy_H_
00002 #define cdbDAOProxy_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __cplusplus
00033 #error This is a C++ include file and cannot be used from plain C
00034 #endif
00035
00036 #include <string>
00037 #include <map>
00038 #include <vector>
00039
00040 #include <cdbDALS.h>
00041 #include <cdbErrType.h>
00042
00043 namespace cdb {
00044
00048 class CXMLTreeNode
00049 {
00050 public:
00051
00056 CXMLTreeNode( CXMLTreeNode *pParent );
00057
00061 ~CXMLTreeNode();
00062
00067 void getAttributeNames(std::string &names);
00068
00070 std::string m_name;
00071
00073 CXMLTreeNode* m_parent;
00074
00075 typedef std::map<std::string, CXMLTreeNode*> MapStringToNode;
00077 MapStringToNode m_subNodesMap;
00078
00079 typedef std::map<std::string, std::string> MapStringToString;
00081 MapStringToString m_fieldMap;
00082
00083 };
00084
00088 class DAOProxy : public virtual POA_CDB::DAO
00089 {
00090 public:
00091
00095 DAOProxy(const char * nodeName, CDB::DAO_ptr dao);
00096
00101 DAOProxy(const char * nodeName, const char* xml);
00102
00106 virtual ~DAOProxy();
00107
00108
00115 void get_field(const char* name, std::string &value);
00116
00117 typedef std::vector<std::string> VectorString;
00118
00125 static bool split(const std::string& str, VectorString& array);
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 virtual CORBA::Long get_long (const char * propertyName);
00136
00137
00138
00139
00140
00141 virtual CORBA::Double get_double (const char * propertyName);
00142
00143
00144
00145
00146
00147 virtual char * get_string (const char * propertyName );
00148
00149
00150
00151
00152
00153 virtual char * get_field_data (const char * propertyName);
00154
00155
00156
00157
00158
00159 virtual ::CDB::stringSeq * get_string_seq (const char * propertyName);
00160
00161
00162
00163
00164
00165 virtual ::CDB::longSeq * get_long_seq (const char * propertyName);
00166
00167
00168
00169
00170
00171 virtual ::CDB::doubleSeq * get_double_seq (const char * propertyName );
00172
00173 virtual void destroy();
00174
00175 public:
00176
00178 std::string m_nodeName;
00179
00181 std::string m_errorMessage;
00182
00183
00184 protected:
00185
00186 void Start(const char *el, const char **attr);
00187 void End(const char *el);
00188
00189 static void start(void *data, const char *el, const char **attr);
00190 static void end(void *data, const char *el);
00191
00192
00193 protected:
00194
00195
00196 bool m_destroyed;
00197
00198
00199 bool m_inArray;
00200 std::string m_arrayName;
00201 std::string m_arrayContent;
00202
00203
00204 CXMLTreeNode* m_rootNode;
00205 CXMLTreeNode* m_currNode;
00206
00207
00208 CDB::DAO_var m_dao;
00209 };
00210
00211 }
00212
00213 #endif
00214
00215
00216
00217
00218
00219
00220
00221