VTK: Common/System/vtkSocketCollection.h Source File

| VTK 9.3.1

vtkSocketCollection.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
12 #ifndef vtkSocketCollection_h
13 #define vtkSocketCollection_h
14
15 #include "vtkCollection.h"
16 #include "vtkCommonSystemModule.h" // For export macro
17
18 VTK_ABI_NAMESPACE_BEGIN
19 class vtkSocket;
20 class VTKCOMMONSYSTEM_EXPORT vtkSocketCollection : public vtkCollection
21 {
22 public:
23 static vtkSocketCollection* New();
24 vtkTypeMacro(vtkSocketCollection, vtkCollection);
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
27 // Add Socket to the collection.
28 void AddItem(vtkSocket* soc);
29
36 int SelectSockets(unsigned long msec = 0);
37
42 vtkSocket* GetLastSelectedSocket() { return this->SelectedSocket; }
43
45
48 void ReplaceItem(int i, vtkObject*);
49 void RemoveItem(int i);
50 void RemoveItem(vtkObject*);
51 void RemoveAllItems();
53
54 protected:
55 vtkSocketCollection();
56 ~vtkSocketCollection() override;
57
58 vtkSocket* SelectedSocket;
59
60 private:
61 // Hide the standard AddItem.
62 void AddItem(vtkObject* o) { this->Superclass::AddItem(o); }
63
64 vtkSocketCollection(const vtkSocketCollection&) = delete;
65 void operator=(const vtkSocketCollection&) = delete;
66 };
67
68 VTK_ABI_NAMESPACE_END
69 #endif
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkSocketCollection
a collection for sockets.
Definition: vtkSocketCollection.h:21
vtkSocketCollection::RemoveItem
void RemoveItem(int i)
Overridden to unset SelectedSocket.
vtkSocketCollection::SelectedSocket
vtkSocket * SelectedSocket
Definition: vtkSocketCollection.h:58
vtkSocketCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSocketCollection::GetLastSelectedSocket
vtkSocket * GetLastSelectedSocket()
Returns the socket selected during the last SelectSockets(), if any.
Definition: vtkSocketCollection.h:42
vtkSocketCollection::RemoveItem
void RemoveItem(vtkObject *)
Overridden to unset SelectedSocket.
vtkSocketCollection::New
static vtkSocketCollection * New()
vtkSocketCollection::AddItem
void AddItem(vtkSocket *soc)
vtkSocketCollection::ReplaceItem
void ReplaceItem(int i, vtkObject *)
Overridden to unset SelectedSocket.
vtkSocketCollection::~vtkSocketCollection
~vtkSocketCollection() override
vtkSocketCollection::SelectSockets
int SelectSockets(unsigned long msec=0)
Select all Connected sockets in the collection.
vtkSocketCollection::RemoveAllItems
void RemoveAllItems()
Overridden to unset SelectedSocket.
vtkSocketCollection::vtkSocketCollection
vtkSocketCollection()
vtkSocket
BSD socket encapsulation.
Definition: vtkSocket.h:20
vtkCollection.h