This is Unofficial EPICS BASE Doxygen Site
fdRegId Class Reference

#include "fdManager.h"

+ Inheritance diagram for fdRegId:

Public Member Functions

 fdRegId (const SOCKET fdIn, const fdRegType typeIn)
 
SOCKET getFD () const
 
fdRegType getType () const
 
bool operator== (const fdRegId &idIn) const
 
resTableIndex hash () const
 
virtual void show (unsigned level) const
 
virtual ~fdRegId ()
 

Detailed Description

Definition at line 36 of file fdManager.h.

Constructor & Destructor Documentation

fdRegId::fdRegId ( const SOCKET  fdIn,
const fdRegType  typeIn 
)
inline

Definition at line 40 of file fdManager.h.

40  :
41  fd(fdIn), type(typeIn) {}
pvd::StructureConstPtr type
virtual fdRegId::~fdRegId ( )
inlinevirtual

Definition at line 62 of file fdManager.h.

62 {}

Member Function Documentation

SOCKET fdRegId::getFD ( ) const
inline

Definition at line 43 of file fdManager.h.

44  {
45  return this->fd;
46  }
fdRegType fdRegId::getType ( ) const
inline

Definition at line 48 of file fdManager.h.

49  {
50  return this->type;
51  }
pvd::StructureConstPtr type
resTableIndex fdRegId::hash ( ) const
inline

Definition at line 169 of file fdManager.h.

170 {
171  const unsigned fdManagerHashTableMinIndexBits = 8;
172  const unsigned fdManagerHashTableMaxIndexBits = sizeof(SOCKET)*CHAR_BIT;
173  resTableIndex hashid;
174 
175  hashid = integerHash ( fdManagerHashTableMinIndexBits,
176  fdManagerHashTableMaxIndexBits, this->fd );
177 
178  //
179  // also evenly distribute based on the type of fdRegType
180  //
181  hashid ^= this->type;
182 
183  //
184  // the result here is always masked to the
185  // proper size after it is returned to the resource class
186  //
187  return hashid;
188 }
pvd::StructureConstPtr type
int SOCKET
Definition: osdSock.h:31
size_t resTableIndex
Definition: resourceLib.h:45
resTableIndex integerHash(unsigned MIN_INDEX_WIDTH, unsigned MAX_ID_WIDTH, const T &id)
Definition: resourceLib.h:1032
bool fdRegId::operator== ( const fdRegId idIn) const
inline

Definition at line 53 of file fdManager.h.

54  {
55  return this->fd == idIn.fd && this->type==idIn.type;
56  }
pvd::StructureConstPtr type
void fdRegId::show ( unsigned  level) const
virtual

Reimplemented in fdReg.

Definition at line 245 of file fdManager.cpp.

246 {
247  printf ( "fdRegId at %p\n",
248  static_cast <const void *> ( this ) );
249  if ( level > 1u ) {
250  printf ( "\tfd = %d, type = %d\n",
251  int(this->fd), this->type );
252  }
253 }
#define printf
Definition: epicsStdio.h:41
pvd::StructureConstPtr type

The documentation for this class was generated from the following files: