27[[nodiscard]]
bool IsMdfFile(
const std::string& filename);
42 const IDataGroup& dg_group,
const std::string& channel_name);
71 const std::string& filename);
86 [[nodiscard]] int64_t
Index()
const {
return index_; }
94 void Index(int64_t index) { index_ = index; }
98 [[nodiscard]]
bool IsOk()
const {
return static_cast<bool>(instance_); }
130 const std::string& dest_file);
200 const std::vector<uint64_t>& offset_list,
201 std::function<
void(uint64_t,
202 const std::vector<uint8_t>&)>& callback);
206 std::FILE* file_ =
nullptr;
207 std::string filename_;
208 std::unique_ptr<MdfFile> instance_;
Interface against an attached file.
Definition iattachment.h:21
Interface against a channel group (CG) block.
Definition ichannelgroup.h:66
Defines a MDF channel (CN) block.
Definition ichannel.h:126
Interface to a data group (DG) block.
Definition idatagroup.h:42
Defines an interface to a sample reduction (SR) block.
Definition isamplereduction.h:58
Implements an user interface against a MDF file.
Definition mdffile.h:37
Reader interface to an MDF file.
Definition mdfreader.h:68
bool IsOk() const
Definition mdfreader.h:98
bool ReadPartialData(IDataGroup &data_group, size_t min_sample, size_t max_sample)
Reads a range of samples.
bool ReadVlsdData(IDataGroup &data_group, IChannel &vlsd_channel, const std::vector< uint64_t > &offset_list, std::function< void(uint64_t, const std::vector< uint8_t > &)> &callback)
Read in partial variable length data with an offset list.
bool ReadSrData(ISampleReduction &sr_group)
Reads in data bytes to a sample reduction (SR) block.
bool ReadData(IDataGroup &data_group)
Reads all sample, sample reduction and signal data into memory.
bool ReadHeader()
Reads the ID and the HD block.
bool ReadMeasurementInfo()
Reads everything but not CG and raw data.
void Index(int64_t index)
Definition mdfreader.h:94
const MdfFile * GetFile() const
Definition mdfreader.h:111
bool ReadEverythingButData()
Reads all blocks but not raw data.
bool ExportAttachmentData(const IAttachment &attachment, const std::string &dest_file)
Export the attachment data to a detination file.
virtual ~MdfReader()
Destructor that close any open file and destructs.
std::string ShortName() const
Returns the file name without paths.
IDataGroup * GetDataGroup(size_t order) const
Returns the data group (DG) block.
bool Open()
Opens the file stream for reading.
const IHeader * GetHeader() const
Returns the header (HD) block.
MdfReader(const std::string &filename)
void Close()
Closes the file stream.
int64_t Index() const
Definition mdfreader.h:86
bool IsFinalized() const
Return true if the file is marked as finalized.
A channel observer is holds a list of channel samples for a channel.
Interface against an MDF file object.
Main namespace for the MDF library.
Definition canmessage.h:17
ChannelObserverPtr CreateChannelObserver(const IDataGroup &data_group, const IChannelGroup &group, const IChannel &channel)
Creates and attaches a channel sample observer.
bool IsMdfFile(const std::string &filename)
Returns true if the file is an MDF file.
std::unique_ptr< IChannelObserver > ChannelObserverPtr
Smart pointer to an observer.
Definition mdfreader.h:22
std::vector< ChannelObserverPtr > ChannelObserverList
List of observer.
Definition mdfreader.h:24
void CreateChannelObserverForChannelGroup(const IDataGroup &data_group, const IChannelGroup &group, ChannelObserverList &dest)
Creates a channel observer.
void CreateChannelObserverForDataGroup(const IDataGroup &data_group, ChannelObserverList &dest_list)
Creates channel observers for all channels within a data group.