Loading...
Searching...
No Matches
piercedVectorKernel.hpp
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#ifndef __BITPIT_PIERCED_VECTOR_KERNEL_HPP__
26#define __BITPIT_PIERCED_VECTOR_KERNEL_HPP__
27
28#include <cassert>
29
30#include "piercedKernel.hpp"
31
32namespace bitpit {
33
35
36public:
37 virtual ~BasePiercedVectorKernel() = default;
38
39protected:
41
42};
43
49template<typename id_t = long>
51 public PiercedKernel<id_t> {
52
53public:
54 // Methods that extract information on the ids contained in the kernel
55 std::size_t rawIndex(id_t id) const;
56 bool exists(id_t id) const;
57
58 // Dump and restore
59 using PiercedKernel<id_t>::dump;
60 using PiercedKernel<id_t>::restore;
61
62protected:
63 // Constructors
65
66 // Methods that modify the elements stored in the kernel
67 using PiercedKernel<id_t>::fillHead;
68 using PiercedKernel<id_t>::fillTail;
69 using PiercedKernel<id_t>::fillAfter;
70 using PiercedKernel<id_t>::fillBefore;
71 using PiercedKernel<id_t>::fillAppend;
72 using PiercedKernel<id_t>::fillHole;
73 using PiercedKernel<id_t>::fillInsert;
74
75 using PiercedKernel<id_t>::moveAfter;
76 using PiercedKernel<id_t>::moveBefore;
77
78 using PiercedKernel<id_t>::swap;
79
80 using PiercedKernel<id_t>::erase;
81 using PiercedKernel<id_t>::popBack;
82
83 // Methods that extract information about the elements of the kernel
84 using PiercedKernel<id_t>::back;
85 using PiercedKernel<id_t>::front;
86
87};
88
89}
90
91// Include the implementation
92#include "piercedVectorKernel.tpp"
93
94#endif
Base class for pierced vector kernels.
Metafunction for generating a pierced kernel.
FillAction fillHole(std::size_t hole, id_t id)
EraseAction erase(id_t id, bool flush=false)
FillAction fillAppend(id_t id)
MoveAction moveAfter(id_t referenceId, id_t id, bool flush=false)
FillAction fillAfter(id_t referenceId, id_t id)
FillAction fillBefore(id_t referenceId, id_t id)
FillAction fillInsert(std::size_t pos, id_t id)
std::size_t front() const
void swap(PiercedKernel &other) noexcept
FillAction fillHead(id_t id)
void restore(std::istream &stream)
FillAction fillTail(id_t id)
MoveAction moveBefore(id_t referenceId, id_t id, bool flush=false)
std::size_t back() const
Kernel of the pierced vector.
std::size_t rawIndex(id_t id) const
--- layout: doxygen_footer ---