|
DBC Framework
DBC parsing and CAN signal decoding framework
|
Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles and decoded results keep old definitions alive. More...
#include <decode_database.h>
Public Member Functions | |
| DecodeDatabase (const std::vector< DecodeFrame > &frames) | |
| const std::vector< DecodeFrame > & | GetFrames () const |
| std::shared_ptr< const DecodeFrame > | FindFrame (const FrameKey &key) const |
| PgnLookupResult | FindFrameByPgn (std::uint32_t pgn) const |
| std::shared_ptr< const DecodeSignal > | FindSignal (const SignalKey &key) const |
| Return an owning signal handle, or an empty handle for a missing key. | |
Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles and decoded results keep old definitions alive.
Definition at line 101 of file decode_database.h.
|
explicit |
Copy and validate definitions before building the frame index. Input aliases cannot modify the snapshot, even for rvalue input.
| std::invalid_argument | for invalid metadata or duplicate keys. |
Definition at line 111 of file decode_database.cpp.
| const std::vector< DecodeFrame > & DecodeDatabase::GetFrames | ( | ) | const |
Borrowed view, valid while this snapshot remains alive and unchanged.
Definition at line 115 of file decode_database.cpp.
Referenced by main().
| std::shared_ptr< const DecodeFrame > DecodeDatabase::FindFrame | ( | const FrameKey & | key | ) | const |
Owning handles retain the entire snapshot across reload or destruction.
Definition at line 120 of file decode_database.cpp.
Referenced by FindSignal().
| PgnLookupResult DecodeDatabase::FindFrameByPgn | ( | std::uint32_t | pgn | ) | const |
Only explicitly marked hasPgn frames participate; ambiguous results have no definition.
Definition at line 130 of file decode_database.cpp.
References PgnLookupResult::ambiguous, and PgnLookupResult::definition.
| std::shared_ptr< const DecodeSignal > DecodeDatabase::FindSignal | ( | const SignalKey & | key | ) | const |
Return an owning signal handle, or an empty handle for a missing key.
Definition at line 146 of file decode_database.cpp.
References FindFrame(), SignalKey::frame, DecodeSignal::name, and SignalKey::name.