source: dev/trunk/abdev/BasicCompiler_Common/include/ObjectModule.h@ 333

Last change on this file since 333 was 280, checked in by dai_9181, 17 years ago
File size: 1.7 KB
Line 
1#pragma once
2
3class ObjectModule : public Jenga::Common::BoostSerializationSupport<ObjectModule>
4{
5public:
6 // メタ情報
7 Meta meta;
8
9 // グローバル領域のネイティブコード
10 NativeCode globalNativeCode;
11
12 // データテーブル
13 DataTable dataTable;
14
15private:
16 // ソースコード
17 int currentSourceIndex;
18 BasicSources sources;
19
20 // XMLシリアライズ用
21private:
22 virtual const char *RootTagName() const
23 {
24 return "objectModule";
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
31 ar & BOOST_SERIALIZATION_NVP( meta );
32 ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
33 ar & BOOST_SERIALIZATION_NVP( dataTable );
34 ar & BOOST_SERIALIZATION_NVP( currentSourceIndex );
35 ar & BOOST_SERIALIZATION_NVP( sources );
36 }
37
38public:
39 void StaticLink( ObjectModule &objectModule );
40
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
66 bool Read( const std::string &filePath );
67 bool Write( const std::string &filePath ) const;
68 bool ReadString( const std::string &str );
69 bool WriteString( std::string &str ) const;
70};
71typedef std::vector<ObjectModule *> ObjectModules;
Note: See TracBrowser for help on using the repository browser.