Alexandria  2.18
Please provide a description of the project.
GridCellManagerTraits.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2021 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 <memory>
29 #include <vector>
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 
113 template <typename T>
114 struct GridCellManagerTraits<std::vector<T>> {
115 
117  typedef T data_type;
118 
122 
125 
127  static size_t size(const std::vector<T>& vector);
128 
130  static iterator begin(std::vector<T>& vector);
131 
133  static iterator end(std::vector<T>& vector);
134 
136  static const bool enable_boost_serialize = true;
137 
138 }; // end of GridCellManagerTraits vector specialization
139 
140 } // end of namespace GridContainer
141 } // end of namespace Euclid
142 
144 
145 #endif /* GRIDCONTAINER_GRIDCELLMANAGERTRAITS_H */
Euclid::GridContainer::GridCellManagerTraits< std::vector< T > >::iterator
std::vector< T >::iterator iterator
Definition: GridCellManagerTraits.h:121
Euclid::GridContainer::GridCellManagerTraits< std::vector< T > >::size
static size_t size(const std::vector< T > &vector)
Returns the size of the vector.
Euclid::GridContainer::GridCellManagerTraits::factory
static std::unique_ptr< GridCellManager > factory(size_t size)
Euclid::GridContainer::GridCellManagerTraits::begin
static iterator begin(GridCellManager &cell_manager)
Euclid::GridContainer::GridCellManagerTraits::enable_boost_serialize
static const bool enable_boost_serialize
Definition: GridCellManagerTraits.h:101
Euclid::GridContainer::GridCellManagerTraits::end
static iterator end(GridCellManager &cell_manager)
std::vector
STL class.
GridCellManagerTraits.icpp
Euclid::GridContainer::GridCellManagerTraits< std::vector< T > >::begin
static iterator begin(std::vector< T > &vector)
Returns an iterator at the first element of the vector.
Euclid::GridContainer::GridCellManagerTraits::iterator
GridCellManager::iterator iterator
Definition: GridCellManagerTraits.h:57
Euclid::GridContainer::GridCellManagerTraits< std::vector< T > >::end
static iterator end(std::vector< T > &vector)
Returns an iterator right after the last element of the vector.
Euclid::GridContainer::GridCellManagerTraits< std::vector< T > >::data_type
T data_type
The type of the data kept by the GridCellManager.
Definition: GridCellManagerTraits.h:117
Euclid::GridContainer::GridCellManagerTraits
Class used by the GridContainer to access the different CellManagers.
Definition: GridCellManagerTraits.h:50
std
STL namespace.
Euclid::GridContainer::GridCellManagerTraits::size
static size_t size(const GridCellManager &cell_manager)
std::unique_ptr
STL class.
Euclid
Definition: InstOrRefHolder.h:29
Euclid::GridContainer::GridCellManagerTraits< std::vector< T > >::factory
static std::unique_ptr< std::vector< T > > factory(size_t size)
Returns a vector containing "size" default constructed elements.
Euclid::GridContainer::GridCellManagerTraits::data_type
GridCellManager::data_type data_type
The type of the data kept by the GridCellManager.
Definition: GridCellManagerTraits.h:53