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