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();
|
---|
32 | ~Parameter();
|
---|
33 |
|
---|
34 | void SetArray( const Subscripts &subscripts ){
|
---|
35 | isArray = true;
|
---|
36 | this->subscripts = subscripts;
|
---|
37 | }
|
---|
38 |
|
---|
39 | const std::string &GetVarName() const
|
---|
40 | {
|
---|
41 | return varName;
|
---|
42 | }
|
---|
43 |
|
---|
44 | bool IsRef() const
|
---|
45 | {
|
---|
46 | return isRef;
|
---|
47 | }
|
---|
48 | bool IsArray(){
|
---|
49 | return isArray;
|
---|
50 | }
|
---|
51 | const Subscripts &GetSubscripts() const
|
---|
52 | {
|
---|
53 | return subscripts;
|
---|
54 | }
|
---|
55 |
|
---|
56 | const std::string &GetInitValue() const
|
---|
57 | {
|
---|
58 | return initValue;
|
---|
59 | }
|
---|
60 |
|
---|
61 | bool Equals( const Parameter ¶m, bool isContravariant ) const;
|
---|
62 | bool Equals( const Types &actualTypeParametersForThisProc, const Parameter ¶m, bool isContravariant ) const;
|
---|
63 | };
|
---|
64 |
|
---|
65 | class Parameters : public std::vector<Parameter *>
|
---|
66 | {
|
---|
67 | // XMLシリアライズ用
|
---|
68 | private:
|
---|
69 | friend class boost::serialization::access;
|
---|
70 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
71 | {
|
---|
72 | trace_for_serialize( "serializing - Parameters" );
|
---|
73 |
|
---|
74 | ar & boost::serialization::make_nvp("vector_Parameter", boost::serialization::base_object<std::vector<Parameter *>>(*this));
|
---|
75 | }
|
---|
76 |
|
---|
77 | public:
|
---|
78 |
|
---|
79 | bool Equals( const Parameters ¶ms, bool isContravariant = false ) const;
|
---|
80 | bool Equals( const Types &actualTypeParametersForThisProc, const Parameters ¶ms, bool isContravariant = false ) const;
|
---|
81 |
|
---|
82 | int GetMemorySize() const
|
---|
83 | {
|
---|
84 | return (int)this->size() * PTR_SIZE;
|
---|
85 | }
|
---|
86 | };
|
---|