[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 |
|
---|
[523] | 44 | const std::string &GetBaseName() const
|
---|
[193] | 45 | {
|
---|
| 46 | return baseName;
|
---|
| 47 | }
|
---|
| 48 | const Type &GetBaseType() const
|
---|
| 49 | {
|
---|
| 50 | return baseType;
|
---|
| 51 | }
|
---|
[637] | 52 |
|
---|
[640] | 53 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[193] | 54 | };
|
---|
| 55 |
|
---|
[206] | 56 | class TypeDefCollection : public std::vector<TypeDef>
|
---|
[193] | 57 | {
|
---|
[206] | 58 | // XMLシリアライズ用
|
---|
| 59 | private:
|
---|
| 60 | friend class boost::serialization::access;
|
---|
| 61 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 62 | {
|
---|
| 63 | trace_for_serialize( "serializing - TypeDefCollection" );
|
---|
| 64 |
|
---|
| 65 | ar & boost::serialization::make_nvp("vector_TypeDef",
|
---|
| 66 | boost::serialization::base_object<std::vector<TypeDef>>(*this));
|
---|
| 67 | }
|
---|
| 68 |
|
---|
[193] | 69 | public:
|
---|
| 70 | TypeDefCollection();
|
---|
| 71 | ~TypeDefCollection();
|
---|
| 72 |
|
---|
[637] | 73 | void Add( const Symbol &symbol, const std::string &baseName, int nowLine );
|
---|
[632] | 74 | const TypeDef *Find( const Symbol &symbol ) const;
|
---|
[193] | 75 | };
|
---|