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
RevLine 
[193]1#pragma once
2
3class TypeDefCollection;
4
[637]5class TypeDef
6 : public RelationalObjectModuleItem
[206]7{
[193]8 friend TypeDefCollection;
9
[523]10 std::string baseName;
[193]11 Type baseType;
[206]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
[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]35public:
[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
53 virtual bool Resolve();
[193]54};
55
[206]56class TypeDefCollection : public std::vector<TypeDef>
[193]57{
[206]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
[193]69public:
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};
Note: See TracBrowser for help on using the repository browser.