00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef LINK_H
00019 #define LINK_H
00020 #include "Leg.h"
00021 #include "SimLink.h"
00022 #include "SimLinkedLeg.h"
00023 #include "Molecule.h"
00024
00025
00026 #ifndef LEGLINK
00027 class SimLink;
00028 #endif
00029
00030 namespace API {
00031 class Edge;
00032 class Leg;
00033 class Molecule;
00044 class Link
00045 {
00046 class Util;
00047 friend class Util;
00048
00049 public:
00057 class Util {
00058 friend class Link;
00059 private:
00060 #ifndef LEGLINK
00061 SimLink * slink;
00062 #endif
00063 #ifdef LEGLINK
00064 SimLinkedLeg * slink;
00065 #endif
00066
00067 Link * link;
00068 Util(Link * link);
00069 ~Util();
00070 public:
00071
00075 void print() const;
00076 #ifndef LEGLINK
00077
00083 SimLink * getSimulatedObject() const;
00084 #endif
00085 #ifdef LEGLINK
00086 SimLinkedLeg * getSimulatedObject() const;
00087 #endif
00088 };
00089
00094 Util * util;
00095
00096 private:
00097 Leg * leg1;
00098 Leg * leg2;
00099 Molecule * molecule;
00100
00101 public:
00107 Molecule * getMolecule() const;
00108
00109
00114 Leg * getLeg1() const;
00115
00120 Leg * getLeg2() const;
00121
00128 bool isUsing(Leg * aLeg) const;
00129
00136 Leg * getOtherLeg(Leg * aLeg) const;
00137
00141 void swap();
00142
00143 protected:
00144
00151 Link(Leg * aLeg, Leg * anotherLeg);
00152
00157 ~Link();
00158
00163 void setMolecule(Molecule * aMolecule);
00164
00165 friend class Leg;
00166
00167 };
00168 }
00169 #endif