2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $TOG: cc_pvect.C /main/6 1998/04/17 11:45:20 mgreess $
25 #include "dti_cc/cc_exceptions.h"
28 pointer_vector<T>::pointer_vector(const pointer_vector<T>& pv) :
29 f_array(new Tptr[pv.f_size]), f_size(pv.f_size), f_items(pv.f_items)
31 for (int i=0; i<pv.f_size; i++ )
32 f_array[i] = pv.f_array[i];
34 cerr << "Warning: pointer_vector(const pointer_vector&) called" << endl;
39 pointer_vector<T>::pointer_vector(size_t n, T* t)
40 : f_array(new Tptr[n]), f_size(n), f_items(0)
42 for ( size_t i=0; i<f_size; i++ )
47 pointer_vector<T>::~pointer_vector()
53 T* pointer_vector<T>::operator[](ptrdiff_t i) const
55 if ( i < 0 || i >= (ptrdiff_t)f_size )
56 throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
62 T*& pointer_vector<T>::operator[](ptrdiff_t i)
64 if ( i < 0 || i >= (ptrdiff_t)f_size )
65 throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));