Horizon Official Technical Documentation
GridReferenceContainerVisitor.hpp
Go to the documentation of this file.
1/***************************************************
2 * _ _ _ *
3 * | | | | (_) *
4 * | |_| | ___ _ __ _ _______ _ __ *
5 * | _ |/ _ \| '__| |_ / _ \| '_ \ *
6 * | | | | (_) | | | |/ / (_) | | | | *
7 * \_| |_/\___/|_| |_/___\___/|_| |_| *
8 ***************************************************
9 * This file is part of Horizon (c).
10 *
11 * Copyright (c) 2019 Sagun K. (sagunxp@gmail.com).
12 * Copyright (c) 2019 Horizon Dev Team.
13 *
14 * Base Author - Sagun K. (sagunxp@gmail.com)
15 *
16 * This library is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this library. If not, see <http://www.gnu.org/licenses/>.
28 **************************************************/
29
30#ifndef HORIZON_CORE_STRUCTURES_GRIDREFERENCECONTAINERVISITOR_HPP
31#define HORIZON_CORE_STRUCTURES_GRIDREFERENCECONTAINERVISITOR_HPP
32
34
35/*============================*
36 * Visitor Helper Functions
37 *============================*/
38template<class VISITOR>
40{
41 // terminate condition container map list
42}
43
44template<class VISITOR, class T>
46{
47 v.Visit(c._element);
48}
49
50// recursion container map list
51template<class VISITOR, class H, class T>
53{
54 VisitorHelper(v, c._elements);
55 VisitorHelper(v, c._tail_elements);
56}
57
58// for GridReferenceContainer
59template<class VISITOR, class OBJECT_TYPES>
61{
63}
64
65/*============================*
66 * TypeContainerVisitor
67 *============================*/
68template<class VISITOR, class TYPE_CONTAINER>
70{
71public:
73
74 void Visit(TYPE_CONTAINER &c)
75 {
77 }
78
79 void Visit(const TYPE_CONTAINER &c) const
80 {
82 }
83
84private:
85 VISITOR &_visitor;
86};
87
88#endif /* HORIZON_CORE_STRUCTURES_GRIDREFERENCECONTAINERVISITOR_HPP */
void VisitorHelper(VISITOR &, GridTypeListContainer< TypeNull > &)
Definition: GridReferenceContainerVisitor.hpp:39
Definition: GridReferenceContainerVisitor.hpp:70
void Visit(TYPE_CONTAINER &c)
Definition: GridReferenceContainerVisitor.hpp:74
GridReferenceContainerVisitor(VISITOR &v)
Definition: GridReferenceContainerVisitor.hpp:72
VISITOR & _visitor
Definition: GridReferenceContainerVisitor.hpp:85
void Visit(const TYPE_CONTAINER &c) const
Definition: GridReferenceContainerVisitor.hpp:79
Definition: GridReferenceContainer.hpp:149
GridTypeListContainer< OBJECT_TYPES > & getElements(void)
Definition: GridReferenceContainer.hpp:171
Definition: GridReferenceContainer.hpp:47
Definition: GridReferenceContainer.hpp:41
GridRefManager< OBJECT > _element
Definition: GridReferenceContainer.hpp:42
Definition: TypeList.hpp:8