source: dev/trunk/ab5.0/abdev/ab_common/include/Lexical/RelationalObjectModuleItem.h@ 655

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

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

File size: 1.7 KB
Line 
1#pragma once
2
3class ObjectModule;
4
5namespace ActiveBasic{ namespace Common{ namespace Lexical{
6
7
8class RelationalObjectModuleItem
9 : public Symbol
10{
11 int relationalObjectModuleIndex;
12
13 // XMLシリアライズ用
14private:
15 friend class boost::serialization::access;
16 template<class Archive> void serialize(Archive& ar, const unsigned int version)
17 {
18 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
19 ar & BOOST_SERIALIZATION_NVP( relationalObjectModuleIndex );
20 }
21
22public:
23 RelationalObjectModuleItem( const RelationalObjectModuleItem &relationalObjectModuleItem )
24 : Symbol( relationalObjectModuleItem )
25 , relationalObjectModuleIndex( relationalObjectModuleItem.relationalObjectModuleIndex )
26 , isNeedResolve( false )
27 {
28 }
29 RelationalObjectModuleItem( const Symbol &symbol )
30 : Symbol( symbol )
31 , relationalObjectModuleIndex( 0 )
32 , isNeedResolve( false )
33 {
34 }
35 RelationalObjectModuleItem()
36 : relationalObjectModuleIndex( -1 )
37 , isNeedResolve( false )
38 {
39 }
40
41 int GetRelationalObjectModuleIndex() const
42 {
43 return relationalObjectModuleIndex;
44 }
45 void SetRelationalObjectModuleIndex( int relationalObjectModuleIndex )
46 {
47 this->relationalObjectModuleIndex = relationalObjectModuleIndex;
48 }
49
50 virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable )
51 {
52 this->relationalObjectModuleIndex = relationTable[this->relationalObjectModuleIndex];
53 }
54
55 bool IsExternal() const
56 {
57 return ( relationalObjectModuleIndex != 0 );
58 }
59
60 bool isNeedResolve;
61 bool IsNeedResolve() const
62 {
63 return isNeedResolve;
64 }
65 void NeedResolve()
66 {
67 isNeedResolve = true;
68 }
69
70 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) = 0;
71};
72
73
74}}}
Note: See TracBrowser for help on using the repository browser.