1 | #pragma once
|
---|
2 |
|
---|
3 | #include <string>
|
---|
4 | #include <vector>
|
---|
5 |
|
---|
6 | #include <jenga/include/common/BoostXmlSupport.h>
|
---|
7 |
|
---|
8 | #include "Symbol.h"
|
---|
9 |
|
---|
10 | using namespace std;
|
---|
11 |
|
---|
12 | class CMethod;
|
---|
13 | class UserProc;
|
---|
14 |
|
---|
15 | class Prototype : public Symbol
|
---|
16 | {
|
---|
17 | public:
|
---|
18 | enum Accessibility{
|
---|
19 | None,
|
---|
20 | Private,
|
---|
21 | Protected,
|
---|
22 | Public,
|
---|
23 | };
|
---|
24 |
|
---|
25 | private:
|
---|
26 | mutable bool isUsing;
|
---|
27 |
|
---|
28 |
|
---|
29 | // XMLシリアライズ用
|
---|
30 | private:
|
---|
31 | friend class boost::serialization::access;
|
---|
32 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
33 | {
|
---|
34 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
|
---|
35 | }
|
---|
36 |
|
---|
37 |
|
---|
38 | public:
|
---|
39 |
|
---|
40 | Prototype( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
41 | : Symbol( namespaceScopes, name )
|
---|
42 | , isUsing( false )
|
---|
43 | {
|
---|
44 | }
|
---|
45 | Prototype()
|
---|
46 | : Symbol()
|
---|
47 | {
|
---|
48 | }
|
---|
49 | ~Prototype()
|
---|
50 | {
|
---|
51 | }
|
---|
52 |
|
---|
53 | //自身と等しいかどうかを確認
|
---|
54 | bool IsEquals( const Prototype *prototype ) const
|
---|
55 | {
|
---|
56 | if( this == prototype ){
|
---|
57 | return true;
|
---|
58 | }
|
---|
59 | return false;
|
---|
60 | }
|
---|
61 |
|
---|
62 | // シンボル比較
|
---|
63 | virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const = 0;
|
---|
64 | bool IsEqualSymbol( const Prototype &prototype ) const;
|
---|
65 | bool IsEqualSymbol( const string &name ) const;
|
---|
66 |
|
---|
67 | // 利用状況
|
---|
68 | bool IsUsing() const
|
---|
69 | {
|
---|
70 | return isUsing;
|
---|
71 | }
|
---|
72 | void Using() const
|
---|
73 | {
|
---|
74 | isUsing = true;
|
---|
75 | }
|
---|
76 | };
|
---|
77 |
|
---|
78 | class MemberPrototype
|
---|
79 | {
|
---|
80 | Prototype::Accessibility accessibility;
|
---|
81 |
|
---|
82 | // XMLシリアライズ用
|
---|
83 | private:
|
---|
84 | friend class boost::serialization::access;
|
---|
85 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
86 | {
|
---|
87 | ar & BOOST_SERIALIZATION_NVP( accessibility );
|
---|
88 | }
|
---|
89 |
|
---|
90 | public:
|
---|
91 | MemberPrototype( Prototype::Accessibility accessibility )
|
---|
92 | : accessibility( accessibility )
|
---|
93 | {
|
---|
94 | }
|
---|
95 |
|
---|
96 | Prototype::Accessibility GetAccessibility() const
|
---|
97 | {
|
---|
98 | return accessibility;
|
---|
99 | }
|
---|
100 | void SetAccessibility( Prototype::Accessibility accessibility ){
|
---|
101 | this->accessibility = accessibility;
|
---|
102 | }
|
---|
103 |
|
---|
104 | bool IsNoneAccess() const
|
---|
105 | {
|
---|
106 | return ( accessibility == Prototype::None );
|
---|
107 | }
|
---|
108 | bool IsPrivate() const
|
---|
109 | {
|
---|
110 | return ( accessibility == Prototype::Private );
|
---|
111 | }
|
---|
112 | bool IsProtected() const
|
---|
113 | {
|
---|
114 | return ( accessibility == Prototype::Protected );
|
---|
115 | }
|
---|
116 | bool IsPublic() const
|
---|
117 | {
|
---|
118 | return ( accessibility == Prototype::Public );
|
---|
119 | }
|
---|
120 | };
|
---|