MDF Lib 2.2
Interface against MDF 3/4 files
Loading...
Searching...
No Matches
isourceinformation.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
5
10#pragma once
11#include <cstdint>
12#include <string>
13
14#include "mdf/imetadata.h"
15#include "mdf/iblock.h"
16
17namespace mdf {
18
20enum class SourceType : uint8_t {
21 Other = 0,
22 Ecu = 1,
23 Bus = 2,
24 IoDevice = 3,
25 Tool = 4,
26 User = 5
27};
28
30enum class BusType : uint8_t {
31 None = 0,
32 Other = 1,
33 Can = 2,
34 Lin = 3,
35 Most = 4,
36 FlexRay = 5,
37 Kline = 6,
38 Ethernet = 7,
39 Usb = 8
40};
41
43namespace SiFlag {
44constexpr uint8_t Simulated = 0x01;
45}
46
51class ISourceInformation : public IBlock {
52 public:
53 virtual void Name(const std::string& name) = 0;
54 [[nodiscard]] virtual const std::string& Name() const = 0;
55
56 virtual void Path(const std::string& path) = 0;
57 [[nodiscard]] virtual const std::string& Path() const = 0;
58
60 virtual void Description(const std::string& desc) = 0;
62 [[nodiscard]] virtual std::string Description() const = 0;
63
64 virtual void Type(SourceType type) = 0;
65 [[nodiscard]] virtual SourceType Type() const = 0;
66
67 virtual void Bus(BusType type) = 0;
68 [[nodiscard]] virtual BusType Bus() const = 0;
69
70 virtual void Flags(uint8_t flags) = 0;
71 [[nodiscard]] virtual uint8_t Flags() const = 0;
72
74 [[nodiscard]] virtual IMetaData* CreateMetaData() = 0;
76 [[nodiscard]] virtual const IMetaData* MetaData() const = 0;
77};
78
79} // end namespace mdf
Base class for all MDF blocks.
Definition iblock.h:19
Interface against an meta data block (MD) in a MDF4 file.
Definition imetadata.h:27
Interface to a source information (SI) block.
Definition isourceinformation.h:51
virtual IMetaData * CreateMetaData()=0
Creates a meta-data (MD) block.
virtual const IMetaData * MetaData() const =0
Returns an existing meta-data (MD) block.
virtual void Path(const std::string &path)=0
Sets the path.
virtual BusType Bus() const =0
Type of bus.
virtual const std::string & Path() const =0
Path.
virtual void Flags(uint8_t flags)=0
Set the SiFlag.
virtual void Bus(BusType type)=0
Set the type of bus.
virtual SourceType Type() const =0
Type of source.
virtual const std::string & Name() const =0
Name.
virtual void Name(const std::string &name)=0
Sets the name.
virtual std::string Description() const =0
Return the descriptive text.
virtual void Description(const std::string &desc)=0
Sets the descriptive text.
virtual void Type(SourceType type)=0
Sets the type of source.
virtual uint8_t Flags() const =0
Returns SiFlag.
All MDF blocks inherits from the IBlock class. The interface class is used internally in lists....
constexpr uint8_t Simulated
Simulated device.
Definition isourceinformation.h:44
Main namespace for the MDF library.
Definition canmessage.h:17
BusType
Type of bus.
Definition isourceinformation.h:30
@ FlexRay
FlexRay bus.
@ Most
MOST bus.
@ Usb
USB bus.
@ Kline
KLINE bus.
@ Lin
LIN bus.
@ Ethernet
EtherNet bus.
@ Can
CAN bus.
@ None
No synchronization (default value)
SourceType
Type of source information.
Definition isourceinformation.h:20
@ Other
Unknown source type.
@ IoDevice
I/O device.