Poll::Provider Class Referenceabstract

Poll provider interface. More...

#include <PollInterface.h>

Inheritance diagram for Poll::Provider:
Poll::Poll_select

Public Member Functions

virtual ~Provider ()
 Virtual destructor.
 
virtual int Register (User *user)=0
 Register an endpoint.
 
virtual void Deregister (User *user)=0
 Deregister endpoint.
 
virtual void Control (User *user)=0
 Set the events which are interesting for end point.
 
virtual void Deliver (pollAction *msg)=0
 Interface to itself, via Event Manager.
 

Static Public Member Functions

static ProviderGetPollService ()
 Implement as a singleton.
 
static int ProviderFactory (const char *type, MSGstruct *msg)
 Factory method.for stream provider.
 

Detailed Description

Poll provider interface.

Interfaces to both Poll users and itself - via the event service. As it is likely that the implementation will need to be such that messages from Users will need to interrupt the actual poller, the interface is procedural, and any synchronization is done within the implementation.

Definition at line 130 of file PollInterface.h.

Constructor & Destructor Documentation

◆ ~Provider()

virtual Poll::Provider::~Provider ( )
inlinevirtual

Virtual destructor.

Definition at line 141 of file PollInterface.h.

141{}

Member Function Documentation

◆ GetPollService()

static Provider * Poll::Provider::GetPollService ( )
inlinestatic

Implement as a singleton.

Definition at line 136 of file PollInterface.h.

136 {
137 return instance;
138 }

Referenced by Datagram::Provider::ProviderFactory(), and Stream::Provider::ProviderFactory().

◆ Register()

virtual int Poll::Provider::Register ( User user)
pure virtual

Register an endpoint.

Returns
zero on success, -1 if already registered or other system errno value

Implemented in Poll::Poll_select.

◆ Deregister()

virtual void Poll::Provider::Deregister ( User user)
pure virtual

Deregister endpoint.

Implemented in Poll::Poll_select.

Referenced by Datagram::DgramPoll::tidy(), and Stream::SocketPoll::tidy().

◆ Control()

virtual void Poll::Provider::Control ( User user)
pure virtual

Set the events which are interesting for end point.

Implemented in Poll::Poll_select.

◆ Deliver()

virtual void Poll::Provider::Deliver ( pollAction msg)
pure virtual

Interface to itself, via Event Manager.

Implemented in Poll::Poll_select.

◆ ProviderFactory()

int Poll::Provider::ProviderFactory ( const char *  type,
MSGstruct *  msg 
)
static

Factory method.for stream provider.

Parameters
typeName of type of provider, or NULL give default
msgStructure which receives any failure message
Returns
Zero on success, or error code

Definition at line 112 of file EventSvc.C.

113 {
114 MutexLock mlock (&poller_mutex);
115
116 if ( instance != 0 ) {
117 MSG_IOevent_PollProviderCreated_LOG ();
118 return 0;
119 }
120
121 if ( type == 0 || strcmp (type, "epoll") == 0 ) {
122 instance = CreatePollepollProvider ();
123 if ( instance != 0 )
124 return 0;
125 }
126
127 if ( type == 0 || strcmp (type, "port") == 0 ) {
128 instance = CreatePollportProvider ();
129 if ( instance != 0 )
130 return 0;
131 }
132
133 if ( type == 0 || strcmp (type, "poll") == 0 ) {
134 instance = CreatePollpollProvider ();
135 if ( instance != 0 )
136 return 0;
137 }
138
139 if ( type == 0 || strcmp (type, "select") == 0 ) {
140 instance = CreatePollselectProvider ();
141 if ( instance != 0 )
142 return 0;
143 }
144
145 MSG_IOevent_PollProvidertype_SET (msp, type);
146 return MSG_IOevent_PollProvidertype;
147 }

Referenced by Datagram::Provider::ProviderFactory(), and Stream::Provider::ProviderFactory().


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

All rights reserved © 2002 - 2024 Isode Ltd.