[829] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | class Parameter : public Type
|
---|
| 4 | {
|
---|
| 5 | std::string varName;
|
---|
| 6 | bool isRef;
|
---|
| 7 | bool isArray;
|
---|
| 8 | Subscripts subscripts;
|
---|
| 9 |
|
---|
| 10 | std::string initValue;
|
---|
| 11 |
|
---|
| 12 | // XMLシリアライズ用
|
---|
| 13 | private:
|
---|
| 14 | friend class boost::serialization::access;
|
---|
| 15 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 16 | {
|
---|
| 17 | trace_for_serialize( "serializing - Parameter" );
|
---|
| 18 |
|
---|
| 19 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Type );
|
---|
| 20 | ar & BOOST_SERIALIZATION_NVP( varName );
|
---|
| 21 | ar & BOOST_SERIALIZATION_NVP( isRef );
|
---|
| 22 | ar & BOOST_SERIALIZATION_NVP( isArray );
|
---|
| 23 | ar & BOOST_SERIALIZATION_NVP( subscripts );
|
---|
| 24 | ar & BOOST_SERIALIZATION_NVP( initValue );
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public:
|
---|
| 28 | Parameter( const std::string &varName, const Type &type, bool isRef = false, const std::string initValue = "" );
|
---|
| 29 | Parameter( const Parameter ¶m, const Type &type );
|
---|
| 30 | Parameter( const Parameter ¶m );
|
---|
| 31 | Parameter(Parameter&& param)
|
---|
| 32 | : varName(std::move(param.varName))
|
---|
| 33 | , isRef(std::move(param.isRef))
|
---|
| 34 | , isArray(std::move(param.isArray))
|
---|
| 35 | , subscripts(std::move(param.subscripts))
|
---|
| 36 | , initValue(std::move(param.initValue)) {}
|
---|
| 37 | Parameter();
|
---|
| 38 | ~Parameter();
|
---|
| 39 |
|
---|
| 40 | Parameter& operator =(Parameter&& y)
|
---|
| 41 | {
|
---|
| 42 | varName = std::move(y.varName);
|
---|
| 43 | isRef = std::move(y.isRef);
|
---|
| 44 | isArray = std::move(y.isArray);
|
---|
| 45 | subscripts = std::move(y.subscripts);
|
---|
| 46 | initValue = std::move(y.initValue);
|
---|
| 47 | return *this;
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | Parameter& operator =(Parameter const& y)
|
---|
| 51 | {
|
---|
| 52 | return *this = std::move(Parameter(y));
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | void SetArray( const Subscripts &subscripts ){
|
---|
| 56 | isArray = true;
|
---|
| 57 | this->subscripts = subscripts;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | const std::string &GetVarName() const
|
---|
| 61 | {
|
---|
| 62 | return varName;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | bool IsRef() const
|
---|
| 66 | {
|
---|
| 67 | return isRef;
|
---|
| 68 | }
|
---|
| 69 | bool IsArray() const
|
---|
| 70 | {
|
---|
| 71 | return isArray;
|
---|
| 72 | }
|
---|
| 73 | const Subscripts &GetSubscripts() const
|
---|
| 74 | {
|
---|
| 75 | return subscripts;
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | const std::string &GetInitValue() const
|
---|
| 79 | {
|
---|
| 80 | return initValue;
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | bool Equals( const Parameter ¶m, bool isContravariant ) const;
|
---|
| 84 | bool Equals( const Types &actualTypeParametersForThisProc, const Parameter ¶m, bool isContravariant ) const;
|
---|
| 85 | };
|
---|
| 86 |
|
---|
| 87 | class Parameters : public std::vector<Parameter *>
|
---|
| 88 | {
|
---|
| 89 | // XMLシリアライズ用
|
---|
| 90 | private:
|
---|
| 91 | friend class boost::serialization::access;
|
---|
| 92 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 93 | {
|
---|
| 94 | trace_for_serialize( "serializing - Parameters" );
|
---|
| 95 |
|
---|
| 96 | ar & boost::serialization::make_nvp("vector_Parameter", boost::serialization::base_object<std::vector<Parameter *>>(*this));
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | public:
|
---|
| 100 | Parameters() : std::vector<Parameter *>() {}
|
---|
| 101 | Parameters(Parameters&& y) : std::vector<Parameter *>(std::move(y)) {}
|
---|
| 102 | Parameters(Parameters const& y) : std::vector<Parameter *>(y) {}
|
---|
| 103 |
|
---|
| 104 | Parameters& operator =(Parameters&& y)
|
---|
| 105 | {
|
---|
| 106 | std::vector<Parameter *>::operator =(std::move(y));
|
---|
| 107 | return *this;
|
---|
| 108 | }
|
---|
| 109 |
|
---|
| 110 | Parameters& operator =(Parameters const& y)
|
---|
| 111 | {
|
---|
| 112 | return *this = std::move(Parameters(y));
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | bool Equals( const Parameters ¶ms, bool isContravariant = false ) const;
|
---|
| 116 | bool Equals( const Types &actualTypeParametersForThisProc, const Parameters ¶ms, bool isContravariant = false ) const;
|
---|
| 117 |
|
---|
| 118 | int GetMemorySize() const
|
---|
| 119 | {
|
---|
| 120 | return (int)this->size() * PTR_SIZE;
|
---|
| 121 | }
|
---|
| 122 | };
|
---|