source: dev/trunk/jenga/include/smoothie/Member.h@ 190

Last change on this file since 190 was 187, checked in by dai_9181, 17 years ago
File size: 1.5 KB
Line 
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include "Type.h"
7#include "Class.h"
8#include "Source.h"
9
10using namespace std;
11
12class CClass;
13
14class CMember : public MemberPrototype
15{
16 string name;
17 Type type;
18 bool isConst;
19
20 string initializeExpression;
21 string constructParameter;
22public:
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
55 CMember( Prototype::Accessibility accessibility, const string &name, const Type &newType, bool isConst, const string &initializeExpression, const string &constructParameter )
56 : MemberPrototype( accessibility )
57 , name( name )
58 , type( newType )
59 , isConst( isConst )
60 , initializeExpression( initializeExpression )
61 , constructParameter( constructParameter )
62 {
63 }
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));
72
73 //ソースコードの位置
74 source_code_address=member.source_code_address;
75 }
76 ~CMember()
77 {
78 }
79};
80typedef std::vector<CMember *> Members;
Note: See TracBrowser for help on using the repository browser.