MDF Lib 2.2
Interface against MDF 3/4 files
Loading...
Searching...
No Matches
iheader.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
5
11#pragma once
12#include <optional>
13#include <string>
14#include <vector>
15#include "mdf/iblock.h"
16#include "itimestamp.h"
17#include "imdftimestamp.h"
18
19namespace mdf {
20
21class IAttachment;
22class IChannelHierarchy;
23class IEvent;
24class IFileHistory;
25class IMetaData;
26class IDataGroup;
27
34class IHeader : public IBlock {
35 public:
41 virtual void Author(const std::string& author) = 0;
42
48 [[nodiscard]] virtual std::string Author() const = 0;
49
55 virtual void Department(const std::string& department) = 0;
56
62 [[nodiscard]] virtual std::string Department() const = 0;
63
69 virtual void Project(const std::string& name) = 0;
70
76 [[nodiscard]] virtual std::string Project() const = 0;
77
83 virtual void Subject(const std::string& subject) = 0;
84
90 [[nodiscard]] virtual std::string Subject() const = 0;
91
97 virtual void Description(const std::string& description) = 0;
98
104 [[nodiscard]] virtual std::string Description() const = 0;
105
112 virtual void MeasurementId(const std::string& uuid);
113
119 [[nodiscard]] virtual std::string MeasurementId() const;
120
127 virtual void RecorderId(const std::string& uuid);
128
134 [[nodiscard]] virtual std::string RecorderId() const;
135
141 virtual void RecorderIndex(int64_t index);
142
148 [[nodiscard]] virtual int64_t RecorderIndex() const;
149
155 virtual void StartTime(uint64_t ns_since_1970) = 0;
156
163 virtual void StartTime(ITimestamp& timestamp) = 0;
164
170 [[nodiscard]] virtual uint64_t StartTime() const = 0;
171
179 [[nodiscard]] virtual const IMdfTimestamp* StartTimestamp() const = 0;
180
187 [[nodiscard]] virtual IMetaData* CreateMetaData();
188
194 [[nodiscard]] virtual IMetaData* MetaData() const;
195
204 [[nodiscard]] virtual IAttachment* CreateAttachment();
205
211 [[nodiscard]] virtual std::vector<IAttachment*> Attachments() const;
212
219 [[nodiscard]] virtual IFileHistory* CreateFileHistory();
220
226 [[nodiscard]] virtual std::vector<IFileHistory*> FileHistories() const;
227
228#undef CreateEvent
234 [[nodiscard]] virtual IEvent* CreateEvent();
235
241 [[nodiscard]] virtual std::vector<IEvent*> Events() const;
242
249
255 [[nodiscard]] virtual std::vector<IChannelHierarchy*> ChannelHierarchies()
256 const;
257
263 [[nodiscard]] virtual IDataGroup* CreateDataGroup() = 0;
264
270 [[nodiscard]] virtual std::vector<IDataGroup*> DataGroups() const = 0;
271
277 [[nodiscard]] virtual IDataGroup* LastDataGroup() const = 0;
278
284 virtual void StartAngle(double angle);
285
291 [[nodiscard]] virtual std::optional<double> StartAngle() const;
292
298 virtual void StartDistance(double distance);
299
305 [[nodiscard]] virtual std::optional<double> StartDistance() const;
306
307 protected:
308 ~IHeader() override = default;
309};
310
311} // end namespace mdf
Interface against an attached file.
Definition iattachment.h:21
Base class for all MDF blocks.
Definition iblock.h:19
Channel hierarchy (CH) block.
Definition ichannelhierarchy.h:40
Interface to a data group (DG) block.
Definition idatagroup.h:42
Interface against an event block.
Definition ievent.h:58
Interface class against an MDF FH block.
Definition ifilehistory.h:28
Interface class against an MDF HD block.
Definition iheader.h:34
virtual IAttachment * CreateAttachment()
Create a new attachment block.
virtual uint64_t StartTime() const =0
Returns the absolute measurement time for the file.
virtual void StartDistance(double distance)
Sets the start distance.
virtual std::vector< IChannelHierarchy * > ChannelHierarchies() const
Returns a list of channel hierarchy blocks.
virtual IEvent * CreateEvent()
Creates a new event block.
virtual std::string Author() const =0
Returns the author of the file.
virtual std::string Department() const =0
Returns the department.
virtual void Project(const std::string &name)=0
Sets the project name.
virtual void StartTime(ITimestamp &timestamp)=0
Sets the absolute measurement time for the file.
virtual void StartAngle(double angle)
Sets the start angle for the measurements.
virtual std::string Project() const =0
Returns the project name.
virtual void MeasurementId(const std::string &uuid)
Sets a unique identifier for the measurement.
virtual IDataGroup * LastDataGroup() const =0
Returns the last measurement in the file.
virtual std::vector< IFileHistory * > FileHistories() const
Returns a list of file history blocks.
virtual std::string Subject() const =0
Returns the subject of the file.
virtual IDataGroup * CreateDataGroup()=0
Creates a new data group block.
virtual void RecorderId(const std::string &uuid)
Sets a unique identifier for the recorder.
virtual void Author(const std::string &author)=0
Sets the author of the file.
virtual std::string RecorderId() const
Returns the unique recorder identifier.
virtual std::string MeasurementId() const
Returns the unique measurement identifier.
virtual std::vector< IEvent * > Events() const
Returns a list events.
virtual std::string Description() const =0
Returns the description of the file.
virtual std::vector< IDataGroup * > DataGroups() const =0
Returns a list of measurements.
virtual IFileHistory * CreateFileHistory()
Create a new file history block.
virtual void StartTime(uint64_t ns_since_1970)=0
Sets the absolute measurement time for the file.
virtual void RecorderIndex(int64_t index)
Sets the recorder order number.
~IHeader() override=default
Default constructor.
virtual IMetaData * CreateMetaData()
Returns meta data information object.
virtual void Subject(const std::string &subject)=0
Sets the subject of the file.
virtual IMetaData * MetaData() const
Returns meta data information object.
virtual IChannelHierarchy * CreateChannelHierarchy()
Creates a new channel hierarchy block.
virtual const IMdfTimestamp * StartTimestamp() const =0
Returns the start timestamp of the measurement.
virtual std::optional< double > StartDistance() const
Returns the start distance in meters.
virtual std::vector< IAttachment * > Attachments() const
Returns a list of attachments.
virtual std::optional< double > StartAngle() const
virtual int64_t RecorderIndex() const
Returns the recorder order number.
virtual void Department(const std::string &department)=0
Sets the department name.
virtual void Description(const std::string &description)=0
Sets the description of the file.
Interface for MDF timestamp handling.
Definition imdftimestamp.h:22
Interface against an meta data block (MD) in a MDF4 file.
Definition imetadata.h:27
Interface for timestamp handling in MDF files.
Definition itimestamp.h:17
All MDF blocks inherits from the IBlock class. The interface class is used internally in lists....
Main namespace for the MDF library.
Definition canmessage.h:17