source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/ObjectModule.h@ 585

Last change on this file since 585 was 585, checked in by dai_9181, 16 years ago

NativeSectionクラスを追加(64bit版だけ一旦コミット)。

File size: 2.0 KB
Line 
1#pragma once
2
3class NativeSection
4{
5public:
6 // グローバル領域のネイティブコード
7 NativeCode globalNativeCode;
8
9 // データテーブル
10 DataTable dataTable;
11
12private:
13 // ソースコード
14 int currentSourceIndex;
15 BasicSources sources;
16
17 // XMLシリアライズ用
18private:
19 virtual const char *RootTagName() const
20 {
21 return "nativeSection";
22 }
23 friend class boost::serialization::access;
24 template<class Archive> void serialize(Archive& ar, const unsigned int version)
25 {
26 trace_for_serialize( "serializing - objectModule" );
27
28 ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
29 ar & BOOST_SERIALIZATION_NVP( dataTable );
30 ar & BOOST_SERIALIZATION_NVP( currentSourceIndex );
31 ar & BOOST_SERIALIZATION_NVP( sources );
32 }
33
34public:
35 int GetCurrentSourceIndex() const
36 {
37 return currentSourceIndex;
38 }
39 const BasicSource &GetCurrentSource() const
40 {
41 return sources[currentSourceIndex];
42 }
43 BasicSource &GetCurrentSource()
44 {
45 return sources[currentSourceIndex];
46 }
47 void SetCurrentSourceIndex( int currentSourceIndex )
48 {
49 this->currentSourceIndex = currentSourceIndex;
50 }
51 const BasicSource &GetSource( int sourceIndex ) const
52 {
53 return sources[sourceIndex];
54 }
55 BasicSources &GetSources()
56 {
57 return sources;
58 }
59};
60
61class ObjectModule
62{
63public:
64 // メタ情報
65 Meta meta;
66
67 NativeSection nativeSection;
68
69 // XMLシリアライズ用
70private:
71 virtual const char *RootTagName() const
72 {
73 return "objectModule";
74 }
75 friend class boost::serialization::access;
76 template<class Archive> void serialize(Archive& ar, const unsigned int version)
77 {
78 trace_for_serialize( "serializing - objectModule" );
79
80 ar & BOOST_SERIALIZATION_NVP( meta );
81 ar & BOOST_SERIALIZATION_NVP( nativeSection );
82 }
83
84public:
85 void StaticLink( ObjectModule &objectModule );
86
87 bool Read( const std::string &filePath );
88 bool Write( const std::string &filePath ) const;
89 bool Load( const Jenga::Common::Binary &binary );
90 bool Save( Jenga::Common::Binary &binary ) const;
91};
92typedef std::vector<ObjectModule *> ObjectModules;
Note: See TracBrowser for help on using the repository browser.