/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: vctContainerTraits.h,v 1.9 2007/04/26 19:33:57 anton Exp $ Author(s): Anton Deguet Created on: 2004-11-11 (C) Copyright 2004-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ /*! \file \brief Basic traits for the cisstVector containers \ingroup cisstVector */ #ifndef _vctContainerTraits_h #define _vctContainerTraits_h /*! Macro used to define multiple types based on the type of elements. This will define size_type, index_type, difference_type, stride_type, value_type, reference, const_reference, pointer, const_pointer, NormType (double) and AngleType (double). Most of these types are introduced and named for STL compatibility. \param type Type of element, e.g. double, float, char. */ #define VCT_CONTAINER_TRAITS_TYPEDEFS(type) \ typedef unsigned int size_type; \ typedef unsigned int index_type; \ typedef int difference_type; \ typedef int stride_type; \ typedef type value_type; \ typedef value_type & reference; \ typedef const value_type & const_reference; \ typedef value_type * pointer; \ typedef const value_type * const_pointer; \ typedef double NormType; \ typedef double AngleType /*! Macro used to define nArray-specific types based on the type of elements. This will define nsize_type, nstride_type, and dimension_type. */ #define VCT_NARRAY_TRAITS_TYPEDEFS(dimension) \ typedef vctFixedSizeVector nsize_type; \ typedef vctFixedSizeVector nstride_type; \ typedef vctFixedSizeVector nindex_type; \ typedef unsigned int dimension_type; \ typedef vctFixedSizeVector ndimension_type #endif // _vctContainerTraits_h // **************************************************************************** // Change History // **************************************************************************** // // $Log: vctContainerTraits.h,v $ // Revision 1.9 2007/04/26 19:33:57 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.8 2007/03/08 04:29:25 anton // cisstVector NArray: Now templated by dimension (see #258). Added template // specialization for slices of dimension 1 NArray to return value_type. Used // Ofri's implementation of IncrementPointer() in loop engines (previous one did // not handle more than dimension 3). Also renamed DimSize, DimStride and // Dimension to size(d), stride(d), and dimensioni (for STL flavor). // // Revision 1.7 2006/12/09 04:13:25 anton // cisstVector: Imported code for NArray from Daniel Li with minor cleanup // for license, dos2unix, a few renamed methods and port to gcc. // // Revision 1.6 2006/11/20 20:33:20 anton // Licensing: Applied new license to cisstCommon, cisstVector, cisstNumerical, // cisstInteractive, cisstImage and cisstOSAbstraction. // // Revision 1.5 2005/12/23 21:27:31 anton // cisstVector: Minor updates for Doxygen 1.4.5. // // Revision 1.4 2005/09/26 15:41:47 anton // cisst: Added modelines for emacs and vi. // // Revision 1.3 2005/05/19 19:29:00 anton // cisst libs: Added the license to cisstCommon and cisstVector // // Revision 1.2 2005/01/06 23:36:00 anton // cisstVector Python: As mentioned in ticket #112, the introduction of the // class vctContainerTraits broke the Python SWIG wrapping. Found a solution // for SWIG 1.3.22 (it is known that 1.3.24 DOES NOT WORK). // // Revision 1.1 2004/11/11 20:35:46 anton // cisstVector: *: Added a vctContainerTraits to centralize the declarations // of size_type, difference_type, reference, const_reference, etc. *: All // iterators are now derived from std::iterator. *: Added some missing typedef // for iterators. // // // ****************************************************************************