source: dev/trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h@ 637

Last change on this file since 637 was 637, checked in by dai_9181, 16 years ago

リンカの依存関係解決モジュールを製作中

File size: 1.6 KB
Line 
1#pragma once
2
3class TypeDefCollection;
4
5class TypeDef
6 : public RelationalObjectModuleItem
7{
8 friend TypeDefCollection;
9
10 std::string baseName;
11 Type baseType;
12
13 // XMLシリアライズ用
14private:
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
35public:
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();
54};
55
56class TypeDefCollection : public std::vector<TypeDef>
57{
58 // XMLシリアライズ用
59private:
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
69public:
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};
Note: See TracBrowser for help on using the repository browser.