00001 #ifndef FEE_SERVER_MAP
00002 #define FEE_SERVER_MAP
00003
00004 #include <map>
00005 #include <vector>
00006 #include <string>
00007 #include <stdexcept>
00008 #include "ace/Synch.h"
00009
00010 namespace ztt { namespace dcs {
00011
00021 class FeeServerMap
00022 {
00023 public:
00024
00025 FeeServerMap():xCoor(0),yCoor(0),zCoor(0),mutex(){};
00026
00027 FeeServerMap(int x,int y, int z):mutex(){
00028 if((x<=0)||(y<=0)||(z<=0)){
00029 throw std::logic_error(
00030 "At least one dimension size is zero or below!");
00031 }else{
00032 xCoor = x;
00033 yCoor = y;
00034 zCoor = z;
00035 }
00036 };
00037
00038 FeeServerMap(const FeeServerMap& t):mutex(){
00039 collection = t.collection;
00040 resultSet = t.resultSet;
00041 xCoor = t.xCoor;
00042 yCoor = t.yCoor;
00043 zCoor = t.zCoor;
00044 }
00045
00046 ~FeeServerMap(void){
00047 collection.clear();
00048 resultSet.clear();
00049 mutex.remove();
00050 }
00051
00052 FeeServerMap& operator=(const FeeServerMap& t){
00053 if(this != &t){
00054 collection = t.collection;
00055 resultSet = t.resultSet;
00056 xCoor = t.xCoor;
00057 yCoor = t.yCoor;
00058 zCoor = t.zCoor;
00059 }
00060 return *this;
00061 }
00071 void setFeeServer(std::vector<int> x,std::vector<int> y,std::vector<int> z,std::vector<char*> server,
00072 char* name);
00073 void setFeeServer(int x, int y, int z, std::vector<char*> server, char* name);
00082 std::vector<char*> getFeeServer(int,int,int,char*);
00083
00084 std::vector<char*> getAllFeeServer();
00085
00086 void print() const;
00087 private:
00091 std::map<std::string,std::string> collection;
00095 std::vector<char*> resultSet;
00099 int xCoor;
00100 int yCoor;
00101 int zCoor;
00102
00103 ACE_Mutex mutex;
00104 };
00105
00106 }}
00107 #endif
00108