00001 #ifndef CONNJOINT_H
00002 #define CONNJOINT_H
00003
00004 #include "Any.h"
00005 #include "RoleRep.h"
00006 #include "PointerItem.h"
00007 #include "FCO.h"
00008 #include "Method.h"
00009
00010 class Sheet;
00011 class ConnectionRep;
00012
00013 #include "list"
00014
00015 class ConnJoint
00016 {
00017 public:
00018 typedef std::vector< FCO *> SDList;
00019 typedef std::vector< FCO *>::iterator SDList_Iterator;
00020 typedef std::vector< FCO *>::const_iterator SDList_ConstIterator;
00021
00022 typedef std::vector< PointerItem> PointerItemSeries;
00023 typedef std::vector< PointerItem>::iterator PointerItemSeries_Iterator;
00024 typedef std::vector< PointerItem>::const_iterator PointerItemSeries_ConstIterator;
00025
00026 typedef const ModelRep* Key;
00027 typedef std::map< Key, PointerItemSeries> TargetMap;
00028 typedef TargetMap::iterator TargetMap_Iterator;
00029
00030 public:
00031 static std::string m_srcLabel;
00032 static std::string m_dstLabel;
00033
00034 ConnJoint(
00035 ConnectionRep *, const SDList& op1, const SDList& op2, bool bidirect,
00036 std::string card1 = "", std::string card2 = ""
00037 );
00038 ConnJoint( const ConnJoint& peer);
00039 const ConnJoint& operator=( const ConnJoint& peer);
00040 ~ConnJoint();
00041
00042 void setConnectionPtr( ConnectionRep * conn_ptr);
00043
00044 const SDList& getOp1() const;
00045 const SDList& getOp2() const;
00046 bool isBidirect() const;
00047
00048 void intInherit( ModelRep * mod_ptr);
00049
00050
00051 void addTargetItem( int i, const ModelRep * model, const PointerItem& item);
00052 void addTargetItem( int i, const ModelRep * model, const RoleRep & new_role);
00053 void addTargetItem( int i, const ModelRep * model, const RoleRep::RoleRepSeries & new_role_series);
00054
00055 bool checkElements( std::string connection_name);
00056
00057 bool calcLCD();
00058
00059 bool createLinkGetters();
00060 bool createSrcDstGetters();
00061 bool createEndGetters();
00062
00063 protected:
00064
00065
00066
00067 ConnectionRep * m_connPtr;
00068
00069
00070 SDList m_oper1;
00071 SDList m_oper2;
00072
00073
00074 TargetMap m_oper1TargetMap;
00075 TargetMap m_oper2TargetMap;
00076
00077
00078 bool m_bidirect;
00079
00080
00081 std::string m_oper1Card;
00082 std::string m_oper2Card;
00083
00084
00085 SDList m_srcLCD;
00086 SDList m_dstLCD;
00087
00088
00089
00090 bool m_oper1IsAnyReferencePort;
00091 bool m_oper2IsAnyReferencePort;
00092 };
00093
00094 #endif //CONNJOINT_H