00001 /* libIXAml - IXA Taldea */ 00002 00003 #ifndef _JOIN_H 00004 #define _JOIN_H 00005 00006 #include "joinid.h" 00007 #include "jointype.h" 00008 #include "target.h" 00009 #include "xmlsimplestruct.h" 00010 #include <string> 00011 #include <vector> 00012 00015 class Join { 00016 JoinId joinId; //joinare identifikadorea 00017 JoinType joinType; //Join mota, zuzena den markatzen du 00018 std::vector<Target> targetV; //Targets-en balioak 00019 00020 void printErrorea(char* msg, XMLSimpleNode* jItem) const; 00021 public: 00022 00024 Join(); 00025 00030 Join(const JoinId & id, const JoinType & type); 00031 00035 Join(const Join & join); 00036 00041 Join & operator= (const Join & join); 00042 00047 bool operator == (const Join & join) const; 00048 00053 bool operator != (const Join & join) const; 00054 00059 bool operator < (const Join & join) const; 00060 00065 bool operator <= (const Join & join) const; 00066 00071 bool operator > (const Join & join) const; 00072 00077 bool operator >= (const Join & join) const; 00078 00082 void putId (const JoinId & id); 00083 00087 void putType (const JoinType & type); 00088 00092 JoinId getId() const; 00093 00097 JoinType getType () const; 00098 00102 void putTargets(const std::vector<Target> & targetV); 00103 00107 void addTarget(const Target & t); 00108 00113 void addTarget(const std::string & name, const Id & id); 00114 00119 void addTarget(const TargetName & tn, const Id & id); 00120 00124 std::vector<Target> getAllTargets() const; 00125 00129 std::vector<Target> getTargets(const TargetName & ) const; 00130 00134 Target getFirstTarget(const TargetName & n) const; 00135 00140 std::vector<Id> getTargetsValue(const TargetName & n) const; 00141 00146 Id getTargetValue(const unsigned int & pos) const; 00147 00152 Id getFirstTargetValue(const TargetName & n) const; 00153 00158 bool contains(const Id & id) const; 00159 00165 bool contains(const TargetName & n, const Id & id) const; 00166 00172 bool contains(const unsigned int & pos, const Id & id) const; 00173 00174 00179 XMLSimpleNode* toXML(XMLSimpleStruct* xmlstruct) const; //Link -> <LINK id=".." targets=".."/> 00180 00184 void init(XMLSimpleNode* joinItem) throw(char*); //<LINK targets="...."/> -> Link 00185 //Salbuespena altxa dezake item-ean 00186 // informazio falda badago 00187 }; 00188 #endif //_JOIN_H