| 1 | #pragma once
|
|---|
| 2 |
|
|---|
| 3 | class ObjectModule
|
|---|
| 4 | {
|
|---|
| 5 | public:
|
|---|
| 6 | // オブジェクトモジュール名
|
|---|
| 7 | std::string name;
|
|---|
| 8 |
|
|---|
| 9 | // メタ情報
|
|---|
| 10 | Meta meta;
|
|---|
| 11 |
|
|---|
| 12 | // グローバル領域のネイティブコード
|
|---|
| 13 | NativeCode globalNativeCode;
|
|---|
| 14 |
|
|---|
| 15 | // データテーブル
|
|---|
| 16 | DataTable dataTable;
|
|---|
| 17 |
|
|---|
| 18 | private:
|
|---|
| 19 | // ソースコード
|
|---|
| 20 | int currentSourceIndex;
|
|---|
| 21 | BasicSources sources;
|
|---|
| 22 |
|
|---|
| 23 | // XMLシリアライズ用
|
|---|
| 24 | private:
|
|---|
| 25 | virtual const char *RootTagName() const
|
|---|
| 26 | {
|
|---|
| 27 | return "objectModule";
|
|---|
| 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 |
|
|---|
| 34 | ar & BOOST_SERIALIZATION_NVP( name );
|
|---|
| 35 | ar & BOOST_SERIALIZATION_NVP( meta );
|
|---|
| 36 | ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
|
|---|
| 37 | ar & BOOST_SERIALIZATION_NVP( dataTable );
|
|---|
| 38 | ar & BOOST_SERIALIZATION_NVP( currentSourceIndex );
|
|---|
| 39 | ar & BOOST_SERIALIZATION_NVP( sources );
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 | public:
|
|---|
| 43 | void StaticLink( ObjectModule &objectModule );
|
|---|
| 44 |
|
|---|
| 45 | const std::string &GetName() const
|
|---|
| 46 | {
|
|---|
| 47 | return name;
|
|---|
| 48 | }
|
|---|
| 49 | void SetName( const std::string &name )
|
|---|
| 50 | {
|
|---|
| 51 | this->name = name;
|
|---|
| 52 | }
|
|---|
| 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 |
|
|---|
| 78 | bool Read( const std::string &filePath );
|
|---|
| 79 | bool Write( const std::string &filePath ) const;
|
|---|
| 80 | bool ReadString( const std::string &str );
|
|---|
| 81 | bool WriteString( std::string &str ) const;
|
|---|
| 82 | };
|
|---|
| 83 | typedef std::vector<ObjectModule *> ObjectModules;
|
|---|