[270] | 1 | #pragma once
|
---|
| 2 |
|
---|
[585] | 3 | class NativeSection
|
---|
[270] | 4 | {
|
---|
| 5 | public:
|
---|
| 6 | // グローバル領域のネイティブコード
|
---|
| 7 | NativeCode globalNativeCode;
|
---|
| 8 |
|
---|
| 9 | // データテーブル
|
---|
| 10 | DataTable dataTable;
|
---|
| 11 |
|
---|
[280] | 12 | private:
|
---|
[279] | 13 | // ソースコード
|
---|
[280] | 14 | int currentSourceIndex;
|
---|
| 15 | BasicSources sources;
|
---|
[279] | 16 |
|
---|
[270] | 17 | // XMLシリアライズ用
|
---|
| 18 | private:
|
---|
| 19 | virtual const char *RootTagName() const
|
---|
| 20 | {
|
---|
[585] | 21 | return "nativeSection";
|
---|
[270] | 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 );
|
---|
[280] | 30 | ar & BOOST_SERIALIZATION_NVP( currentSourceIndex );
|
---|
| 31 | ar & BOOST_SERIALIZATION_NVP( sources );
|
---|
[270] | 32 | }
|
---|
[273] | 33 |
|
---|
| 34 | public:
|
---|
[280] | 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 | }
|
---|
[585] | 59 | };
|
---|
[280] | 60 |
|
---|
[585] | 61 | class ObjectModule
|
---|
| 62 | {
|
---|
| 63 | public:
|
---|
| 64 | // メタ情報
|
---|
| 65 | Meta meta;
|
---|
| 66 |
|
---|
| 67 | NativeSection nativeSection;
|
---|
| 68 |
|
---|
| 69 | // XMLシリアライズ用
|
---|
| 70 | private:
|
---|
| 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 |
|
---|
| 84 | public:
|
---|
| 85 | void StaticLink( ObjectModule &objectModule );
|
---|
| 86 |
|
---|
[279] | 87 | bool Read( const std::string &filePath );
|
---|
| 88 | bool Write( const std::string &filePath ) const;
|
---|
[585] | 89 | bool Load( const Jenga::Common::Binary &binary );
|
---|
| 90 | bool Save( Jenga::Common::Binary &binary ) const;
|
---|
[270] | 91 | };
|
---|
| 92 | typedef std::vector<ObjectModule *> ObjectModules;
|
---|