EMANE  1.2.1
EMANE::NOPFileDescriptorService Class Reference

#include <nopfiledescriptorservice.h>

Inheritance diagram for EMANE::NOPFileDescriptorService:
EMANE::FileDescriptorServiceProvider EMANE::Utils::Singleton< NOPFileDescriptorService >

Public Types

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

Public Member Functions

 ~NOPFileDescriptorService ()
 
void removeFileDescriptor (int iFd) override
 
template<typename Function >
void addFileDescriptor (int iFd, DescriptorType type, Function fn)
 

Static Public Member Functions

static NOPFileDescriptorServiceinstance ()
 
static void destroy ()
 

Protected Types

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

Protected Member Functions

void addFileDescriptor_i (int iFd, DescriptorType type, Callback callback) override
 

Detailed Description

Definition at line 42 of file nopfiledescriptorservice.h.

Member Typedef Documentation

◆ Callback

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

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

◆ ~NOPFileDescriptorService()

EMANE::NOPFileDescriptorService::~NOPFileDescriptorService ( )

Definition at line 37 of file nopfiledescriptorservice.cc.

Member Function Documentation

◆ addFileDescriptor()

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

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()

void EMANE::NOPFileDescriptorService::addFileDescriptor_i ( int  iFd,
DescriptorType  type,
Callback  callback 
)
overrideprotectedvirtual

Implements EMANE::FileDescriptorServiceProvider.

Definition at line 46 of file nopfiledescriptorservice.cc.

◆ destroy()

static void EMANE::Utils::Singleton< NOPFileDescriptorService >::destroy ( )
inlinestaticinherited

Destroys the single instance of type T. Once destroyed it cannot be used or recreated. This is not a thread-safe method.

Definition at line 67 of file singleton.h.

◆ instance()

static NOPFileDescriptorService * EMANE::Utils::Singleton< NOPFileDescriptorService >::instance ( )
inlinestaticinherited

Provides thread-safe access to a single instance of type T. It does not provide thread-safety for T methods.

Returns
A pointer to T

Definition at line 56 of file singleton.h.

◆ removeFileDescriptor()

void EMANE::NOPFileDescriptorService::removeFileDescriptor ( int  iFd)
overridevirtual

Removed a file descriptor from processing

Parameters
iFdFile descriptor

Implements EMANE::FileDescriptorServiceProvider.

Definition at line 39 of file nopfiledescriptorservice.cc.


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