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

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

[585][586]をリバース。NativeCodeクラスとMetaクラスは依存関係があるので分離しない方針とする。

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