VTK  9.2.6
vtkObjectFactoryCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkObjectFactoryCollection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkObjectFactoryCollection_h
30 #define vtkObjectFactoryCollection_h
31 
32 #include "vtkCollection.h"
33 #include "vtkCommonCoreModule.h" // For export macro
34 
35 #include "vtkObjectFactory.h" // Needed for inline methods
36 
37 class VTKCOMMONCORE_EXPORT vtkObjectFactoryCollection : public vtkCollection
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
48 
54  {
55  return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject());
56  }
57 
63  {
64  return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject(cookie));
65  }
66 
67 protected:
68  vtkObjectFactoryCollection() = default;
69  ~vtkObjectFactoryCollection() override = default;
70 
71 private:
72  // hide the standard AddItem from the user and the compiler.
73  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
74 
75 private:
77  void operator=(const vtkObjectFactoryCollection&) = delete;
78 };
79 
80 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51
vtkObjectFactory * GetNextObjectFactory(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
abstract base class for most VTK objects
Definition: vtkObject.h:62
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCollection * New()
Construct with empty list.
maintain a list of object factories
vtkObjectFactory * GetNextItem()
Get the next ObjectFactory in the list.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:55
void AddItem(vtkObjectFactory *t)
Add an ObjectFactory the bottom of the list.
abstract base class for vtkObjectFactories
vtkObject * GetNextItemAsObject()
Get the next item in the collection.