Loading...
Searching...
No Matches
PointersVector.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20#ifndef __TERRALIB_RP_RADAR_INTERNAL_POINTERS_VECTOR_H
21#define __TERRALIB_RP_RADAR_INTERNAL_POINTERS_VECTOR_H
22
23#include "../Config.h"
24
25#include <vector>
26
27namespace te
28{
29 namespace rp
30 {
31 namespace radar
32 {
33 /*!
34 \class PointersVector
35 \brief A pointers vector.
36 */
37 template< typename PointerType >
38 class PointersVector : public std::vector< PointerType >
39 {
40 public :
41
43
45 {
46 clear();
47 };
48
49 void clear()
50 {
51 std::size_t size = std::vector< PointerType >::size();
52 for( std::size_t idx = 0 ; idx < size ; ++idx )
53 {
54 delete std::vector< PointerType >::operator[]( idx );
55 }
56
57 std::vector< PointerType >::clear();
58 }
59
60 void copyPointersTo( std::vector< PointerType >& outVec )
61 {
62 outVec.clear();
63
64 std::size_t size = std::vector< PointerType >::size();
65 for( std::size_t idx = 0 ; idx < size ; ++idx )
66 {
67 outVec[ idx ] =
68 std::vector< PointerType >::operator[]( idx );
69 }
70 }
71
72 };
73
74 } // end namespace radar
75 } // end namespace rp
76} // end namespace msc
77
78#endif // MSC_INTERNAL_FUNCTIONS_H
79
void copyPointersTo(std::vector< PointerType > &outVec)
TerraLib.