00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_VECTORPORTREFERENCE_HPP
00017 #define TORC_GENERIC_OM_VECTORPORTREFERENCE_HPP
00018
00019 #include "torc/generic/om/PointerTypes.hpp"
00020 #include "torc/generic/om/DumpRestoreConfig.hpp"
00021
00022
00023 #ifdef GENOM_SERIALIZATION
00024 #include <boost/serialization/access.hpp>
00025 #endif //GENOM_SERIALIZATION
00026
00027 #include "torc/generic/om/Vector.hpp"
00028 #include "torc/generic/om/PortReference.hpp"
00029 #include "torc/generic/om/FactoryType.hpp"
00030 #include "torc/generic/om/VisitorType.hpp"
00031 #include "torc/generic/util/Error.hpp"
00032 #include "torc/generic/om/Connectable.hpp"
00033 #include "torc/generic/om/VectorPortBitReference.hpp"
00034
00035 namespace torc { namespace generic { class BaseVisitor; } }
00036 namespace torc { namespace generic { class Net; } }
00037
00038 namespace torc {
00039
00040 namespace generic {
00041
00042
00043
00044
00045
00046
00047 class VectorPortReference
00048 : public PortReference,
00049 public Vector<PortReference, VectorPortBitReference,
00050 VectorPortBitReference::Factory, true> {
00051 #ifdef GENOM_SERIALIZATION
00052 friend class boost::serialization::access;
00053 #endif //GENOM_SERIALIZATION
00054
00055 friend class FactoryType<VectorPortReference>;
00056
00057 public:
00058 typedef Vector<PortReference, VectorPortBitReference,
00059 VectorPortBitReference::Factory, true> BaseType;
00060 typedef VisitorType<VectorPortReference> Visitor;
00061
00062
00063
00064
00065 class Factory: public FactoryType<VectorPortReference>
00066 {
00067 public:
00068 using FactoryType<VectorPortReference>::create;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 virtual VectorPortReferenceSharedPtr
00081 newVectorPortReferencePtr( const InstanceSharedPtr &inInstancePtr,
00082 const PortSharedPtr &inPortPtr,
00083 const size_t &inSize,
00084 const PortBundleReferenceSharedPtr &inParentCollection
00085 = PortBundleReferenceSharedPtr(),
00086 const ChildFactorySharedPtr &inFactory
00087 = BaseType::ChildFactorySharedPtr(
00088 new BaseType::ChildFactory() )) throw(Error);
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 virtual VectorPortReferenceSharedPtr
00102 newVectorPortReferencePtr( const InstanceSharedPtr &inInstancePtr,
00103 const PortSharedPtr &inPortPtr,
00104 const std::vector<size_t> &inLimits,
00105 const PortBundleReferenceSharedPtr &inParentCollection = PortBundleReferenceSharedPtr(),
00106 const ChildFactorySharedPtr &inFactory
00107 = BaseType::ChildFactorySharedPtr(
00108 new BaseType::ChildFactory() )) throw(Error);
00109
00110 };
00111
00112 virtual void
00113 accept(BaseVisitor &inoutVisitor) throw(Error);
00114
00115 virtual void
00116 setParent( const InstanceSharedPtr &inParent ) throw();
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 virtual Connectable::Connection
00153 connect(const NetSharedPtr &inNet) throw(Error);
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 void
00174 disconnect( const Connectable::Connection &inConnection
00175 ) throw(Error);
00176
00177 using Connectable::disconnect;
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188 virtual void getConnectedNets(
00189 std::vector< NetSharedPtr > &outNets,
00190 bool inSkipChildConnections = false
00191 ) const throw(Error);
00192
00193 virtual void
00194 onChildCreate(
00195 const VectorPortBitReferenceSharedPtr &inCreatedChild
00196 ) const throw(Error);
00197
00198
00199
00200
00201
00202 virtual void
00203 bindToMasterPort(const PortSharedPtr &inMaster) throw(Error);
00204
00205 ~VectorPortReference() throw();
00206
00207 protected:
00208 VectorPortReference();
00209
00210 private:
00211 #ifdef GENOM_SERIALIZATION
00212 template<class Archive> void
00213 serialize( Archive &ar, unsigned int );
00214 #endif //GENOM_SERIALIZATION
00215
00216 };
00217
00218 }
00219
00220 }
00221 #endif // TORC_GENERIC_OM_VECTORPORTREFERENCE_HPP