SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StackVector.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2009 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 ///
30 ///@file StackVector.h
31 ///@brief Interface to statically allocated std::vector class.
32 ///
33 ///@author Michael Callahan
34 /// Department of Computer Science
35 /// University of Utah
36 ///@date July 2004
37 ///
38 
39 /// This implements a subclass of the std::vector class, except that
40 /// the vector is statically allocated on the stack for performance.
41 
42 #ifndef SCI_Containers_StackVector_h
43 #define SCI_Containers_StackVector_h 1
44 
45 #include <boost/array.hpp>
46 
47 namespace SCIRun {
48 
49 template <class T, int CAPACITY>
50 class StackVector : public boost::array<T, CAPACITY>
51 {
52 public:
53  typedef boost::array<T, CAPACITY> base_type;
54  typedef typename base_type::value_type value_type;
55 
57  StackVector(size_t size, const value_type& v = value_type())
58  {
59  this->fill(v);
60  }
61  void resize(size_t size, const value_type& val = value_type())
62  {
63  //not sure what to do here. semantics is different, but SCIRun 4 probably overruns buffers all the time anyway...
64  }
65  void clear() {}
66 };
67 
68 } // End namespace SCIRun
69 
70 
71 #endif /* SCI_Containers_StackVector_h */
72 
boost::array< T, CAPACITY > base_type
Definition: StackVector.h:53
base_type::value_type value_type
Definition: StackVector.h:54
Definition: StackVector.h:50
v
Definition: readAllFields.py:42
void clear()
Definition: StackVector.h:65
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
StackVector()
Definition: StackVector.h:56
int size
Definition: eabLatVolData.py:2