XrdCl::PollerBuiltIn Class Reference

A poller implementation using the build-in XRootD poller. More...

#include <XrdClPollerBuiltIn.hh>

Inheritance diagram for XrdCl::PollerBuiltIn:
Inheritance graph
[legend]
Collaboration diagram for XrdCl::PollerBuiltIn:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PollerBuiltIn ()
 Constructor.
 ~PollerBuiltIn ()
virtual bool Initialize ()
 Initialize the poller.
virtual bool Finalize ()
 Finalize the poller.
virtual bool Start ()
 Start polling.
virtual bool Stop ()
 Stop polling.
virtual bool AddSocket (Socket *socket, SocketHandler *handler)
virtual bool RemoveSocket (Socket *socket)
 Remove the socket.
virtual bool EnableReadNotification (Socket *socket, bool notify, uint16_t timeout=60)
virtual bool EnableWriteNotification (Socket *socket, bool notify, uint16_t timeout=60)
virtual bool IsRegistered (Socket *socket)
 Check whether the socket is registered with the poller.
virtual bool IsRunning () const
 Is the event loop running?

Private Types

typedef std::map< const
AnyObject *, std::pair
< XrdSys::IOEvents::Poller
*, size_t > > 
PollerMap
typedef std::map< Socket
*, void * > 
SocketMap
typedef std::vector
< XrdSys::IOEvents::Poller * > 
PollerPool

Private Member Functions

XrdSys::IOEvents::PollerGetNextPoller ()
 Goes over poller threads in round robin fashion.
XrdSys::IOEvents::PollerRegisterAndGetPoller (const Socket *socket)
 Registers given socket as a poller user and returns the poller object.
void UnregisterFromPoller (const Socket *socket)
 Unregisters given socket from poller object.
XrdSys::IOEvents::PollerGetPoller (const Socket *socket)
 Returns the poller object associated with the given socket.

Static Private Member Functions

static int GetNbPollerInit ()
 Gets the initial value for 'pNbPoller'.

Private Attributes

SocketMap pSocketMap
PollerMap pPollerMap
PollerPool pPollerPool
PollerPool::iterator pNext
const int pNbPoller
XrdSysMutex pMutex

Detailed Description

A poller implementation using the build-in XRootD poller.


Member Typedef Documentation

typedef std::map<const AnyObject *, std::pair<XrdSys::IOEvents::Poller *, size_t> > XrdCl::PollerBuiltIn::PollerMap [private]
typedef std::map<Socket *, void *> XrdCl::PollerBuiltIn::SocketMap [private]

Constructor & Destructor Documentation

XrdCl::PollerBuiltIn::PollerBuiltIn (  )  [inline]

Constructor.

XrdCl::PollerBuiltIn::~PollerBuiltIn (  )  [inline]

Member Function Documentation

virtual bool XrdCl::PollerBuiltIn::AddSocket ( Socket socket,
SocketHandler handler 
) [virtual]

Add socket to the polling loop

Parameters:
socket the socket
handler object handling the events

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::EnableReadNotification ( Socket socket,
bool  notify,
uint16_t  timeout = 60 
) [virtual]

Notify the handler about read events

Parameters:
socket the socket
notify specify if the handler should be notified
timeout if no read event occurred after this time a timeout event will be generated

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::EnableWriteNotification ( Socket socket,
bool  notify,
uint16_t  timeout = 60 
) [virtual]

Notify the handler about write events

Parameters:
socket the socket
notify specify if the handler should be notified
timeout if no write event occurred after this time a timeout event will be generated

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::Finalize (  )  [virtual]

Finalize the poller.

Implements XrdCl::Poller.

static int XrdCl::PollerBuiltIn::GetNbPollerInit (  )  [static, private]

Gets the initial value for 'pNbPoller'.

XrdSys::IOEvents::Poller* XrdCl::PollerBuiltIn::GetNextPoller (  )  [private]

Goes over poller threads in round robin fashion.

XrdSys::IOEvents::Poller* XrdCl::PollerBuiltIn::GetPoller ( const Socket socket  )  [private]

Returns the poller object associated with the given socket.

virtual bool XrdCl::PollerBuiltIn::Initialize (  )  [virtual]

Initialize the poller.

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::IsRegistered ( Socket socket  )  [virtual]

Check whether the socket is registered with the poller.

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::IsRunning (  )  const [inline, virtual]

Is the event loop running?

Implements XrdCl::Poller.

References pPollerPool.

XrdSys::IOEvents::Poller* XrdCl::PollerBuiltIn::RegisterAndGetPoller ( const Socket socket  )  [private]

Registers given socket as a poller user and returns the poller object.

virtual bool XrdCl::PollerBuiltIn::RemoveSocket ( Socket socket  )  [virtual]

Remove the socket.

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::Start (  )  [virtual]

Start polling.

Implements XrdCl::Poller.

virtual bool XrdCl::PollerBuiltIn::Stop (  )  [virtual]

Stop polling.

Implements XrdCl::Poller.

void XrdCl::PollerBuiltIn::UnregisterFromPoller ( const Socket socket  )  [private]

Unregisters given socket from poller object.


Member Data Documentation

const int XrdCl::PollerBuiltIn::pNbPoller [private]
PollerPool::iterator XrdCl::PollerBuiltIn::pNext [private]

Referenced by IsRunning().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Apr 2019 for xrootd by  doxygen 1.6.1