VTK  9.3.20240328
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
14 #ifndef vtkObjectFactoryCollection_h
15 #define vtkObjectFactoryCollection_h
16 
17 #include "vtkCollection.h"
18 #include "vtkCommonCoreModule.h" // For export macro
19 
20 #include "vtkObjectFactory.h" // Needed for inline methods
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class VTKCOMMONCORE_EXPORT vtkObjectFactoryCollection : public vtkCollection
24 {
25 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
34 
40  {
41  return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject());
42  }
43 
49  {
50  return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject(cookie));
51  }
52 
53 protected:
55  ~vtkObjectFactoryCollection() override = default;
56 
57 private:
58  // hide the standard AddItem from the user and the compiler.
59  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
60 
62  void operator=(const vtkObjectFactoryCollection&) = delete;
63 };
64 
65 VTK_ABI_NAMESPACE_END
66 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
a simple class to control print indentation
Definition: vtkIndent.h:108
maintain a list of object factories
~vtkObjectFactoryCollection() override=default
void AddItem(vtkObjectFactory *t)
Add an ObjectFactory the bottom of the list.
vtkObjectFactory * GetNextItem()
Get the next ObjectFactory in the list.
vtkObjectFactory * GetNextObjectFactory(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObjectFactoryCollection()=default
static vtkObjectFactoryCollection * New()
abstract base class for vtkObjectFactories
abstract base class for most VTK objects
Definition: vtkObject.h:161
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40