source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/Prototype.h@ 509

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

Symbolクラスをab_commonプロジェクトに移動した。

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