00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_VECTORPORT_HPP
00017 #define TORC_GENERIC_OM_VECTORPORT_HPP
00018
00019 #include "torc/generic/om/PointerTypes.hpp"
00020 #include "torc/generic/om/DumpRestoreConfig.hpp"
00021
00022 #ifdef GENOM_SERIALIZATION
00023 #include <boost/serialization/access.hpp>
00024 #endif //GENOM_SERIALIZATION
00025
00026 #include "torc/generic/om/Port.hpp"
00027 #include "torc/generic/om/Vector.hpp"
00028 #include "torc/generic/om/VisitorType.hpp"
00029 #include "torc/generic/om/FactoryType.hpp"
00030 #include "torc/generic/om/Connectable.hpp"
00031 #include "torc/generic/util/Error.hpp"
00032 #include "torc/generic/om/VectorPortBit.hpp"
00033
00034 namespace torc { namespace generic { class Net; } }
00035 namespace torc { namespace generic { class BaseVisitor; } }
00036
00037 namespace torc {
00038
00039 namespace generic {
00040
00041
00042
00043
00044
00045
00046 class VectorPort
00047 : public Port,
00048 public Vector<Port, VectorPortBit,
00049 VectorPortBit::Factory, true>
00050 {
00051 #ifdef GENOM_SERIALIZATION
00052 friend class boost::serialization::access;
00053 #endif //GENOM_SERIALIZATION
00054
00055 friend class FactoryType<VectorPort>;
00056
00057 public:
00058 typedef Vector<Port, VectorPortBit,
00059 VectorPortBit::Factory, true> BaseVectorType;
00060
00061 typedef VisitorType<VectorPort> Visitor;
00062
00063
00064
00065
00066 class Factory: public FactoryType<VectorPort>
00067 {
00068 public:
00069 using FactoryType<VectorPort>::create;
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 virtual VectorPortSharedPtr
00084 newVectorPortPtr( const std::string &inName,
00085 const PortDirection &inDirection,
00086 const ViewSharedPtr &inViewPtr,
00087 const size_t &inSize,
00088 const PortBundleSharedPtr &inParentCollection = PortBundleSharedPtr(),
00089 const ChildFactorySharedPtr &inFactory
00090 = BaseVectorType::ChildFactorySharedPtr(
00091 new BaseVectorType::ChildFactory() ),
00092 const std::string &inOriginalName = std::string()) throw(Error);
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 virtual VectorPortSharedPtr
00107 newVectorPortPtr( const std::string &inName,
00108 const PortDirection &inDirection,
00109 const ViewSharedPtr &inViewPtr,
00110 const std::vector<size_t> &inLimits,
00111 const PortBundleSharedPtr &inParentCollection = PortBundleSharedPtr(),
00112 const ChildFactorySharedPtr &inFactory
00113 = BaseVectorType::ChildFactorySharedPtr(
00114 new BaseVectorType::ChildFactory() ),
00115 const std::string &inOriginalName = std::string()) throw(Error);
00116 };
00117
00118 virtual void
00119 setParent( const ViewSharedPtr &inParent ) throw();
00120
00121 virtual void
00122 accept(BaseVisitor &inoutVisitor) throw(Error);
00123
00124 virtual Connectable::Connection
00125 connect(const NetSharedPtr &inNet) throw(Error);
00126
00127 using Connectable::disconnect;
00128
00129 void
00130 disconnect(
00131 const Connectable::Connection &inConnection
00132 ) throw(Error);
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 virtual void getConnectedNets(
00143 std::vector< NetSharedPtr > &outNets,
00144 bool inSkipChildConnections = false
00145 ) const throw(Error);
00146
00147 virtual
00148 ~VectorPort() throw();
00149
00150 protected:
00151 virtual void
00152 onChildCreate( const boost::shared_ptr<BaseVectorType::ChildType> &inCreatedChild
00153 ) const throw(Error);
00154
00155 VectorPort();
00156
00157 private:
00158 #ifdef GENOM_SERIALIZATION
00159 template<class Archive> void
00160 serialize( Archive &ar, unsigned int );
00161 #endif //GENOM_SERIALIZATION
00162
00163 };
00164
00165 }
00166
00167 }
00168 #endif // TORC_GENERIC_OM_VECTORPORT_HPP