XRootD
Loading...
Searching...
No Matches
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.
void RemoveHandler (ChannelEventHandler *handler)
 Remove the channel event handler.
void ReportEvent (ChannelEventHandler::ChannelEvent event, Status status)
 Report an event to the channel event handlers.

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 }

◆ 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 }

◆ 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 }

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