EMANE  1.2.1
EMANE::FileDescriptorServiceProvider Class Referenceabstract

File Descriptor service interface allows for adding arbitrary file descriptors for read or write processing on the NEMQueuedLayer functor queue. More...

#include <filedescriptorserviceprovider.h>

Inheritance diagram for EMANE::FileDescriptorServiceProvider:
EMANE::NEMQueuedLayer EMANE::NOPFileDescriptorService EMANE::MACLayer EMANE::PHYLayer EMANE::ShimLayer EMANE::TransportLayer

Public Types

enum  DescriptorType { DescriptorType::READ, DescriptorType::WRITE }
 

Public Member Functions

virtual ~FileDescriptorServiceProvider ()
 
template<typename Function >
void addFileDescriptor (int iFd, DescriptorType type, Function fn)
 
virtual void removeFileDescriptor (int iFd)=0
 

Protected Types

using Callback = std::function< void(int iFd)>
 

Protected Member Functions

 FileDescriptorServiceProvider ()
 
virtual void addFileDescriptor_i (int iFd, DescriptorType type, Callback callback)=0
 

Detailed Description

File Descriptor service interface allows for adding arbitrary file descriptors for read or write processing on the NEMQueuedLayer functor queue.

Definition at line 48 of file filedescriptorserviceprovider.h.

Member Typedef Documentation

◆ Callback

using EMANE::FileDescriptorServiceProvider::Callback = std::function<void(int iFd)>
protected

Definition at line 83 of file filedescriptorserviceprovider.h.

Member Enumeration Documentation

◆ DescriptorType

Enumerator
READ 

Process when data is ready to read

WRITE 

Process when data is ready to write

Definition at line 53 of file filedescriptorserviceprovider.h.

Constructor & Destructor Documentation

◆ ~FileDescriptorServiceProvider()

virtual EMANE::FileDescriptorServiceProvider::~FileDescriptorServiceProvider ( )
inlinevirtual

Definition at line 51 of file filedescriptorserviceprovider.h.

◆ FileDescriptorServiceProvider()

EMANE::FileDescriptorServiceProvider::FileDescriptorServiceProvider ( )
inlineprotected

Definition at line 81 of file filedescriptorserviceprovider.h.

Member Function Documentation

◆ addFileDescriptor()

template<typename Function >
void EMANE::FileDescriptorServiceProvider::addFileDescriptor ( int  iFd,
DescriptorType  type,
Function  fn 
)

Adds a file descriptor for processing

Parameters
iFdFile descriptor
typeType of descriptor processing
fnA callable object

Definition at line 34 of file filedescriptorserviceprovider.inl.

◆ addFileDescriptor_i()

virtual void EMANE::FileDescriptorServiceProvider::addFileDescriptor_i ( int  iFd,
DescriptorType  type,
Callback  callback 
)
protectedpure virtual

◆ removeFileDescriptor()

virtual void EMANE::FileDescriptorServiceProvider::removeFileDescriptor ( int  iFd)
pure virtual

Removed a file descriptor from processing

Parameters
iFdFile descriptor

Implemented in EMANE::NOPFileDescriptorService.


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