00001 
00002 
00003 #ifndef _LINK_H
00004 #define _LINK_H
00005 
00006 #include "linkid.h"
00007 #include "lnktype.h"
00008 #include "xmlsimplestruct.h"
00009 #include <vector>
00010 #include <string>
00011 
00014 class Link {
00015   LinkId lnkId;
00016   LnkType lnkType;                           
00017   std::vector<Id> targV;                          
00018 
00019   std::string Link::toXTargets() const ;             
00020   void Link::initTargets(const std::string & targStr); 
00021 
00022 public:
00023   
00025   Link();
00026   
00030   Link(const LnkType & type);     
00031 
00036   Link(const LinkId & id, const LnkType & type);
00037 
00041   Link(const Link & link);
00042 
00047   Link& operator= (const Link & link);
00048 
00053   bool operator == (const Link & link) const;
00054 
00059   bool operator != (const Link & link) const;
00060 
00064   void putId(const LinkId & id);
00065 
00069   void putType (const LnkType & type);
00070 
00075   void putTarget(const unsigned ind , const Id & id);
00076   
00080   void putTargets(const std::vector<Id> & targV);
00081 
00085   LinkId getId() const;
00086   
00090   LnkType getType() const;
00091 
00096   Id getTarget (const unsigned ind) const;
00097 
00101   std::vector <Id> getTargets () const;
00102   
00107   bool contains(const Id & id) const;
00108 
00109   
00115   bool contains(const Id & id, const unsigned ind) const;
00116 
00121   XMLSimpleNode* toXML(XMLSimpleStruct* xmlstruct) const;                
00122 
00126   void init(XMLSimpleNode* linkItem) throw(char*); 
00127                                                        
00128                                                        
00129 };
00130 #endif // _LINK_H