Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

DataAccess.hpp

00001 #ifndef ZTT_DCS_DATA_ACCESS_HPP
00002 #define ZTT_DCS_DATA_ACCESS_HPP
00003 
00004 #include <vector>
00005 #include <list>
00006 #include <boost/shared_ptr.hpp>
00007 #include <string>
00008 
00009 
00010 namespace ztt { 
00011         namespace dcs {
00012 
00013 #define DATA_NOT_FOUND -1
00014 
00015 
00022 class DataAccess {
00023         public:
00027                 ~DataAccess();
00028 
00039       /*  int getDataFromFile(char* filename, boost::shared_ptr<char>* data,
00040             int* size);
00041 */
00054          int fillCollectionWithNames(char* tag, std::vector<char* >* collection);
00055                  
00056                  /*
00057                  * Retrieves data from a given filename and returns it via smart pointer
00058                  * 
00059                  *
00060                  * @param tag the name of the file
00061                  * @param collection pointer to vector, which receives the FeeServer /
00062          *          FeeService names.
00063                  */
00064                  int fillCollectionFromFile(char* tag, std::vector<char* >* collection);
00065 
00066                  /*
00067                  * Retrieves the data required for the database from a file and save the 
00068                  * to the corresponding variables 
00069                  *
00070                  * @param tag the name of the file
00071                  * @param server/service pointer to vector, which receives the FeeServer /
00072          *          FeeService names.
00073                  */
00074                  int getDbInfoFromFile(char* tag);
00075                  /*
00076                  *loading property settings
00077                  */
00078                  int loadFiles(std::vector<char* >* server,std::vector<char* >* service);
00079                 /*
00080                 * enable logging of service values
00081                 * required for FeeItemInfo
00082                 */
00083                  bool logging;
00087                  bool grouped;
00088                  int valueselect;
00089                  int xValue;
00090                  int yValue;
00091                  int zValue;
00092                 /*
00093                 * the Singleton function 
00094                 */
00095                  static DataAccess* createDataAccess();
00096                 /* Set the configuration directory.  Must end in a
00097                  * slash '/'.  
00098                  * @param dir Directory
00099                  */
00100                 void setConfigDir(const std::string& dir) { configDir = dir; }
00101                 /*
00102                 * save the username for db connection
00103                 * !!!check if const is better!!!
00104                 */
00105                  std::string userName;
00106                 /*
00107                 * save the password for db connection
00108                 */
00109                  std::string password;
00110                 /*
00111                 * save the databasename for db connection
00112                 */
00113                  std::string database;
00114                 /*
00115                 * variables to save the given tablenames
00116                 */
00117                 std::list<char*> tablenameServer;
00118                 std::list<char*> tablenameService;
00119                 //char* groupingCriteria;
00120 
00121                 std::vector<int> posX;
00122                 std::vector<int> posY;
00123                 std::vector<int> posZ;
00124 
00125 #ifndef __UTEST
00126         private:
00127 #endif
00128 
00131                 DataAccess();
00132                 /*
00133                 * save the content of db property file
00134                 */
00135                 std::vector<char *> dbOptions;
00136                 /*
00137                  * Configuration directory 
00138                  */ 
00139                 std::string configDir;
00140   
00141 };  // end of class
00142 
00143 } } // end of namespace
00144 
00145 
00146 #endif

Generated on Fri Mar 30 02:54:33 2007 for InterComLayer by doxygen 1.3.5