The Pedigree Project 0.1
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
FanotifyQueue Class Referencefinal

#include <fanotify-queue.h>

+ Inheritance diagram for FanotifyQueue:
+ Collaboration diagram for FanotifyQueue:

Public Types

enum class  Take {
  Ready , Empty , Closed , TooSmall ,
  Interrupted
}
 

Public Member Functions

bool valid () const
 
void enqueue (const FanotifyRecord &)
 
Take take (FanotifyRecord &, size_t capacity, bool canBlock)
 
void close ()
 
ReadyMask queryReady ()
 
ReadinessGenerations readinessGenerations () override
 
int queuedMetadataBytes ()
 
- Public Member Functions inherited from ReadinessSource
MUST_USE_RESULT bool subscribeReadiness (ReadyMask interest, const SharedPointer< ReadinessObserver > &observer, ReadinessSubscription &subscription)
 

Static Public Attributes

static constexpr size_t MaximumEvents = 256
 
static constexpr size_t MaximumRecordSize = 24 + 12 + 8 + 128
 

Private Attributes

Mutex m_Lock
 
ConditionVariable m_Readers
 
UniqueArray< FanotifyRecordm_Records
 
size_t m_Head = 0
 
size_t m_Count = 0
 
bool m_OverflowQueued = false
 
bool m_Closed = false
 
ReadinessGenerations m_Generations
 

Additional Inherited Members

- Protected Member Functions inherited from ReadinessSource
void notifyReadiness (ReadyMask mask)
 
void closeReadiness (ReadyMask mask=ReadyInvalid|ReadyHangup)
 

Detailed Description

Preallocated event storage owns identity snapshots, without live File references.

Definition at line 25 of file fanotify-queue.h.

Member Enumeration Documentation

◆ Take

enum class FanotifyQueue::Take
strong

Definition at line 29 of file fanotify-queue.h.

Constructor & Destructor Documentation

◆ FanotifyQueue()

FanotifyQueue::FanotifyQueue ( )

Definition at line 59 of file fanotify-queue.cc.

◆ ~FanotifyQueue()

FanotifyQueue::~FanotifyQueue ( )
override

Definition at line 61 of file fanotify-queue.cc.

Member Function Documentation

◆ close()

void FanotifyQueue::close ( )

Definition at line 135 of file fanotify-queue.cc.

◆ enqueue()

void FanotifyQueue::enqueue ( const FanotifyRecord record)

Definition at line 68 of file fanotify-queue.cc.

◆ queryReady()

ReadyMask FanotifyQueue::queryReady ( )

Definition at line 148 of file fanotify-queue.cc.

◆ queuedMetadataBytes()

int FanotifyQueue::queuedMetadataBytes ( )

Definition at line 156 of file fanotify-queue.cc.

◆ readinessGenerations()

ReadinessGenerations FanotifyQueue::readinessGenerations ( )
overridevirtual

Return source-serialized rising-edge sequences where available.

A source increments the corresponding sequence while holding the same lock which changes its readiness predicate. Consumers can then recover a drain/refill transition even if the two callback deliveries are reordered.

Reimplemented from ReadinessSource.

Definition at line 152 of file fanotify-queue.cc.

◆ take()

FanotifyQueue::Take FanotifyQueue::take ( FanotifyRecord record,
size_t  capacity,
bool  canBlock 
)

Definition at line 101 of file fanotify-queue.cc.

◆ valid()

bool FanotifyQueue::valid ( ) const

Definition at line 64 of file fanotify-queue.cc.

Member Data Documentation

◆ m_Closed

bool FanotifyQueue::m_Closed = false
private

Definition at line 48 of file fanotify-queue.h.

◆ m_Count

size_t FanotifyQueue::m_Count = 0
private

Definition at line 46 of file fanotify-queue.h.

◆ m_Generations

ReadinessGenerations FanotifyQueue::m_Generations
private

Definition at line 49 of file fanotify-queue.h.

◆ m_Head

size_t FanotifyQueue::m_Head = 0
private

Definition at line 45 of file fanotify-queue.h.

◆ m_Lock

Mutex FanotifyQueue::m_Lock
private

Definition at line 42 of file fanotify-queue.h.

◆ m_OverflowQueued

bool FanotifyQueue::m_OverflowQueued = false
private

Definition at line 47 of file fanotify-queue.h.

◆ m_Readers

ConditionVariable FanotifyQueue::m_Readers
private

Definition at line 43 of file fanotify-queue.h.

◆ m_Records

UniqueArray<FanotifyRecord> FanotifyQueue::m_Records
private

Definition at line 44 of file fanotify-queue.h.

◆ MaximumEvents

constexpr size_t FanotifyQueue::MaximumEvents = 256
staticconstexpr

Definition at line 27 of file fanotify-queue.h.

◆ MaximumRecordSize

constexpr size_t FanotifyQueue::MaximumRecordSize = 24 + 12 + 8 + 128
staticconstexpr

Definition at line 28 of file fanotify-queue.h.


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