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 |
|
---|
| 28 | public:
|
---|
| 29 |
|
---|
| 30 | Prototype( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
[190] | 31 | : Symbol( namespaceScopes, name )
|
---|
[170] | 32 | , isUsing( false )
|
---|
| 33 | {
|
---|
| 34 | }
|
---|
[190] | 35 | Prototype()
|
---|
| 36 | : Symbol()
|
---|
[170] | 37 | {
|
---|
| 38 | }
|
---|
[190] | 39 | ~Prototype()
|
---|
[170] | 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 | bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
|
---|
| 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 |
|
---|
[190] | 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 |
|
---|
[170] | 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.