source: dev/trunk/jenga/include/smoothie/Prototype.h@ 200

Last change on this file since 200 was 200, checked in by dai_9181, 17 years ago
File size: 2.0 KB
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
10using namespace std;
11
12class CMethod;
13class UserProc;
14
15class Prototype : public Symbol
16{
17public:
18 enum Accessibility{
19 None,
20 Private,
21 Protected,
22 Public,
23 };
24
25private:
26 mutable bool isUsing;
27
28
29 // XMLシリアライズ用
30private:
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
38public:
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
78class MemberPrototype
79{
80 Prototype::Accessibility accessibility;
81public:
82 MemberPrototype( Prototype::Accessibility accessibility )
83 : accessibility( accessibility )
84 {
85 }
86
87 Prototype::Accessibility GetAccessibility() const
88 {
89 return accessibility;
90 }
91 void SetAccessibility( Prototype::Accessibility accessibility ){
92 this->accessibility = accessibility;
93 }
94
95 bool IsNoneAccess() const
96 {
97 return ( accessibility == Prototype::None );
98 }
99 bool IsPrivate() const
100 {
101 return ( accessibility == Prototype::Private );
102 }
103 bool IsProtected() const
104 {
105 return ( accessibility == Prototype::Protected );
106 }
107 bool IsPublic() const
108 {
109 return ( accessibility == Prototype::Public );
110 }
111};
Note: See TracBrowser for help on using the repository browser.