VTK  9.3.1
vtkObjectFactoryCollection.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkObjectFactoryCollection_h
18 #define vtkObjectFactoryCollection_h
19 
20 #include "vtkCollection.h"
21 #include "vtkCommonCoreModule.h" // For export macro
22 
23 #include "vtkObjectFactory.h" // Needed for inline methods
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKCOMMONCORE_EXPORT vtkObjectFactoryCollection : public vtkCollection
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
37 
43  {
44  return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject());
45  }
46 
52  {
53  return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject(cookie));
54  }
55 
56 protected:
57  vtkObjectFactoryCollection() = default;
58  ~vtkObjectFactoryCollection() override = default;
59 
60 private:
61  // hide the standard AddItem from the user and the compiler.
62  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
63 
65  void operator=(const vtkObjectFactoryCollection&) = delete;
66 };
67 
68 VTK_ABI_NAMESPACE_END
69 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkObjectFactory * GetNextObjectFactory(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
abstract base class for most VTK objects
Definition: vtkObject.h:51
a simple class to control print indentation
Definition: vtkIndent.h:28
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:44
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.