Hakoniwa-core-cpp は シミュレーションハブの本体 となるコアライブラリです。共有メモリを利用したスタック構造により、アセット間で高速な PDU データ通信と時刻同期を実現しています。
- Shared memory layer manages master data and PDU buffers.
- Controller interfaces (master / asset / event) provide the public API.
- Sample processes under
sample/
demonstrate typical usage.
The following sequence diagram outlines how each component interacts during a typical run.
sequenceDiagram
actor Cmd as HakoCommand
participant Master as HakoMaster
participant Asset as HakoAsset
participant MasterData as "Master Data"
participant PduData as "PDU Data"
Cmd->>Master: hako::init()
activate Master
Master->>MasterData: create()
activate MasterData
note over Master,MasterData: Masterデータ領域を確保
Asset->>Master: asset_register()
Master->>MasterData: アセット情報を登録
Asset->>MasterData: create_pdu_lchannel()
note left of Asset: PDUチャネルを定義
Cmd->>Master: start()
note right of Master: シミュレーションをRunnable状態へ
Master->>MasterData: create_pdu_data()
MasterData->>PduData: create()
activate PduData
note over MasterData,PduData: PDUデータ領域を確保
Master->>Asset: start_callback()
Asset->>Master: start_feedback()
loop シミュレーション実行中
Asset-->>PduData: read_pdu() / write_pdu()
end
Cmd->>Master: stop()
note right of Master: シミュレーションを停止
Master->>Asset: stop_callback()
Asset->>Master: stop_feedback()
- If Using Google Test
- sudo apt-get install libgtest-dev