VTK  9.3.0
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
25VTK_ABI_NAMESPACE_BEGIN
26class VTKCOMMONCORE_EXPORT vtkObjectFactoryCollection : public vtkCollection
27{
28public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
37
43 {
44 return static_cast<vtkObjectFactory*>(this->GetNextItemAsObject());
45 }
46
55
56protected:
58 ~vtkObjectFactoryCollection() override = default;
59
60private:
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
68VTK_ABI_NAMESPACE_END
69#endif
create and manipulate ordered lists of objects
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:29
maintain a list of object factories
~vtkObjectFactoryCollection() override=default
void AddItem(vtkObjectFactory *t)
Add an ObjectFactory the bottom of 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()
vtkObjectFactory * GetNextItem()
Get the next ObjectFactory in the list.
abstract base class for vtkObjectFactories
abstract base class for most VTK objects
Definition vtkObject.h:52
void * vtkCollectionSimpleIterator