StoreIOState Class Referenceabstract

#include <StoreIOState.h>

Inheritance diagram for StoreIOState:
Collaboration diagram for StoreIOState:

Public Types

enum  CloseHow {
  wroteAll ,
  writerGone ,
  readerDone
}
 
typedef RefCount< StoreIOStatePointer
 
typedef void STRCB(void *their_data, const char *buf, ssize_t len, StoreIOState::Pointer self)
 
typedef void STIOCB(void *their_data, int errflag, StoreIOState::Pointer self)
 

Public Member Functions

void * operator new (size_t amount)
 
void operator delete (void *address)
 
 StoreIOState (StoreIOState::STIOCB *, void *cbData)
 
 ~StoreIOState () override
 
off_t offset () const
 
virtual void read_ (char *buf, size_t size, off_t offset, STRCB *callback, void *callback_data)=0
 
virtual bool write (char const *buf, size_t size, off_t offset, FREE *free_func)=0
 
virtual void close (int how)=0
 finish or abort swapping per CloseHow More...
 
bool touchingStoreEntry () const
 

Public Attributes

sdirno swap_dirn
 
sfileno swap_filen
 
StoreEntrye
 
mode_t mode
 
off_t offset_
 number of bytes written or read for this entry so far More...
 
STIOCBcallback
 
void * callback_data
 
struct {
   STRCB *   callback
 
   void *   callback_data
 
read
 
struct {
   bool   closing
 
flags
 

Detailed Description

Definition at line 17 of file StoreIOState.h.

Member Typedef Documentation

◆ Pointer

Definition at line 21 of file StoreIOState.h.

◆ STIOCB

typedef void StoreIOState::STIOCB(void *their_data, int errflag, StoreIOState::Pointer self)

Definition at line 39 of file StoreIOState.h.

◆ STRCB

typedef void StoreIOState::STRCB(void *their_data, const char *buf, ssize_t len, StoreIOState::Pointer self)

Definition at line 29 of file StoreIOState.h.

Member Enumeration Documentation

◆ CloseHow

Enumerator
wroteAll 

success: caller supplied all data it wanted to swap out

writerGone 

failure: caller left before swapping out everything

readerDone 

success or failure: either way, stop swapping in

Definition at line 57 of file StoreIOState.h.

Constructor & Destructor Documentation

◆ StoreIOState()

StoreIOState::StoreIOState ( StoreIOState::STIOCB cbIo,
void *  cbData 
)

Definition at line 30 of file StoreIOState.cc.

References flags, and read.

◆ ~StoreIOState()

StoreIOState::~StoreIOState ( )
override

Definition at line 44 of file StoreIOState.cc.

References callback_data, cbdataReferenceDone, debugs, and read.

Member Function Documentation

◆ close()

virtual void StoreIOState::close ( int  how)
pure virtual

Implemented in Rock::IoState, and Fs::Ufs::UFSStoreState.

Referenced by storeClose().

◆ offset()

off_t StoreIOState::offset ( ) const
inline

◆ operator delete()

void StoreIOState::operator delete ( void *  address)

Definition at line 25 of file StoreIOState.cc.

References assert.

◆ operator new()

void * StoreIOState::operator new ( size_t  amount)

Definition at line 18 of file StoreIOState.cc.

References assert.

◆ read_()

virtual void StoreIOState::read_ ( char *  buf,
size_t  size,
off_t  offset,
STRCB callback,
void *  callback_data 
)
pure virtual

Implemented in Rock::IoState, and Fs::Ufs::UFSStoreState.

Referenced by storeRead().

◆ touchingStoreEntry()

bool StoreIOState::touchingStoreEntry ( ) const

Definition at line 55 of file StoreIOState.cc.

References e, StoreEntry::swap_filen, and swap_filen.

Referenced by Rock::SwapDir::writeCompleted(), and Rock::SwapDir::writeError().

◆ write()

virtual bool StoreIOState::write ( char const *  buf,
size_t  size,
off_t  offset,
FREE free_func 
)
pure virtual

write the given buffer and free it when it is no longer needed

Parameters
offsetzero for the very first write and -1 for all other writes
Return values
falseif write failed (callback has been or will be called)

Implemented in Rock::IoState, and Fs::Ufs::UFSStoreState.

Referenced by doPages(), and storeIOWrite().

Member Data Documentation

◆ callback [1/2]

STIOCB* StoreIOState::callback

Definition at line 76 of file StoreIOState.h.

◆ callback [2/2]

STRCB* StoreIOState::callback

Definition at line 80 of file StoreIOState.h.

◆ callback_data

void* StoreIOState::callback_data

Definition at line 77 of file StoreIOState.h.

Referenced by ~StoreIOState().

◆ closing

bool StoreIOState::closing

Definition at line 85 of file StoreIOState.h.

Referenced by storeClose().

◆ e

◆ 

struct { ... } StoreIOState::flags

Referenced by StoreIOState(), and storeClose().

◆ mode

◆ offset_

off_t StoreIOState::offset_

Definition at line 75 of file StoreIOState.h.

Referenced by offset().

◆ 

struct { ... } StoreIOState::read

Referenced by StoreIOState(), and ~StoreIOState().

◆ swap_dirn

◆ swap_filen


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors