VTK
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 "vtkCommonSystemModule.h" // For export macro
28 #include "vtkCollection.h"
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) VTK_OVERRIDE;
37 
38  // Add Socket to the collection.
39  void AddItem(vtkSocket* soc);
40 
47  int SelectSockets(unsigned long msec =0);
48 
54  {return this->SelectedSocket; }
55 
57 
60  void ReplaceItem(int i, vtkObject *);
61  void RemoveItem(int i);
62  void RemoveItem(vtkObject *);
63  void RemoveAllItems();
65 
66 protected:
68  ~vtkSocketCollection() VTK_OVERRIDE;
69 
70  vtkSocket* SelectedSocket;
71 private:
72  // Hide the standard AddItem.
73  void AddItem(vtkObject* o) { this->Superclass::AddItem(o); }
74 
75 private:
76  vtkSocketCollection(const vtkSocketCollection&) VTK_DELETE_FUNCTION;
77  void operator=(const vtkSocketCollection&) VTK_DELETE_FUNCTION;
78 };
79 
80 #endif
81 
void ReplaceItem(int i, vtkObject *)
Replace the i'th item in the collection with a.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
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 list.
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:51
BSD socket encapsulation.
Definition: vtkSocket.h:30
void RemoveItem(int i)
Remove the i'th item in the list.