00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSocketCollection.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00023 #ifndef __vtkSocketCollection_h 00024 #define __vtkSocketCollection_h 00025 00026 #include "vtkCollection.h" 00027 00028 class vtkSocket; 00029 class VTK_COMMON_EXPORT vtkSocketCollection : public vtkCollection 00030 { 00031 public: 00032 static vtkSocketCollection* New(); 00033 vtkTypeMacro(vtkSocketCollection, vtkCollection); 00034 void PrintSelf(ostream& os, vtkIndent indent); 00035 00036 // Add Socket to the collection. 00037 void AddItem(vtkSocket* soc); 00038 00043 int SelectSockets(unsigned long msec =0); 00044 00046 00048 vtkSocket* GetLastSelectedSocket() 00049 {return this->SelectedSocket; } 00051 00053 00054 void ReplaceItem(int i, vtkObject *); 00055 void RemoveItem(int i); 00056 void RemoveItem(vtkObject *); 00057 void RemoveAllItems(); 00058 protected: 00059 vtkSocketCollection(); 00060 ~vtkSocketCollection(); 00062 00063 vtkSocket* SelectedSocket; 00064 private: 00065 // Hide the standard AddItem. 00066 void AddItem(vtkObject* o) { this->Superclass::AddItem(o); } 00067 00068 private: 00069 vtkSocketCollection(const vtkSocketCollection&); // Not implemented. 00070 void operator=(const vtkSocketCollection&); // Not implemented. 00071 }; 00072 00073 #endif 00074