[170] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | #include <string>
|
---|
| 4 | #include <vector>
|
---|
| 5 |
|
---|
| 6 | #include "Type.h"
|
---|
| 7 | #include "Class.h"
|
---|
| 8 | #include "Source.h"
|
---|
| 9 |
|
---|
| 10 | using namespace std;
|
---|
| 11 |
|
---|
| 12 | class CClass;
|
---|
| 13 |
|
---|
| 14 | class CMember : public MemberPrototype
|
---|
| 15 | {
|
---|
| 16 | string name;
|
---|
| 17 | Type type;
|
---|
| 18 | bool isConst;
|
---|
| 19 |
|
---|
| 20 | string initializeExpression;
|
---|
| 21 | string constructParameter;
|
---|
| 22 | public:
|
---|
| 23 | int SubScripts[MAX_ARRAYDIM];
|
---|
| 24 |
|
---|
| 25 | int source_code_address;
|
---|
| 26 |
|
---|
| 27 | const string &GetName() const
|
---|
| 28 | {
|
---|
| 29 | return name;
|
---|
| 30 | }
|
---|
| 31 | void SetName( const string &name )
|
---|
| 32 | {
|
---|
| 33 | this->name = name;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | Type GetType() const
|
---|
| 37 | {
|
---|
| 38 | return type;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | bool IsConst()
|
---|
| 42 | {
|
---|
| 43 | return isConst;
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | const string &GetInitializeExpression() const
|
---|
| 47 | {
|
---|
| 48 | return initializeExpression;
|
---|
| 49 | }
|
---|
| 50 | const string &GetConstructParameter() const
|
---|
| 51 | {
|
---|
| 52 | return constructParameter;
|
---|
| 53 | }
|
---|
| 54 |
|
---|
[181] | 55 | CMember( Prototype::Accessibility accessibility, const string &name, const Type &type, bool isConst, const string &initializeExpression, const string &constructParameter )
|
---|
[170] | 56 | : MemberPrototype( accessibility )
|
---|
| 57 | , name( name )
|
---|
| 58 | , type( type )
|
---|
| 59 | , isConst( isConst )
|
---|
[181] | 60 | , initializeExpression( initializeExpression )
|
---|
| 61 | , constructParameter( constructParameter )
|
---|
[170] | 62 | {
|
---|
| 63 | }
|
---|
[171] | 64 | CMember::CMember(CMember &member)
|
---|
| 65 | : MemberPrototype( member.GetAccessibility() )
|
---|
| 66 | , name( member.GetName() )
|
---|
| 67 | , type( member.GetType() )
|
---|
| 68 | , isConst( member.IsConst() )
|
---|
| 69 | {
|
---|
| 70 | //SubScripts
|
---|
| 71 | memcpy(SubScripts,member.SubScripts,MAX_ARRAYDIM*sizeof(int));
|
---|
[170] | 72 |
|
---|
[171] | 73 | //ソースコードの位置
|
---|
| 74 | source_code_address=member.source_code_address;
|
---|
[170] | 75 | }
|
---|
[171] | 76 | ~CMember()
|
---|
| 77 | {
|
---|
[170] | 78 | }
|
---|
| 79 | };
|
---|
| 80 | typedef std::vector<CMember *> Members;
|
---|