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