MDF Lib 2.2
Interface against MDF 3/4 files
Loading...
Searching...
No Matches
mdffactory.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
8#pragma once
9#include <functional>
10#include <cstdint>
11#include <string>
12#include <memory>
13
14namespace mdf {
16enum class MdfWriterType : int {
17 Mdf3Basic = 0,
18 Mdf4Basic = 1,
19 MdfBusLogger = 2,
20 MdfConverter = 3,
21};
22
24enum class MdfFileType : int {
25 Mdf3FileType = 0,
26 Mdf4FileType = 1
27};
28
30enum class MdfLogSeverity : uint8_t {
31 kTrace = 0,
32 kDebug,
33 kInfo,
34 kNotice,
35 kWarning,
36 kError,
37 kCritical,
38 kAlert,
40};
41
43using MdfLogFunction2 = std::function<void(MdfLogSeverity severity,
44 const std::string& function, const std::string& text)>;
45
46class MdfWriter;
47class MdfFile;
48
51 public:
53 static std::unique_ptr<MdfWriter> CreateMdfWriter(MdfWriterType type);
55 static std::unique_ptr<MdfFile> CreateMdfFile(MdfFileType type);
56
61
63 static void SetLogFunction2(const MdfLogFunction2& func);
64};
65
66} // namespace mdf
MDF factory class.
Definition mdffactory.h:50
static void SetLogFunction2(const MdfLogFunction2 &func)
Sets the log function.
static MdfWriter * CreateMdfWriterEx(MdfWriterType type)
Creates an MDF writer object.
static std::unique_ptr< MdfWriter > CreateMdfWriter(MdfWriterType type)
Creates an MDF writer object.
static MdfFile * CreateMdfFileEx(MdfFileType type)
Create an MDF reader object.
static std::unique_ptr< MdfFile > CreateMdfFile(MdfFileType type)
Create an MDF reader object.
Implements an user interface against a MDF file.
Definition mdffile.h:37
Interface against an MDF writer object.
Definition mdfwriter.h:104
Main namespace for the MDF library.
Definition canmessage.h:17
MdfFileType
MDF file type.
Definition mdffactory.h:24
@ Mdf4FileType
MDF version 4 file.
@ Mdf3FileType
MDF version 3 file.
std::function< void(MdfLogSeverity severity, const std::string &function, const std::string &text)> MdfLogFunction2
MDF logging function definition.
Definition mdffactory.h:43
MdfLogSeverity
Defines the log severity level.
Definition mdffactory.h:30
@ kInfo
Informational message.
@ kEmergency
Fatal error message.
@ kCritical
Critical message (device error)
@ kNotice
Notice message. Notify the user.
@ kDebug
Debug message.
@ kAlert
Alert or alarm message.
@ kError
Error message.
@ kWarning
Warning message.
@ kTrace
Trace or listen message.
MdfWriterType
MDF writer types.
Definition mdffactory.h:16
@ MdfConverter
MDF writer for MDF 4 conversion applications.
@ Mdf3Basic
Basic MDF version 3 writer.
@ Mdf4Basic
Basic MDF version 4 writer.
@ MdfBusLogger
Specialized bus logger writer.