[193] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | class TypeDefCollection;
|
---|
| 4 |
|
---|
[637] | 5 | class TypeDef
|
---|
| 6 | : public RelationalObjectModuleItem
|
---|
[206] | 7 | {
|
---|
[193] | 8 | friend TypeDefCollection;
|
---|
| 9 |
|
---|
[523] | 10 | std::string baseName;
|
---|
[193] | 11 | Type baseType;
|
---|
[206] | 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 |
|
---|
[637] | 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 |
|
---|
[206] | 31 | ar & BOOST_SERIALIZATION_NVP( baseName );
|
---|
| 32 | ar & BOOST_SERIALIZATION_NVP( baseType );
|
---|
| 33 | }
|
---|
| 34 |
|
---|
[193] | 35 | public:
|
---|
[637] | 36 | TypeDef( const Symbol &symbol, const std::string &baseName, const Type &baseType );
|
---|
[206] | 37 | TypeDef()
|
---|
[193] | 38 | {
|
---|
| 39 | }
|
---|
[206] | 40 | ~TypeDef()
|
---|
| 41 | {
|
---|
| 42 | }
|
---|
| 43 |
|
---|
[816] | 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 |
|
---|
[523] | 71 | const std::string &GetBaseName() const
|
---|
[193] | 72 | {
|
---|
| 73 | return baseName;
|
---|
| 74 | }
|
---|
| 75 | const Type &GetBaseType() const
|
---|
| 76 | {
|
---|
| 77 | return baseType;
|
---|
| 78 | }
|
---|
[637] | 79 |
|
---|
[640] | 80 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[193] | 81 | };
|
---|
| 82 |
|
---|
[206] | 83 | class TypeDefCollection : public std::vector<TypeDef>
|
---|
[193] | 84 | {
|
---|
[206] | 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 |
|
---|
[193] | 96 | public:
|
---|
| 97 | TypeDefCollection();
|
---|
[816] | 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 | }
|
---|
[193] | 109 | ~TypeDefCollection();
|
---|
| 110 |
|
---|
[637] | 111 | void Add( const Symbol &symbol, const std::string &baseName, int nowLine );
|
---|
[632] | 112 | const TypeDef *Find( const Symbol &symbol ) const;
|
---|
[193] | 113 | };
|
---|