[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 |
|
---|
[632] | 36 | Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter );
|
---|
| 37 | Member( const Member &member, const Type &actualType );
|
---|
| 38 | Member( const Member &member );
|
---|
| 39 | Member();
|
---|
| 40 | ~Member();
|
---|
| 41 |
|
---|
[523] | 42 | const std::string &GetName() const
|
---|
[206] | 43 | {
|
---|
| 44 | return name;
|
---|
| 45 | }
|
---|
[523] | 46 | void SetName( const std::string &name )
|
---|
[206] | 47 | {
|
---|
| 48 | this->name = name;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
[299] | 51 | const Type &GetType() const
|
---|
[206] | 52 | {
|
---|
| 53 | return type;
|
---|
| 54 | }
|
---|
[299] | 55 | void ResetType( const Type &type )
|
---|
| 56 | {
|
---|
| 57 | this->type = type;
|
---|
| 58 | }
|
---|
[206] | 59 |
|
---|
[409] | 60 | bool IsConst() const
|
---|
[206] | 61 | {
|
---|
| 62 | return isConst;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | const Subscripts &GetSubscripts() const
|
---|
| 66 | {
|
---|
| 67 | return subscripts;
|
---|
| 68 | }
|
---|
| 69 |
|
---|
[523] | 70 | const std::string &GetInitializeExpression() const
|
---|
[206] | 71 | {
|
---|
| 72 | return initializeExpression;
|
---|
| 73 | }
|
---|
[523] | 74 | const std::string &GetConstructParameter() const
|
---|
[206] | 75 | {
|
---|
| 76 | return constructParameter;
|
---|
| 77 | }
|
---|
[639] | 78 |
|
---|
[640] | 79 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[206] | 80 | };
|
---|
[561] | 81 | typedef std::vector<Member *> Members;
|
---|