VTK  9.0.1
vtkSocketCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSocketCollection.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 =========================================================================*/
24 #ifndef vtkSocketCollection_h
25 #define vtkSocketCollection_h
26 
27 #include "vtkCollection.h"
28 #include "vtkCommonSystemModule.h" // For export macro
29 
30 class vtkSocket;
31 class VTKCOMMONSYSTEM_EXPORT vtkSocketCollection : public vtkCollection
32 {
33 public:
34  static vtkSocketCollection* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
38  // Add Socket to the collection.
39  void AddItem(vtkSocket* soc);
40 
47  int SelectSockets(unsigned long msec = 0);
48 
53  vtkSocket* GetLastSelectedSocket() { return this->SelectedSocket; }
54 
56 
59  void ReplaceItem(int i, vtkObject*);
60  void RemoveItem(int i);
61  void RemoveItem(vtkObject*);
62  void RemoveAllItems();
64 
65 protected:
67  ~vtkSocketCollection() override;
68 
70 
71 private:
72  // Hide the standard AddItem.
73  void AddItem(vtkObject* o) { this->Superclass::AddItem(o); }
74 
75 private:
77  void operator=(const vtkSocketCollection&) = delete;
78 };
79 
80 #endif
void ReplaceItem(int i, vtkObject *)
Replace the i'th item in the collection with another item.
abstract base class for most VTK objects
Definition: vtkObject.h:62
void RemoveAllItems()
Remove all objects from the list.
a collection for sockets.
vtkSocket * GetLastSelectedSocket()
Returns the socket selected during the last SelectSockets(), if any.
a simple class to control print indentation
Definition: vtkIndent.h:33
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.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
BSD socket encapsulation.
Definition: vtkSocket.h:30
void RemoveItem(int i)
Remove the i'th item in the list.