Loading...
Searching...
No Matches
levelSetCache.cpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#include "levelSetCache.hpp"
26
27namespace bitpit {
28
32const std::vector<bool> LevelSetValueCacheEntry<bool>::m_dummyVector = std::vector<bool>(1, false);
33
38 : LevelSetValueCacheBaseEntry<bool>(false),
39 m_value(LevelSetValueCacheBaseEntry<bool>::m_dummyValue),
40 m_useVectorValue(false), m_vectorValue(m_dummyVector[0])
41{
42}
43
50 : LevelSetValueCacheBaseEntry<bool>(true),
51 m_value(value),
52 m_useVectorValue(false), m_vectorValue(m_dummyVector[0])
53{
54}
55
61LevelSetValueCacheEntry<bool>::LevelSetValueCacheEntry(const std::vector<bool>::reference &value)
62 : LevelSetValueCacheBaseEntry<bool>(true),
63 m_value(LevelSetValueCacheBaseEntry<bool>::m_dummyValue),
64 m_useVectorValue(true), m_vectorValue(value)
65{
66}
67
74{
75 if (m_useVectorValue) {
76 return m_vectorValue;
77 } else {
78 return m_value;
79 }
80}
81
99
100}
ElementCacheCollection(const PiercedKernel< key_type > *kernel)
const value_t & operator*() const
Metafunction for generating a pierced kernel.
--- layout: doxygen_footer ---