source: dev/trunk/abdev/BasicCompiler_Common/include/ClassImpl.h@ 199

Last change on this file since 199 was 193, checked in by dai_9181, 17 years ago
File size: 3.1 KB
Line 
1#pragma once
2
3#include <jenga/include/smoothie/Class.h>
4
5class ClassImpl: public CClass
6{
7public:
8 ClassImpl( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name )
9 : CClass( namespaceScopes, importedNamespaces, name )
10 {
11 }
12 ClassImpl()
13 : CClass()
14 {
15 }
16
17 virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
18
19 //継承させる
20 virtual bool Inherits( const char *inheritNames, int nowLine );
21 virtual bool InheritsClass( const CClass &inheritsClass, int nowLine );
22 virtual bool InheritsInterface( const CClass &inheritsClass, int nowLine );
23
24 //メンバ、メソッドの追加
25 CMember *CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
26 virtual void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine );
27 virtual void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
28
29 virtual void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
30 bool isVirtual, bool isOverride, char *buffer, int nowLine);
31
32 virtual LONG_PTR GetVtblGlobalOffset(void) const;
33 virtual void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
34
35
36 // XMLシリアライズ用
37private:
38 friend class boost::serialization::access;
39 template<class Archive> void serialize(Archive& ar, const unsigned int version)
40 {
41 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( CClass );
42 }
43};
44BOOST_IS_ABSTRACT( CClass );
45
46class ClassesImpl : public Classes
47{
48public:
49 ClassesImpl()
50 : Classes()
51 {
52 }
53
54 virtual CClass *Create( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name);
55 virtual void CollectClassesForNameOnly( const BasicSource &source );
56
57 virtual void InitStaticMember();
58
59private:
60 bool MemberVar_LoopRefCheck(const CClass &objClass);
61public:
62 virtual void GetClass_recur(const char *lpszInheritsClass);
63 virtual void GetAllClassInfo();
64 virtual void Compile_System_InitializeUserTypes();
65
66 virtual const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const;
67
68
69 // XMLシリアライズ用
70private:
71 friend class boost::serialization::access;
72 BOOST_SERIALIZATION_SPLIT_MEMBER();
73 template<class Archive> void load(Archive& ar, const unsigned int version)
74 {
75 std::vector<ClassImpl *> vectorClasses;
76 ar & BOOST_SERIALIZATION_NVP( vectorClasses );
77
78 // 読み込み後の処理
79 Clear();
80 BOOST_FOREACH( CClass *pClass, vectorClasses )
81 {
82 Insert( pClass );
83 }
84 }
85 template<class Archive> void save(Archive& ar, const unsigned int version) const
86 {
87 // 保存準備
88 std::vector<ClassImpl *> vectorClasses;
89 vectorClasses.clear();
90 Iterator_Reset();
91 while( Iterator_HasNext() )
92 {
93 vectorClasses.push_back( dynamic_cast<ClassImpl *>(Iterator_GetNext()) );
94 }
95
96 ar & BOOST_SERIALIZATION_NVP( vectorClasses );
97 }
98};
99BOOST_IS_ABSTRACT( Classes );
Note: See TracBrowser for help on using the repository browser.