Common/vtkIdType.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Common/vtkIdType.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkIdType.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00043 #ifndef __vtkIdType_h
    00044 #define __vtkIdType_h
    00045
    00046 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE
    00047 Do_not_include_vtkIdType_directly__vtkSystemIncludes_includes_it;
    00048 #endif
    00049
    00050 // Choose an implementation for vtkIdType.
    00051 #define VTK_HAS_ID_TYPE
    00052 #ifdef VTK_USE_64BIT_IDS
    00053 # define VTK_ID_TYPE_IS_NOT_BASIC_TYPE
    00054 # define VTK_SIZEOF_ID_TYPE 8
    00055 # ifdef _WIN32
    00056 typedef __int64 vtkIdType;
    00057 #  define VTK_NEED_ID_TYPE_STREAM_OPERATORS
    00058 # else // _WIN32
    00059 typedef long long vtkIdType;
    00060 #  define VTK_NEED_ID_TYPE_STREAM_OPERATORS
    00061 # endif // _WIN32
    00062 #else // VTK_USE_64BIT_IDS
    00063 # define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_INT
    00064 typedef int vtkIdType;
    00065 #endif // VTK_USE_64BIT_IDS
    00066
    00067 // Define a wrapper class so that we can define streaming operators
    00068 // for vtkIdType without conflicting with other libraries'
    00069 // implementations.
    00070 class VTK_COMMON_EXPORT vtkIdTypeHolder
    00071 {
    00072 public:
    00073   vtkIdTypeHolder(vtkIdType& v): Value(v) {}
    00074   vtkIdType& Value;
    00075 private:
    00076   vtkIdTypeHolder& operator=(const vtkIdTypeHolder&); // Not Implemented.
    00077 };
    00078 VTK_COMMON_EXPORT ostream& operator << (ostream& os, vtkIdTypeHolder idh);
    00079 VTK_COMMON_EXPORT istream& operator >> (istream& is, vtkIdTypeHolder idh);
    00080
    00081 #endif