00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 00002 * 00003 * $Id: vtkObjectBaseStack.h,v 1.5 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_STACK_H_ 00017 # define VTK_OBJECT_BASE_STACK_H_ 00018 # include "vtkContainer.h" 00019 # include "vtkObjectBaseStackIterator.h" // Covariant return type. 00020 00021 VTK_EXTENSIONS_CONTAINERS_NAMESPACE_BEGIN 00022 00023 class vtkObjectBaseStackInternal; 00024 00038 class VTK_EXTENSIONS_CONTAINERS_EXPORT vtkObjectBaseStack 00039 : public vtkContainer 00040 { 00041 public: 00042 static vtkObjectBaseStack* New (void); 00043 vtkTypeRevisionMacro (vtkObjectBaseStack, vtkContainer); 00044 00046 vtkIdType GetSize (void) const; 00047 00049 int IsEmpty (void) const; 00050 00052 vtkIdType GetMaxSize (void) const; 00053 00055 void Clear (void); 00056 00061 virtual int Swap (vtkObjectBaseStack* container); 00062 00074 virtual int Push (vtkObjectBase* object); 00075 00085 int Pop (void); 00086 00091 virtual vtkObjectBase* Top (void) const; 00095 vtkObjectBaseStackIterator* CreateIterator (void); 00096 00097 protected: 00098 vtkObjectBaseStack (void); 00099 ~vtkObjectBaseStack(); 00100 00101 private: 00102 //BTX 00103 vtkObjectBaseStackInternal* Internal; 00104 00105 friend class vtkObjectBaseStackIterator; 00106 00114 vtkObjectBase* Front (void) const; 00115 00121 vtkObjectBase* Back (void) const; 00126 int Swap (vtkContainer* a) 00127 { return this->Swap(static_cast<vtkObjectBaseStack*>(a)); } 00129 //ETX 00130 00131 private: 00137 vtkObjectBaseStack (const vtkObjectBaseStack&); 00138 void operator= (const vtkObjectBaseStack&); 00140 }; 00141 00142 // ---------------------------------------------------------------------------- 00143 inline vtkObjectBase* 00144 vtkObjectBaseStack::Top (void) const 00145 { 00146 return this->Back(); 00147 } 00148 00149 VTK_EXTENSIONS_CONTAINERS_NAMESPACE_END 00150 00151 #endif /* VTK_OBJECT_BASE_STACK_H_ */ 00152 /* 00153 * End of: $Id: vtkObjectBaseStack.h,v 1.5 2004/06/03 18:58:28 xpxqx Exp $. 00154 * 00155 */