The Pedigree Project 0.1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
PollEvent Class Reference

#include <PollEvent.h>

+ Inheritance diagram for PollEvent:
+ Collaboration diagram for PollEvent:

Public Member Functions

 PollEvent ()
 
 PollEvent (Semaphore *pSemaphore, struct pollfd *fd, int revent, File *pFile)
 
void fire ()
 
File * getFile ()
 
virtual size_t serialize (uint8_t *pBuffer)
 
virtual size_t getNumber ()
 
- Public Member Functions inherited from Event
 Event (uintptr_t handlerAddress, bool isDeletable, size_t specificNestingLevel=~0UL, HandlerPrivilege handlerPrivilege=HandlerPrivilege::Kernel)
 
virtual bool isDeletable ()
 
uintptr_t getHandlerAddress ()
 
HandlerPrivilege getHandlerPrivilege () const
 
bool isValidHandlerMapping (size_t mappingFlags) const
 
virtual bool isSignalEvent () const
 
virtual bool prefersAlternateUserStack () const
 
virtual bool requiresExactUserReturnState () const
 
virtual UserReturnDelivery deliverAtUserReturn (InterruptState &)
 
virtual UserReturnDelivery deliverAtUserReturn (SyscallState &)
 
virtual bool isDeliverableWhileProcessSuspended () const
 
virtual Event * cloneForDelivery ()
 
size_t getSpecificNestingLevel ()
 
 Event (const Event &other)
 
Event & operator= (const Event &other)
 
size_t pendingCount ()
 
bool tryAcquireRegistration (SendLease &registration)
 
virtual void waitForDeliveries ()
 
void retire ()
 
void beginRetirement (Retirement &retirement)
 

Static Public Member Functions

static bool unserialize (uint8_t *pBuffer, PollEvent &event)
 
- Static Public Member Functions inherited from Event
static uintptr_t getTrampoline ()
 
static uintptr_t getSecondaryTrampoline ()
 
static uintptr_t getHandlerBuffer ()
 
static size_t getHandlerBufferSize ()
 
static uintptr_t getLastHandlerBuffer ()
 
static bool unserialize (uint8_t *pBuffer, Event &event)
 
static size_t getEventType (uint8_t *pBuffer)
 

Private Attributes

Semaphore * m_pSemaphore
 
struct pollfd * m_pFd
 
int m_nREvent
 
File * m_pFile
 

Additional Inherited Members

- Public Types inherited from Event
enum class  HandlerPrivilege { Kernel , User }
 
enum class  UserReturnDelivery { NotApplicable , Delivered , Failed }
 
- Protected Attributes inherited from Event
uintptr_t m_HandlerAddress
 
HandlerPrivilege m_HandlerPrivilege
 
bool m_bIsDeletable
 
size_t m_NestingLevel
 
uint64_t m_Magic
 
List< Thread * > m_Threads
 
Spinlock m_Lock
 

Detailed Description

Event class for passing to File::monitor.

Definition at line 29 of file PollEvent.h.

Constructor & Destructor Documentation

◆ PollEvent() [1/2]

PollEvent::PollEvent ( )

The constructor takes a semaphore that it should signal when it fires, and an fd_set with an index to set.

Definition at line 27 of file PollEvent.cc.

◆ PollEvent() [2/2]

PollEvent::PollEvent ( Semaphore *  pSemaphore,
struct pollfd *  fd,
int  revent,
File *  pFile 
)

Definition at line 29 of file PollEvent.cc.

◆ ~PollEvent()

PollEvent::~PollEvent ( )
virtual

Definition at line 38 of file PollEvent.cc.

Member Function Documentation

◆ fire()

void PollEvent::fire ( )

Definition at line 40 of file PollEvent.cc.

◆ getFile()

File * PollEvent::getFile ( )
inline

Definition at line 39 of file PollEvent.h.

◆ getNumber()

virtual size_t PollEvent::getNumber ( )
inlinevirtual

Returns the event number / ID.

Implements Event.

Definition at line 48 of file PollEvent.h.

◆ serialize()

size_t PollEvent::serialize ( uint8_t *  pBuffer)
virtual

Given a buffer EVENT_LIMIT bytes long, take the variables present in this object and convert them to a binary form.

It can be assumed that this function will only be called when the Event is about to be dispatched, and so the inhibited mask of the current Thread is available to be changed to what the event handler requires. This change will be undone when the handler completes.

Parameters
pBufferThe buffer to serialize to.
Returns
The number of bytes serialized.

Implements Event.

Definition at line 46 of file PollEvent.cc.

◆ unserialize()

bool PollEvent::unserialize ( uint8_t *  pBuffer,
PollEvent &  event 
)
static

Definition at line 58 of file PollEvent.cc.

Member Data Documentation

◆ m_nREvent

int PollEvent::m_nREvent
private

Definition at line 55 of file PollEvent.h.

◆ m_pFd

struct pollfd* PollEvent::m_pFd
private

Definition at line 54 of file PollEvent.h.

◆ m_pFile

File* PollEvent::m_pFile
private

Definition at line 56 of file PollEvent.h.

◆ m_pSemaphore

Semaphore* PollEvent::m_pSemaphore
private

Definition at line 53 of file PollEvent.h.


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