ChimeraTK-ApplicationCore
04.06.00
Loading...
Searching...
No Matches
Visitor.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2
// SPDX-License-Identifier: LGPL-3.0-or-later
3
#pragma once
4
5
namespace
ChimeraTK
{
6
7
/********************************************************************************************************************/
8
9
/*
10
* Losely based on
11
* https://stackoverflow.com/questions/11796121/implementing-the-visitor-pattern-using-c-templates#11802080
12
*/
13
14
/********************************************************************************************************************/
15
16
template
<
typename
... Types>
17
class
Visitor
;
18
19
/********************************************************************************************************************/
20
21
template
<
typename
T>
22
class
Visitor
<T> {
23
public
:
24
virtual
void
dispatch
(
const
T& t) = 0;
25
};
26
27
/********************************************************************************************************************/
28
29
template
<
typename
T,
typename
... Types>
30
class
Visitor
<T, Types...> :
public
Visitor
<T>,
public
Visitor
<Types...> {
31
public
:
32
using
Visitor
<Types...>::dispatch;
33
using
Visitor
<T>::dispatch;
34
};
35
36
/********************************************************************************************************************/
37
38
}
// namespace ChimeraTK
ChimeraTK::Visitor< T >::dispatch
virtual void dispatch(const T &t)=0
ChimeraTK::Visitor
Definition
Visitor.h:17
ChimeraTK
InvalidityTracer application module.
Definition
spec_dataValidityPropagation.dox:2
sources
ChimeraTK-ApplicationCore
include
Visitor.h
Generated by
1.9.8