Rev | Line | |
---|
[170] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | #include <string>
|
---|
| 4 | #include <vector>
|
---|
| 5 |
|
---|
[190] | 6 | #include <jenga/include/common/BoostXmlSupport.h>
|
---|
[170] | 7 |
|
---|
[190] | 8 | #include "Symbol.h"
|
---|
| 9 |
|
---|
[170] | 10 | using namespace std;
|
---|
| 11 |
|
---|
| 12 | class CMethod;
|
---|
| 13 | class UserProc;
|
---|
| 14 |
|
---|
[190] | 15 | class Prototype : public Symbol
|
---|
[170] | 16 | {
|
---|
| 17 | public:
|
---|
| 18 | enum Accessibility{
|
---|
| 19 | None,
|
---|
| 20 | Private,
|
---|
| 21 | Protected,
|
---|
| 22 | Public,
|
---|
| 23 | };
|
---|
| 24 |
|
---|
| 25 | private:
|
---|
| 26 | mutable bool isUsing;
|
---|
| 27 |
|
---|
[200] | 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 |
|
---|
[170] | 38 | public:
|
---|
| 39 |
|
---|
| 40 | Prototype( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
[190] | 41 | : Symbol( namespaceScopes, name )
|
---|
[170] | 42 | , isUsing( false )
|
---|
| 43 | {
|
---|
| 44 | }
|
---|
[190] | 45 | Prototype()
|
---|
| 46 | : Symbol()
|
---|
[170] | 47 | {
|
---|
| 48 | }
|
---|
[190] | 49 | ~Prototype()
|
---|
[170] | 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 | // シンボル比較
|
---|
[192] | 63 | virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const = 0;
|
---|
[170] | 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 | public:
|
---|
| 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.