ROOT logo
// $Id: GSelector.h 2715 2012-04-05 17:25:48Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef Gled_GSelector_H
#define Gled_GSelector_H

#include <Gled/GledTypes.h>
#include <Gled/GMutex.h>
#include <map>

class TSocket;

struct GFdSet : public map<void*,Int_t>
{
  void Add(void* ud, Int_t fd);
  void Add(TSocket* s);
  void Remove(void* ud);
};

typedef GFdSet::iterator GFdSet_i;

class GSelector : public GMutex
{
public:
  enum Error_e { SE_Null=0, SE_BadFD, SE_Interrupt,
		 SE_BadArg, SE_NoMem, SE_Unknown };

  Error_e	fError;

  GFdSet	fRead;
  GFdSet	fWrite;
  GFdSet	fExcept;
  GFdSet	fReadOut;
  GFdSet	fWriteOut;
  GFdSet	fExceptOut;
  Float_t	fTimeOut;

public:
  GSelector(Init_e e=fast);
  ~GSelector();

  void Clear();

  Int_t Select();

#include "GSelector.h7"
  ClassDefNV(GSelector, 0);
}; // endclass GSelector

#endif
 GSelector.h:1
 GSelector.h:2
 GSelector.h:3
 GSelector.h:4
 GSelector.h:5
 GSelector.h:6
 GSelector.h:7
 GSelector.h:8
 GSelector.h:9
 GSelector.h:10
 GSelector.h:11
 GSelector.h:12
 GSelector.h:13
 GSelector.h:14
 GSelector.h:15
 GSelector.h:16
 GSelector.h:17
 GSelector.h:18
 GSelector.h:19
 GSelector.h:20
 GSelector.h:21
 GSelector.h:22
 GSelector.h:23
 GSelector.h:24
 GSelector.h:25
 GSelector.h:26
 GSelector.h:27
 GSelector.h:28
 GSelector.h:29
 GSelector.h:30
 GSelector.h:31
 GSelector.h:32
 GSelector.h:33
 GSelector.h:34
 GSelector.h:35
 GSelector.h:36
 GSelector.h:37
 GSelector.h:38
 GSelector.h:39
 GSelector.h:40
 GSelector.h:41
 GSelector.h:42
 GSelector.h:43
 GSelector.h:44
 GSelector.h:45
 GSelector.h:46
 GSelector.h:47
 GSelector.h:48
 GSelector.h:49
 GSelector.h:50
 GSelector.h:51
 GSelector.h:52
 GSelector.h:53