1 | #pragma once
|
---|
2 |
|
---|
3 | class TypeDefCollection;
|
---|
4 |
|
---|
5 | class TypeDef
|
---|
6 | : public RelationalObjectModuleItem
|
---|
7 | {
|
---|
8 | friend TypeDefCollection;
|
---|
9 |
|
---|
10 | std::string baseName;
|
---|
11 | Type baseType;
|
---|
12 |
|
---|
13 | // XMLシリアライズ用
|
---|
14 | private:
|
---|
15 | friend class boost::serialization::access;
|
---|
16 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
17 | {
|
---|
18 | trace_for_serialize( "serializing - TypeDef" );
|
---|
19 |
|
---|
20 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
|
---|
21 |
|
---|
22 | if( ActiveBasic::Common::Environment::IsRemoveExternal() )
|
---|
23 | {
|
---|
24 | if( this->IsExternal() )
|
---|
25 | {
|
---|
26 | this->NeedResolve();
|
---|
27 | return;
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 | ar & BOOST_SERIALIZATION_NVP( baseName );
|
---|
32 | ar & BOOST_SERIALIZATION_NVP( baseType );
|
---|
33 | }
|
---|
34 |
|
---|
35 | public:
|
---|
36 | TypeDef( const Symbol &symbol, const std::string &baseName, const Type &baseType );
|
---|
37 | TypeDef()
|
---|
38 | {
|
---|
39 | }
|
---|
40 | ~TypeDef()
|
---|
41 | {
|
---|
42 | }
|
---|
43 |
|
---|
44 | TypeDef(TypeDef&& y)
|
---|
45 | : RelationalObjectModuleItem(std::move(y))
|
---|
46 | , baseName(std::move(y.baseName))
|
---|
47 | , baseType(std::move(y.baseType))
|
---|
48 | {
|
---|
49 | }
|
---|
50 |
|
---|
51 | TypeDef(TypeDef const& y)
|
---|
52 | : RelationalObjectModuleItem(y)
|
---|
53 | , baseName(y.baseName)
|
---|
54 | , baseType(y.baseType)
|
---|
55 | {
|
---|
56 | }
|
---|
57 |
|
---|
58 | TypeDef& operator =(TypeDef&& y)
|
---|
59 | {
|
---|
60 | RelationalObjectModuleItem::operator =(std::move(y));
|
---|
61 | baseName = std::move(y.baseName);
|
---|
62 | baseType = std::move(y.baseType);
|
---|
63 | return *this;
|
---|
64 | }
|
---|
65 |
|
---|
66 | TypeDef& operator =(TypeDef const& y)
|
---|
67 | {
|
---|
68 | return *this = std::move(TypeDef(y));
|
---|
69 | }
|
---|
70 |
|
---|
71 | const std::string &GetBaseName() const
|
---|
72 | {
|
---|
73 | return baseName;
|
---|
74 | }
|
---|
75 | const Type &GetBaseType() const
|
---|
76 | {
|
---|
77 | return baseType;
|
---|
78 | }
|
---|
79 |
|
---|
80 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
81 | };
|
---|
82 |
|
---|
83 | class TypeDefCollection : public std::vector<TypeDef>
|
---|
84 | {
|
---|
85 | // XMLシリアライズ用
|
---|
86 | private:
|
---|
87 | friend class boost::serialization::access;
|
---|
88 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
89 | {
|
---|
90 | trace_for_serialize( "serializing - TypeDefCollection" );
|
---|
91 |
|
---|
92 | ar & boost::serialization::make_nvp("vector_TypeDef",
|
---|
93 | boost::serialization::base_object<std::vector<TypeDef>>(*this));
|
---|
94 | }
|
---|
95 |
|
---|
96 | public:
|
---|
97 | TypeDefCollection();
|
---|
98 | TypeDefCollection(TypeDefCollection&& y) : std::vector<TypeDef>(std::move(y)) {}
|
---|
99 | TypeDefCollection(TypeDefCollection const& y) : std::vector<TypeDef>(y) {}
|
---|
100 | TypeDefCollection& operator =(TypeDefCollection&& y)
|
---|
101 | {
|
---|
102 | std::vector<TypeDef>::operator =(std::move(y));
|
---|
103 | return *this;
|
---|
104 | }
|
---|
105 | TypeDefCollection& operator =(TypeDefCollection const& y)
|
---|
106 | {
|
---|
107 | return *this = std::move(TypeDefCollection(y));
|
---|
108 | }
|
---|
109 | ~TypeDefCollection();
|
---|
110 |
|
---|
111 | void Add( const Symbol &symbol, const std::string &baseName, int nowLine );
|
---|
112 | const TypeDef *Find( const Symbol &symbol ) const;
|
---|
113 | };
|
---|