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 | const std::string &GetBaseName() const
|
---|
45 | {
|
---|
46 | return baseName;
|
---|
47 | }
|
---|
48 | const Type &GetBaseType() const
|
---|
49 | {
|
---|
50 | return baseType;
|
---|
51 | }
|
---|
52 |
|
---|
53 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
54 | };
|
---|
55 |
|
---|
56 | class TypeDefCollection : public std::vector<TypeDef>
|
---|
57 | {
|
---|
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 |
|
---|
69 | public:
|
---|
70 | TypeDefCollection();
|
---|
71 | ~TypeDefCollection();
|
---|
72 |
|
---|
73 | void Add( const Symbol &symbol, const std::string &baseName, int nowLine );
|
---|
74 | const TypeDef *Find( const Symbol &symbol ) const;
|
---|
75 | };
|
---|