[206] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | class CClass;
|
---|
| 4 |
|
---|
[561] | 5 | class Member : public MemberPrototype
|
---|
[206] | 6 | {
|
---|
[523] | 7 | std::string name;
|
---|
[206] | 8 | Type type;
|
---|
| 9 | bool isConst;
|
---|
| 10 | Subscripts subscripts;
|
---|
| 11 |
|
---|
[523] | 12 | std::string initializeExpression;
|
---|
| 13 | std::string constructParameter;
|
---|
[206] | 14 |
|
---|
| 15 | // XMLシリアライズ用
|
---|
| 16 | // TODO: xml
|
---|
| 17 | private:
|
---|
| 18 | friend class boost::serialization::access;
|
---|
| 19 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 20 | {
|
---|
[561] | 21 | trace_for_serialize( "serializing - Member" );
|
---|
[206] | 22 |
|
---|
| 23 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( MemberPrototype );
|
---|
| 24 | ar & BOOST_SERIALIZATION_NVP( name );
|
---|
| 25 | ar & BOOST_SERIALIZATION_NVP( type );
|
---|
| 26 | ar & BOOST_SERIALIZATION_NVP( isConst );
|
---|
| 27 | ar & BOOST_SERIALIZATION_NVP( subscripts );
|
---|
| 28 | ar & BOOST_SERIALIZATION_NVP( initializeExpression );
|
---|
| 29 | ar & BOOST_SERIALIZATION_NVP( constructParameter );
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public:
|
---|
| 33 |
|
---|
| 34 | int source_code_address;
|
---|
| 35 |
|
---|
[523] | 36 | const std::string &GetName() const
|
---|
[206] | 37 | {
|
---|
| 38 | return name;
|
---|
| 39 | }
|
---|
[523] | 40 | void SetName( const std::string &name )
|
---|
[206] | 41 | {
|
---|
| 42 | this->name = name;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
[299] | 45 | const Type &GetType() const
|
---|
[206] | 46 | {
|
---|
| 47 | return type;
|
---|
| 48 | }
|
---|
[299] | 49 | void ResetType( const Type &type )
|
---|
| 50 | {
|
---|
| 51 | this->type = type;
|
---|
| 52 | }
|
---|
[206] | 53 |
|
---|
[409] | 54 | bool IsConst() const
|
---|
[206] | 55 | {
|
---|
| 56 | return isConst;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | const Subscripts &GetSubscripts() const
|
---|
| 60 | {
|
---|
| 61 | return subscripts;
|
---|
| 62 | }
|
---|
| 63 |
|
---|
[523] | 64 | const std::string &GetInitializeExpression() const
|
---|
[206] | 65 | {
|
---|
| 66 | return initializeExpression;
|
---|
| 67 | }
|
---|
[523] | 68 | const std::string &GetConstructParameter() const
|
---|
[206] | 69 | {
|
---|
| 70 | return constructParameter;
|
---|
| 71 | }
|
---|
| 72 |
|
---|
[561] | 73 | Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter )
|
---|
[206] | 74 | : MemberPrototype( accessibility )
|
---|
| 75 | , name( name )
|
---|
| 76 | , type( newType )
|
---|
| 77 | , isConst( isConst )
|
---|
| 78 | , subscripts( subscripts )
|
---|
| 79 | , initializeExpression( initializeExpression )
|
---|
| 80 | , constructParameter( constructParameter )
|
---|
| 81 | {
|
---|
| 82 | }
|
---|
[561] | 83 | Member::Member(Member &member)
|
---|
[206] | 84 | : MemberPrototype( member.GetAccessibility() )
|
---|
| 85 | , name( member.GetName() )
|
---|
| 86 | , type( member.GetType() )
|
---|
| 87 | , isConst( member.IsConst() )
|
---|
| 88 | , subscripts( member.GetSubscripts() )
|
---|
| 89 | {
|
---|
| 90 | //ソースコードの位置
|
---|
| 91 | source_code_address=member.source_code_address;
|
---|
| 92 | }
|
---|
[561] | 93 | Member()
|
---|
[206] | 94 | {
|
---|
| 95 | }
|
---|
[561] | 96 | ~Member()
|
---|
[206] | 97 | {
|
---|
| 98 | }
|
---|
| 99 | };
|
---|
[561] | 100 | typedef std::vector<Member *> Members;
|
---|