CbmRoot
Loading...
Searching...
No Matches
CbmQaReportSection.h
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "CbmQaReportElement.h"
13#include "CbmQaReportEngine.h"
14
15#include <string>
16#include <string_view>
17
18namespace cbm::qa::report
19{
22 class Section : public CollapsibleElement {
23 public:
27 Section(std::string_view label, std::string_view title);
28
30 Section() = default;
31
34 std::string GetBody(const Engine& engine) const override { return engine.SectionBody(*this); }
35
37 virtual ~Section() = default;
38
40 void Add(std::shared_ptr<Element> pElement) override;
41
43 int GetLevel() const { return fLevel; }
44
45 protected:
49 void SetLevel(int level) { fLevel = level; }
50
51 private:
52 int fLevel = 0;
53 };
54} // namespace cbm::qa::report
Base class for the report element (header)
Interface to the element, which can contain daughter elements.
A base abstract class to provide an interface for element body (a visitor in the Visitor pattern)
virtual std::string SectionBody(const Section &section) const =0
Creates a body for section.
Section of the report.
std::string GetBody(const Engine &engine) const override
Gets body of the element.
virtual ~Section()=default
Destructor.
int GetLevel() const
Gets level of the section.
Section()=default
Default constructor.
void Add(std::shared_ptr< Element > pElement) override
Adds daughter element.
int fLevel
Level of the section.
void SetLevel(int level)
Sets level of the section.