R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BParView.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <string_view>
5
6
namespace
R3B
7
{
8
9
template
<
typename
ParType>
10
class
ParView
11
{
12
public
:
13
using
Type
= ParType;
14
20
explicit
ParView
(std::string_view par_name)
21
:
name_
{ par_name }
22
{
23
}
24
31
auto
get
() const ->
Type
* {
return
parameter_
; }
32
38
[[nodiscard]]
auto
get_name
() const -> std::string_view {
return
name_
; }
39
45
auto
set
(
Type
* par) ->
Type
* {
return
parameter_
= par; }
46
47
auto
operator->
() ->
Type
* {
return
parameter_
; }
48
49
auto
operator*
() ->
Type
& {
return
*
parameter_
; }
50
51
private
:
52
std::string
name_
;
53
ParType*
parameter_
=
nullptr
;
54
};
55
56
template
<
typename
ParType>
57
class
InputParView
:
public
ParView
<ParType>
58
{
59
public
:
63
explicit
InputParView
(std::string_view par_name)
64
:
ParView
<ParType>{ par_name }
65
{
66
}
67
75
template
<
typename
TaskType>
76
void
init
(TaskType* task)
77
{
78
auto
* par = task->template AddInputPar<ParType>(this->
get_name
());
79
this->
set
(par);
80
}
81
};
82
83
template
<
typename
ParType>
84
class
OutputParView
:
public
ParView
<ParType>
85
{
86
public
:
90
explicit
OutputParView
(std::string_view par_name)
91
:
ParView
<ParType>{ par_name }
92
{
93
}
94
103
template
<
typename
TaskType>
104
void
init
(TaskType* task)
105
{
106
auto
* par = task->template AddOutputPar<ParType>(this->
get_name
());
107
this->
set
(par);
108
}
109
};
110
111
}
// namespace R3B
R3B::InputParView::InputParView
InputParView(std::string_view par_name)
Constructor.
Definition
R3BParView.h:63
R3B::InputParView::init
void init(TaskType *task)
Initialization of input parameter.
Definition
R3BParView.h:76
R3B::OutputParView::init
void init(TaskType *task)
Initialization of output parameter.
Definition
R3BParView.h:104
R3B::OutputParView::OutputParView
OutputParView(std::string_view par_name)
Constructor.
Definition
R3BParView.h:90
R3B::ParView::parameter_
ParType * parameter_
Definition
R3BParView.h:53
R3B::ParView::ParView
ParView(std::string_view par_name)
Constructor.
Definition
R3BParView.h:20
R3B::ParView::operator*
auto operator*() -> Type &
Definition
R3BParView.h:49
R3B::ParView::set
auto set(Type *par) -> Type *
Set the pointer of the parameter.
Definition
R3BParView.h:45
R3B::ParView::name_
std::string name_
Definition
R3BParView.h:52
R3B::ParView::Type
ParType Type
Definition
R3BParView.h:13
R3B::ParView::get_name
auto get_name() const -> std::string_view
Get the name of the paramter.
Definition
R3BParView.h:38
R3B::ParView::get
auto get() const -> Type *
Get the parameter pointer.
Definition
R3BParView.h:31
R3B::ParView::operator->
auto operator->() -> Type *
Definition
R3BParView.h:47
R3B
Definition
R3BNeulandAnalysisApp.cxx:44
r3bbase
R3BParView.h
Generated by
1.18.0