Alexandria  2.16
Please provide a description of the project.
GridCellManagerTraits.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2020 Euclid Science Ground Segment
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 3.0 of the License, or (at your option)
7  * any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
25 #ifndef GRIDCONTAINER_GRIDCELLMANAGERTRAITS_H
26 #define GRIDCONTAINER_GRIDCELLMANAGERTRAITS_H
27 
28 #include <vector>
29 #include <memory>
30 
31 namespace Euclid {
32 namespace GridContainer {
33 
49 template<typename GridCellManager>
51 
53  typedef typename GridCellManager::data_type data_type;
54 
57  typedef typename GridCellManager::iterator iterator;
58 
68 
76  static size_t size(const GridCellManager& cell_manager);
77 
86  static iterator begin(GridCellManager& cell_manager);
87 
96  static iterator end(GridCellManager& cell_manager);
97 
101  static const bool enable_boost_serialize = false;
102 
103 }; // end of GridCellManagerTraits
104 
105 
114 template<typename T>
115 struct GridCellManagerTraits<std::vector<T>> {
116 
118  typedef T data_type;
119 
123 
126 
128  static size_t size(const std::vector<T>& vector);
129 
131  static iterator begin(std::vector<T>& vector);
132 
134  static iterator end(std::vector<T>& vector);
135 
137  static const bool enable_boost_serialize = true;
138 
139 }; // end of GridCellManagerTraits vector specialization
140 
141 } // end of namespace GridContainer
142 } // end of namespace Euclid
143 
145 
146 #endif /* GRIDCONTAINER_GRIDCELLMANAGERTRAITS_H */
147 
Class used by the GridContainer to access the different CellManagers.
STL namespace.
T data_type
The type of the data kept by the GridCellManager.
static size_t size(const GridCellManager &cell_manager)
STL class.
STL class.
static std::unique_ptr< GridCellManager > factory(size_t size)
static iterator end(GridCellManager &cell_manager)
GridCellManager::data_type data_type
The type of the data kept by the GridCellManager.
static iterator begin(GridCellManager &cell_manager)