00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_PARAMETERARRAY_HPP
00017 #define TORC_GENERIC_OM_PARAMETERARRAY_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/util/Error.hpp"
00028 #include "torc/generic/om/FactoryType.hpp"
00029 #include "torc/generic/om/Parameter.hpp"
00030 #include "torc/generic/om/ParameterArrayElement.hpp"
00031 #include "torc/generic/om/Vector.hpp"
00032 #include "torc/generic/om/VisitorType.hpp"
00033
00034 namespace torc { namespace generic { class BaseVisitor; } }
00035
00036 namespace torc {
00037
00038 namespace generic {
00039
00040
00041
00042
00043
00044
00045 class ParameterArray :
00046 public Parameter,
00047 public Vector<Parameter,
00048 ParameterArrayElement,
00049 ParameterArrayElement::Factory,
00050 false> {
00051 #ifdef GENOM_SERIALIZATION
00052 friend class boost::serialization::access;
00053 #endif //GENOM_SERIALIZATION
00054
00055 friend class FactoryType<ParameterArray>;
00056
00057 public:
00058 typedef Vector<Parameter, ParameterArrayElement,
00059 ParameterArrayElement::Factory, false> BaseVectorType;
00060 typedef VisitorType<ParameterArray> Visitor;
00061
00062
00063
00064
00065 class Factory: public FactoryType<ParameterArray>
00066 {
00067 public:
00068 using FactoryType<ParameterArray>::create;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 virtual ParameterArraySharedPtr
00080 newParameterArrayPtr( const std::string &inName,
00081 const size_t &inSize,
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 virtual ParameterArraySharedPtr
00098 newParameterArrayPtr( const std::string &inName,
00099 const std::vector<size_t> &inLimits,
00100 const ChildFactorySharedPtr &inFactory
00101 = BaseVectorType::ChildFactorySharedPtr(
00102 new BaseVectorType::ChildFactory() ),
00103 const std::string &inOriginalName = std::string() ) throw(Error);
00104 };
00105
00106 virtual
00107 ~ParameterArray() throw();
00108
00109
00110
00111
00112
00113
00114
00115 virtual void
00116 accept(BaseVisitor & inoutVisitor) throw(Error);
00117
00118 protected:
00119 virtual void
00120 onChildCreate( const boost::shared_ptr<BaseVectorType::ChildType> &inCreatedChild
00121 ) const throw(Error);
00122
00123 ParameterArray();
00124
00125 private:
00126 #ifdef GENOM_SERIALIZATION
00127 template<class Archive> void
00128 serialize( Archive &ar, unsigned int);
00129 #endif //GENOM_SERIALIZATION
00130 };
00131
00132 }
00133
00134 }
00135 #endif // TORC_GENERIC_OM_PARAMETERARRAY_HPP