casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
vector.h
Go to the documentation of this file.
00001 //# vector.h: Interim solution for standard/nonstandard system vector
00002 //# Copyright (C) 2002,2003,2004
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: vector.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
00027 
00028 #ifndef CASA_STD_VECTOR_H
00029 #define CASA_STD_VECTOR_H
00030 
00031 //# Define the standard C++ include file. 
00032 //# This is an interim solution to cater for the SGI non-existence of
00033 //# them (e.g. <cstring>)
00034 //# Make sure any special macros are set
00035 #include <casa/aips.h>
00036 
00037 #if !defined(AIPS_SGI)
00038 #include <vector>
00039 using std::vector;
00040 #else
00041 #include <vector.h>
00042 #endif
00043 
00044 namespace casa { //# NAMESPACE CASA - BEGIN
00045 
00046 //# A special macro to create the auxilliary template definitions for
00047 //# various compilers
00048 //# Use if defined a vector<T> as AIPS_VECTOR_AUX_TEMPLATES(T)
00049 
00050 #if defined(AIPS_VECTOR_AUX_TEMPLATES)
00051 #undef AIPS_VECTOR_AUX_TEMPLATES
00052 #endif
00053 
00054 #if !defined(AIPS_AUTO_STL)
00055 # if defined(AIPS_GCC)
00056 #  if defined(AIPS_GCC3) || defined(AIPS_GCC4)
00057 #   define AIPS_VECTOR_AUX_TEMPLATES(T) \
00058 using casa::uInt; \
00059 using casa::uLong; \
00060 template \
00061    T *std::__uninitialized_copy_aux<T *, T *>(T *, T *, T *, __false_type); \
00062 template \
00063    T* std::__uninitialized_copy_aux<vector<T >::iterator , T *>(vector<T >::iterator , vector<T >::iterator , T *, __false_type); \
00064 template \
00065    T* std::__uninitialized_copy_aux<vector<T >::const_iterator , T *>(vector<T >::const_iterator , vector<T >::const_iterator , T *, __false_type); \
00066 template \
00067    vector<T >::iterator std::__uninitialized_copy_aux<vector<T >::iterator , vector<T >::iterator>(vector<T >::iterator , vector<T >::iterator , vector<T >::iterator, __false_type); \
00068 template \
00069    T *std::__uninitialized_copy_aux<T const *, T *>(T const *, T const *, \
00070                                                                     T *, __false_type); \
00071 template \
00072    vector<T >::iterator std::fill_n<vector<T >::iterator, uInt, T >(vector<T >::iterator, uInt, T const &); \
00073 template \
00074    vector<T >::iterator std::fill_n<vector<T >::iterator, uLong, T >(vector<T >::iterator, uLong, T const &); \
00075 template \
00076    T *std::fill_n<T *, uInt, T >(T *, uInt, T const &); \
00077 template \
00078    T *std::fill_n<T *, uLong, T >(T *, uLong, T const &); \
00079 template \
00080    void std::fill<vector<T >::iterator, T >(vector<T >::iterator, vector<T >::iterator, T const &); \
00081 template \
00082    void std::fill<T *, T >(T *, T *, T const &); \
00083 template \
00084    vector<T >::iterator std::__uninitialized_fill_n_aux<vector<T >::iterator, uInt, T >(vector<T >::iterator, uInt, \
00085               T const &, __false_type); \
00086 template \
00087    T *std::__uninitialized_fill_n_aux<T *, uInt, T >(T *, uInt, \
00088 T const &, __false_type); \
00089 template \
00090    vector<T >::iterator std::__uninitialized_fill_n_aux<vector<T >::iterator, uLong, T >(vector<T >::iterator, uLong, \
00091               T const &, __false_type); \
00092 template \
00093    T *std::__uninitialized_fill_n_aux<T *, uLong, T >(T *, uLong, \
00094 T const &, __false_type); \
00095 template \
00096    void vector<T, std::allocator<T> >:: \
00097 _M_assign_aux(T const *, T const *, forward_iterator_tag);
00098 #  else
00099 #   define AIPS_VECTOR_AUX_TEMPLATES(T) \
00100 template \
00101 T *std::__uninitialized_copy_aux<T *, T *>(T *, T *, T *, __false_type); \
00102 template \
00103 T *std::__uninitialized_copy_aux<T const *, T *>(T const *, T const *, \
00104                                             T *, __false_type); \
00105 template \
00106    vector<T >::iterator std::__uninitialized_fill_n_aux<vector<T >::iterator, uInt, T >(vector<T >::iterator, uInt, \
00107               T const &, __false_type); \
00108 template \
00109    vector<T >::iterator std::__uninitialized_fill_n_aux<vector<T >::iterator, uLong, T >(vector<T >::iterator, uLong, \
00110               T const &, __false_type); \
00111 template \
00112 T *std::fill_n<T *, uInt, T >(T *, uInt, T const &); \
00113 template \
00114 void std::fill<T *, T >(T *, T *, T const &); \
00115 template \
00116 void vector<T, std::allocator<T> >:: \
00117 _M_assign_aux(T const *, T const *, forward_iterator_tag);
00118 #  endif
00119 
00120 # else
00121 #  if defined(AIPS_SUN_NATIVE)
00122 #   define AIPS_VECTOR_AUX_TEMPLATES(T) \
00123 template T* std::copy_backward<const T*, T* >(const T*, const T*, T*);\
00124 template T* std::copy_backward<T*, T* >(T*, T*, T*);\
00125 template T* std::copy<const T*, T* >(const T*, const T*, T*);\
00126 template T* std::copy<T*, T* >(T*, T*, T*);\
00127 template void std::fill<T*, T >(T*, T*, const T&);
00128 #  else
00129 #   define AIPS_VECTOR_AUX_TEMPLATES(T)
00130 #  endif
00131 # endif
00132 #else
00133 # define AIPS_VECTOR_AUX_TEMPLATES(T)
00134 #endif
00135 
00136 
00137 } //# NAMESPACE CASA - END
00138 
00139 #endif