Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
TSocketMultiplexerMethodJob< T > Class Template Reference

Use a method as a socket multiplexer job. More...

#include <TSocketMultiplexerMethodJob.h>

Inheritance diagram for TSocketMultiplexerMethodJob< T >:
Collaboration diagram for TSocketMultiplexerMethodJob< T >:

Public Types

using Method = ISocketMultiplexerJob *(T::*)(ISocketMultiplexerJob *, bool, bool, bool)

Public Member Functions

 TSocketMultiplexerMethodJob (T *object, Method method, ArchSocket socket, bool readable, bool writeable)
 run() invokes object->method(arg)
 TSocketMultiplexerMethodJob (TSocketMultiplexerMethodJob const &)=delete
 TSocketMultiplexerMethodJob (TSocketMultiplexerMethodJob &&)=delete
 ~TSocketMultiplexerMethodJob () override
TSocketMultiplexerMethodJoboperator= (TSocketMultiplexerMethodJob const &)=delete
TSocketMultiplexerMethodJoboperator= (TSocketMultiplexerMethodJob &&)=delete
ISocketMultiplexerJobrun (bool readable, bool writable, bool error) override
 Handle socket event.
ArchSocket getSocket () const override
 Get the socket.
bool isReadable () const override
 Check for interest in readability.
bool isWritable () const override
 Check for interest in writability.
Public Member Functions inherited from ISocketMultiplexerJob
Public Member Functions inherited from IInterface
virtual ~IInterface ()=default
 Interface destructor does nothing.

Detailed Description

template<class T>
class TSocketMultiplexerMethodJob< T >

Use a method as a socket multiplexer job.

A socket multiplexer job class that invokes a member function.

Member Typedef Documentation

◆ Method

template<class T>
using TSocketMultiplexerMethodJob< T >::Method = ISocketMultiplexerJob *(T::*)(ISocketMultiplexerJob *, bool, bool, bool)

Constructor & Destructor Documentation

◆ TSocketMultiplexerMethodJob() [1/3]

template<class T>
TSocketMultiplexerMethodJob< T >::TSocketMultiplexerMethodJob ( T * object,
Method method,
ArchSocket socket,
bool readable,
bool writeable )
inline

run() invokes object->method(arg)

◆ TSocketMultiplexerMethodJob() [2/3]

◆ TSocketMultiplexerMethodJob() [3/3]

◆ ~TSocketMultiplexerMethodJob()

template<class T>
TSocketMultiplexerMethodJob< T >::~TSocketMultiplexerMethodJob ( )
inlineoverride

Member Function Documentation

◆ getSocket()

template<class T>
ArchSocket TSocketMultiplexerMethodJob< T >::getSocket ( ) const
inlineoverridevirtual

Get the socket.

Return the socket to multiplex

Implements ISocketMultiplexerJob.

◆ isReadable()

template<class T>
bool TSocketMultiplexerMethodJob< T >::isReadable ( ) const
inlineoverridevirtual

Check for interest in readability.

Return true if the job is interested in being run if the socket becomes readable.

Implements ISocketMultiplexerJob.

◆ isWritable()

template<class T>
bool TSocketMultiplexerMethodJob< T >::isWritable ( ) const
inlineoverridevirtual

Check for interest in writability.

Return true if the job is interested in being run if the socket becomes writable.

Implements ISocketMultiplexerJob.

◆ operator=() [1/2]

template<class T>
TSocketMultiplexerMethodJob & TSocketMultiplexerMethodJob< T >::operator= ( TSocketMultiplexerMethodJob< T > && )
delete

◆ operator=() [2/2]

template<class T>
TSocketMultiplexerMethodJob & TSocketMultiplexerMethodJob< T >::operator= ( TSocketMultiplexerMethodJob< T > const & )
delete

◆ run()

template<class T>
ISocketMultiplexerJob * TSocketMultiplexerMethodJob< T >::run ( bool readable,
bool writable,
bool error )
inlineoverridevirtual

Handle socket event.

Called by a socket multiplexer when the socket becomes readable, writable, or has an error. It should return itself if the same job can continue to service events, a new job if the socket must be serviced differently, or nullptr if the socket should no longer be serviced. The socket is readable if readable is true, writable if writable is true, and in error if error is true.

This call must not attempt to directly change the job for this socket by calling addSocket() or removeSocket() on the multiplexer. It must instead return the new job. It can, however, add or remove jobs for other sockets.

Implements ISocketMultiplexerJob.


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