XRootD
XrdCl::ChannelHandlerList Class Reference

A helper for handling channel event handlers. More...

#include <XrdClChannelHandlerList.hh>

+ Collaboration diagram for XrdCl::ChannelHandlerList:

Public Member Functions

void AddHandler (ChannelEventHandler *handler)
 Add a channel event handler. More...
 
void RemoveHandler (ChannelEventHandler *handler)
 Remove the channel event handler. More...
 
void ReportEvent (ChannelEventHandler::ChannelEvent event, Status status)
 Report an event to the channel event handlers. More...
 

Detailed Description

A helper for handling channel event handlers.

Definition at line 33 of file XrdClChannelHandlerList.hh.

Member Function Documentation

◆ AddHandler()

void XrdCl::ChannelHandlerList::AddHandler ( ChannelEventHandler handler)

Add a channel event handler.

Definition at line 27 of file XrdClChannelHandlerList.cc.

28  {
29  XrdSysMutexHelper scopedLock( pMutex );
30  pHandlers.push_back( handler );
31  }

Referenced by XrdCl::Stream::RegisterEventHandler().

+ Here is the caller graph for this function:

◆ RemoveHandler()

void XrdCl::ChannelHandlerList::RemoveHandler ( ChannelEventHandler handler)

Remove the channel event handler.

Definition at line 36 of file XrdClChannelHandlerList.cc.

37  {
38  XrdSysMutexHelper scopedLock( pMutex );
39  std::list<ChannelEventHandler*>::iterator it;
40  for( it = pHandlers.begin(); it != pHandlers.end(); ++it )
41  {
42  if( *it == handler )
43  {
44  pHandlers.erase( it );
45  return;
46  }
47  }
48  }

Referenced by XrdCl::Stream::RemoveEventHandler().

+ Here is the caller graph for this function:

◆ ReportEvent()

void XrdCl::ChannelHandlerList::ReportEvent ( ChannelEventHandler::ChannelEvent  event,
Status  status 
)

Report an event to the channel event handlers.

Definition at line 53 of file XrdClChannelHandlerList.cc.

56  {
57  XrdSysMutexHelper scopedLock( pMutex );
58  std::list<ChannelEventHandler*>::iterator it;
59  for( it = pHandlers.begin(); it != pHandlers.end(); )
60  {
61  bool st = (*it)->OnChannelEvent( event, status );
62  if( !st )
63  it = pHandlers.erase( it );
64  else
65  ++it;
66  }
67  }

Referenced by XrdCl::Stream::ForceError(), and XrdCl::Stream::OnError().

+ Here is the caller graph for this function:

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