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