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