MDF Lib 2.2
Interface against MDF 3/4 files
Loading...
Searching...
No Matches
ichannelhierarchy.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
5
9#pragma once
10#include <cstdint>
11
12#include "mdf/ichannel.h"
13#include "mdf/ichannelgroup.h"
14#include "mdf/idatagroup.h"
15#include "mdf/iblock.h"
16
17namespace mdf {
18
21 const IDataGroup* data_group = nullptr;
22 const IChannelGroup* channel_group = nullptr;
23 const IChannel* channel = nullptr;
24};
25
27enum class ChType : uint8_t {
28 Group = 0,
29 Function = 1,
30 Structure = 2,
31 MapList = 3,
32 InputVariable = 4,
33 OutputVariable = 5,
34 LocalVariable = 6,
37};
38
40class IChannelHierarchy : public IBlock {
41 public:
42
43 virtual void Name(const std::string& name) = 0;
44 [[nodiscard]] virtual const std::string& Name() const = 0;
45
46 virtual void Type(ChType type) = 0;
47 [[nodiscard]] virtual ChType Type() const = 0;
48 [[nodiscard]] std::string TypeToString() const;
49
50 virtual void Description(const std::string& description)
51 = 0;
52 [[nodiscard]] virtual std::string Description() const = 0;
53
58 [[nodiscard]] virtual IMetaData* CreateMetaData() = 0;
59
64 [[nodiscard]] virtual const IMetaData* MetaData() const = 0;
65
67 virtual void AddElementLink(const ElementLink& element) = 0;
68
70 [[nodiscard]] virtual const std::vector<ElementLink>& ElementLinks()
71 const = 0;
72
74 [[nodiscard]] virtual IChannelHierarchy* CreateChannelHierarchy() = 0;
75
77 [[nodiscard]] virtual std::vector<IChannelHierarchy*> ChannelHierarchies()
78 const = 0;
79};
80} // namespace mdf
Base class for all MDF blocks.
Definition iblock.h:19
Interface against a channel group (CG) block.
Definition ichannelgroup.h:66
Channel hierarchy (CH) block.
Definition ichannelhierarchy.h:40
virtual IMetaData * CreateMetaData()=0
Returns an interface against an MD4 block.
virtual ChType Type() const =0
Block type.
virtual const std::vector< ElementLink > & ElementLinks() const =0
Returns a list of element links.
virtual void Name(const std::string &name)=0
Sets name.
virtual const IMetaData * MetaData() const =0
Returns an constant interface against a MD4 block.
virtual void Type(ChType type)=0
Sets the block type.
virtual IChannelHierarchy * CreateChannelHierarchy()=0
Create a CH block.
virtual void AddElementLink(const ElementLink &element)=0
Adds an element link.
virtual void Description(const std::string &description)=0
Sets the descriptive text.
virtual const std::string & Name() const =0
Name.
std::string TypeToString() const
Block type as text.
virtual std::string Description() const =0
Description.
virtual std::vector< IChannelHierarchy * > ChannelHierarchies() const =0
Returns a list of CH blocks.
Defines a MDF channel (CN) block.
Definition ichannel.h:126
Interface to a data group (DG) block.
Definition idatagroup.h:42
Interface against an meta data block (MD) in a MDF4 file.
Definition imetadata.h:27
All MDF blocks inherits from the IBlock class. The interface class is used internally in lists....
The define an interface against a channel block (CN).
Defines an interface against a channel group (CG) block.
Interface to a data group (DG) block.
Main namespace for the MDF library.
Definition canmessage.h:17
ChType
Block type.
Definition ichannelhierarchy.h:27
@ Group
Define a group.
@ MapList
Define a map list.
@ OutputVariable
Define output variables.
@ InputVariable
Define input variables.
@ CalibrationObject
Define calibration reference objects.
@ Function
Define a function.
@ LocalVariable
Define local variables.
@ CalibrationDefinition
Define calibration define objects.
@ Structure
Define a structure.