Last change
on this file since 224 was 215, checked in by dai_9181, 17 years ago |
BoostSerializationSupportのクラステンプレートインスタンスを明示的に生成するようにした(コンパイル時間の短縮)
|
File size:
2.0 KB
|
Rev | Line | |
---|
[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 );
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | public:
|
---|
| 36 |
|
---|
| 37 | Prototype( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
| 38 | : Symbol( namespaceScopes, name )
|
---|
| 39 | , isUsing( false )
|
---|
| 40 | {
|
---|
| 41 | }
|
---|
| 42 | Prototype()
|
---|
| 43 | : Symbol()
|
---|
| 44 | {
|
---|
| 45 | }
|
---|
| 46 | ~Prototype()
|
---|
| 47 | {
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | //自身と等しいかどうかを確認
|
---|
| 51 | bool IsEquals( const Prototype *prototype ) const
|
---|
| 52 | {
|
---|
| 53 | if( this == prototype ){
|
---|
| 54 | return true;
|
---|
| 55 | }
|
---|
| 56 | return false;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | // 利用状況
|
---|
| 60 | bool IsUsing() const
|
---|
| 61 | {
|
---|
| 62 | return isUsing;
|
---|
| 63 | }
|
---|
| 64 | void Using() const
|
---|
| 65 | {
|
---|
| 66 | isUsing = true;
|
---|
| 67 | }
|
---|
| 68 | };
|
---|
| 69 |
|
---|
| 70 | class MemberPrototype
|
---|
| 71 | {
|
---|
| 72 | Prototype::Accessibility accessibility;
|
---|
| 73 |
|
---|
| 74 | // XMLシリアライズ用
|
---|
| 75 | private:
|
---|
| 76 | friend class boost::serialization::access;
|
---|
| 77 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 78 | {
|
---|
| 79 | ar & BOOST_SERIALIZATION_NVP( accessibility );
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | public:
|
---|
| 83 | MemberPrototype( Prototype::Accessibility accessibility )
|
---|
| 84 | : accessibility( accessibility )
|
---|
| 85 | {
|
---|
| 86 | }
|
---|
| 87 | MemberPrototype()
|
---|
| 88 | : accessibility( Prototype::None )
|
---|
| 89 | {
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | Prototype::Accessibility GetAccessibility() const
|
---|
| 93 | {
|
---|
| 94 | return accessibility;
|
---|
| 95 | }
|
---|
| 96 | void SetAccessibility( Prototype::Accessibility accessibility ){
|
---|
| 97 | this->accessibility = accessibility;
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | bool IsNoneAccess() const
|
---|
| 101 | {
|
---|
| 102 | return ( accessibility == Prototype::None );
|
---|
| 103 | }
|
---|
| 104 | bool IsPrivate() const
|
---|
| 105 | {
|
---|
| 106 | return ( accessibility == Prototype::Private );
|
---|
| 107 | }
|
---|
| 108 | bool IsProtected() const
|
---|
| 109 | {
|
---|
| 110 | return ( accessibility == Prototype::Protected );
|
---|
| 111 | }
|
---|
| 112 | bool IsPublic() const
|
---|
| 113 | {
|
---|
| 114 | return ( accessibility == Prototype::Public );
|
---|
| 115 | }
|
---|
| 116 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.