00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 00002 * 00003 * $Id: vtkObjectBaseVector.h,v 1.2 2004/06/03 18:58:28 xpxqx Exp $ 00004 * 00005 * Copyright (c) 2004 Sean McInerney 00006 * All rights reserved. 00007 * 00008 * See Copyright.txt or http://vtkextensions.sourceforge.net/Copyright.html 00009 * 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 */ 00016 #ifndef VTK_OBJECT_BASE_VECTOR_H_ 00017 # define VTK_OBJECT_BASE_VECTOR_H_ 00018 # include "vtkAbstractSequence.h" 00019 # include "vtkObjectBaseVectorIterator.h" // Covariant return type. 00020 00021 VTK_EXTENSIONS_CONTAINERS_NAMESPACE_BEGIN 00022 00023 class vtkObjectBaseVectorInternal; 00024 00036 class VTK_EXTENSIONS_CONTAINERS_EXPORT vtkObjectBaseVector 00037 : public vtkAbstractSequence 00038 { 00039 public: 00040 static vtkObjectBaseVector* New (void); 00041 vtkTypeRevisionMacro (vtkObjectBaseVector, vtkAbstractSequence); 00042 void PrintSelf (ostream&, vtkIndent); 00043 00045 vtkIdType GetSize (void) const; 00046 00048 int IsEmpty (void) const; 00049 00051 vtkIdType GetMaxSize (void) const; 00052 00054 void Clear (void); 00055 00060 virtual int Swap (vtkObjectBaseVector* container); 00061 00066 vtkIdType GetCapacity (void) const; 00067 00074 int SetCapacity (vtkIdType capacity); 00075 00079 int GetResize (void) const; 00080 void SetResize (int a); 00081 vtkBooleanMacro (Resize, int); 00091 vtkObjectBase* At (vtkIdType position) const; 00092 00097 vtkIdType Find (const vtkObjectBase* object) const; 00098 00099 //BTX 00104 vtkIdType Find (const vtkObjectBase* object, 00105 CompareFunction comparison) const; 00106 //ETX 00107 00119 int Insert (vtkIdType position, 00120 vtkObjectBase* object); 00121 00130 int PushBack (vtkObjectBase* object); 00131 00136 int Assign (vtkIdType position, 00137 vtkObjectBase* object); 00138 00146 int Erase (vtkIdType position); 00147 00148 // /** Sort the content of the list. 00149 // * 00150 // * Provide a comparison function (see def of vtkVectorSortFunctionType). 00151 // */ 00152 // void Sort(vtkVectorSortFunctionType); 00153 00161 vtkObjectBase* Front (void) const; 00162 00168 vtkObjectBase* Back (void) const; 00172 vtkObjectBaseVectorIterator* CreateIterator (void); 00173 00174 protected: 00175 vtkObjectBaseVector (void); 00176 ~vtkObjectBaseVector(); 00177 00178 private: 00179 //BTX 00180 vtkObjectBaseVectorInternal* Internal; 00181 00182 friend class vtkObjectBaseVectorIterator; 00183 00186 int Swap (vtkAbstractSequence* sequence) 00187 { return this->Swap(static_cast<vtkObjectBaseVector*>(sequence)); } 00189 //ETX 00190 00191 private: 00192 vtkObjectBaseVector (const vtkObjectBaseVector&); 00193 void operator= (const vtkObjectBaseVector&); 00194 }; 00195 00196 #endif /* VTK_OBJECT_BASE_VECTOR_H_ */ 00197 /* 00198 * End of: $Id: vtkObjectBaseVector.h,v 1.2 2004/06/03 18:58:28 xpxqx Exp $. 00199 * 00200 */