Line | |
---|
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 | public:
|
---|
29 |
|
---|
30 | Prototype( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
31 | : Symbol( namespaceScopes, name )
|
---|
32 | , isUsing( false )
|
---|
33 | {
|
---|
34 | }
|
---|
35 | Prototype()
|
---|
36 | : Symbol()
|
---|
37 | {
|
---|
38 | }
|
---|
39 | ~Prototype()
|
---|
40 | {
|
---|
41 | }
|
---|
42 |
|
---|
43 | //自身と等しいかどうかを確認
|
---|
44 | bool IsEquals( const Prototype *prototype ) const
|
---|
45 | {
|
---|
46 | if( this == prototype ){
|
---|
47 | return true;
|
---|
48 | }
|
---|
49 | return false;
|
---|
50 | }
|
---|
51 |
|
---|
52 | // シンボル比較
|
---|
53 | virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const = 0;
|
---|
54 | bool IsEqualSymbol( const Prototype &prototype ) const;
|
---|
55 | bool IsEqualSymbol( const string &name ) const;
|
---|
56 |
|
---|
57 | // 利用状況
|
---|
58 | bool IsUsing() const
|
---|
59 | {
|
---|
60 | return isUsing;
|
---|
61 | }
|
---|
62 | void Using() const
|
---|
63 | {
|
---|
64 | isUsing = true;
|
---|
65 | }
|
---|
66 |
|
---|
67 | // XMLシリアライズ用
|
---|
68 | private:
|
---|
69 | friend class boost::serialization::access;
|
---|
70 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
71 | {
|
---|
72 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
|
---|
73 | }
|
---|
74 |
|
---|
75 | };
|
---|
76 |
|
---|
77 | class MemberPrototype
|
---|
78 | {
|
---|
79 | Prototype::Accessibility accessibility;
|
---|
80 | public:
|
---|
81 | MemberPrototype( Prototype::Accessibility accessibility )
|
---|
82 | : accessibility( accessibility )
|
---|
83 | {
|
---|
84 | }
|
---|
85 |
|
---|
86 | Prototype::Accessibility GetAccessibility() const
|
---|
87 | {
|
---|
88 | return accessibility;
|
---|
89 | }
|
---|
90 | void SetAccessibility( Prototype::Accessibility accessibility ){
|
---|
91 | this->accessibility = accessibility;
|
---|
92 | }
|
---|
93 |
|
---|
94 | bool IsNoneAccess() const
|
---|
95 | {
|
---|
96 | return ( accessibility == Prototype::None );
|
---|
97 | }
|
---|
98 | bool IsPrivate() const
|
---|
99 | {
|
---|
100 | return ( accessibility == Prototype::Private );
|
---|
101 | }
|
---|
102 | bool IsProtected() const
|
---|
103 | {
|
---|
104 | return ( accessibility == Prototype::Protected );
|
---|
105 | }
|
---|
106 | bool IsPublic() const
|
---|
107 | {
|
---|
108 | return ( accessibility == Prototype::Public );
|
---|
109 | }
|
---|
110 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.