JetByteTools::IO Namespace Reference


Classes

class  CAsyncFileLog
 A class that implements JetByteTools::ILogMessages to provide an asynchronous file log that uses overlapped I/O to perform writes to the log file. More...
class  CAsyncFileReader
 A class that implements IHandler to provide an asynchronous file reader that uses overlapped I/O to perform reads from the file. Data read from the file is provided in a 'push fashion' via the CAsyncFileReader::Callback interface. More...
class  CAsyncFileWriter
 A class that implements IHandler to provide an asynchronous file writer that uses overlapped I/O to perform writes to the file. Any errors that occur during the asynchronous file writes are reported via the CAsyncFileWriter::Callback interface. More...
class  CBuffer
 An implementation of the IBuffer interface which includes its own custom new and delete functionality so that the memory for the buffer and the memory for the rest of the class are allocated as a single block of memory. Note that the 'user data' is also allocated as part of the main buffer memory and the class knows how to access the various memory areas correctly. More...
class  CBufferAllocator
 An implementation of IAllocateBuffers which pools buffer instances for later reuse. More...
class  CBufferHandle
 An implementation of IBuffer that provides a separate WSABUF for another implementation of IBuffer. This is used to broadcast the contents of an IBuffer to multiple receivers without needing to copy the data in the buffer. Each receiver has a CBufferHandle allocated which is attached to the IBuffer that contains the data that needs to be broadcast. When the final send completes the references held by the CBufferHandle objects on the IBuffer will fall to 0 and the buffer will be released. More...
class  CFileInputStream
 An object that implements IInputStream on a file. More...
class  CFileOutputStream
 An object that implements ICloseableOutputStream on a file. More...
class  IAllocateBuffers
 An interface to a class that allocates instances of IBuffer of a fixed size. Each instance of IBuffer has opaque user data associated with it and so this allocator derives from IProvideUserData to allow the user to request user data "slots" from the allocator; you must request all of your slots before calling Allocate() for the first time. More...
class  IAsyncIOStream
 An interface onto an asynchrnonous I/O stream. Calls to Write() are not guarenteed to have completed when the call returns and calls to Read() simply request that a Read() happens and do not, in any way, result in incoming data being placed in the provided buffer before the call returns. Objects that implement this interface must provide another way to provide the caller with the data that is read from the stream when the read actually completes. More...
class  IBuffer
 An interface to a buffer used for socket I/O (this, probably should be refactored and split into two interfaces, one derived from the other and one of them should live in the Socket Tools library). More...
class  IBufferBase
 An interface to a I/O buffer (with a partially refactored name!). Initially IBuffer and IBufferBase was one class, it was split to make it easier to mock and in an attemp to remove some of the socket stuff. Classes that implement this interface represent a byte buffer that can be used for overlapped I/O and that consist of a contiguous array of bytes and an insertion point which moves along the buffer as data is added to it. More work needs to be done. More...
class  ICloseableOutputStream
 An extension to IOutputStream that allows the user to call Close() on it. More...
class  IHandler
 An interface that represents code that handles operations on I/O buffers. More...
class  IInputStream
 An interface to an input stream (which may be sync or async). More...
class  IIOPool
 An interface to an I/O thread pool (usually based on an I/O completion port) that can have operations on buffers and handlers dispatched to it (either directly or as a result of an I/O completion packet being generated by some asynchronous I/O event) and that handles these events on one of the threads in the pool. More...
class  IManageBufferLifeCycle
 A helper interface to remove a friend relationship between buffers and their allocators... More...
class  IMonitorBufferAllocation
 An interface to allow a class to monitor the operation of a class that allocates buffers. The interface assumes that buffers go through the following life-cycle: created, allocated, released, destroyed. Allocators that pool buffers can allow a buffer to be created once and then allocated and released several times before being deleted. Incrementing a counter when OnBufferCreated() is called and decrementing it when OnBufferDestroyed() is called will give you a count of the number of buffers that are in existence at any one time. A corresponding counter that is incremented in OnBufferAllocated() and decremented when OnBufferReleased() is called will give a count of the buffers that are currently in use. More...
class  IMonitorIOPool
 An interface to allow a class to monitor an instance of an I/O pool. The interface assumes that threads in the pool go through the following life-cycle: created, begin processing, end processing, destroyed, and that they may optionally (hopefully not) generate errors. Obviously a thread is likely to begin and end processing several work items before it is destroyed. The methods on this interface can be called either from any thread and may not be called from the I/O thread itself. Incrementing a counter when OnIOPoolThreadCreated() is called and decrementing it when OnIOPoolThreadDestroyed() is called will give you a count of the number of threads that are in existence at any one time. A corresponding counter that is incremented in OnIOPoolThreadBeginProcessing() and decremented in OnIOPoolThreadEndProcessing() is called will give a count of the threads that are currently in use. More...
class  CInOrderBufferList
 A class that manages a collection of IBuffer instances which have a unique and ascending sequence number in them. You are allowed to push buffers into the collection in any order and to retrieve them only in the correct sequence. If you try and retrieve a buffer when the required buffer is not present then the collection will return null. Typical usage is to ensure the correct ordering of multiple overlapped read completions. All buffers are pushed into the collection using GetNext() and a buffer is only returned to the caller for processing if it is the next in sequence. This class takes a reference on a buffer when it is added to the collection and requires that the user of a buffer that has been removed from the collection releases that reference when done. More...
class  CIOPool
 An I/O thread pool implementing IIOPool. More...
class  IOutputStream
 An interface to an output stream (which may be sync or async). More...
class  IProvideWorkItems
 A restricted interface onto a queue of work items (such as an I/O completion port, perhaps). More...
class  IStream
 An interface to an stream... More...
class  CLockFreeBuffer
 An implementation of the IBuffer interface which includes its own custom new and delete functionality so that the memory for the buffer and the memory for the rest of the class are allocated as a single block of memory. Note that the 'user data' is also allocated as part of the main buffer memory and the class knows how to access the various memory areas correctly. This class differs from CBuffer only in that it uses the CSList to string the buffers together in the allocator rather than the CNodeList. This makes the allocator lock free; which may have some positive performance implications in some circumstances (but we've yet to find them or even look that hard for them). Ideally the shared code between this and CBuffer could be removed. More...
class  CLockFreeBufferAllocator
 An implementation of IAllocateBuffers which pools buffer instances for later reuse and uses CSList to pool the buffers. This list is lock free; which may have some positive performance implications in some circumstances (but we've yet to find them or even look that hard for them). Ideally the shared code between this and CBufferAllocator could be removed. More...
class  CMemoryInputOutputStream
 An object that implements IInputStream and ICloseableOutputStream on a memory buffer. More...
class  CMemoryInputStream
 An object that implements IInputStream on a memory buffer. More...
class  CNullBufferAllocationMonitor
 An object that implements IMonitorBufferAllocation and does nothing. More...
class  CNullIOPoolMonitor
 An object that implements IMonitorIOPool and does nothing. More...

Functions

static HANDLE OpenFile (const _tstring &filePath)
static HANDLE OpenFile (const _tstring &filePath, CFileOutputStream::CreationDisposition disposition)
static DWORD MapDisposition (CFileOutputStream::CreationDisposition disposition)
static
CIOPool::ThreadCount 
CalculateNumberOfThreads (CIOPool::ThreadCount numThreads)
static DWORD GetTlsIndex ()
static void ReleaseTlsIndex ()

Variables

static const
CLocalTimeProvider 
s_timeProvider
static
CNullBufferAllocationMonitor 
s_nullMonitor
CNullIOPoolMonitor s_nullPoolMonitor
static CCriticalSection s_criticalSection
static
CThreadLocalStorage
s_pTls = 0
static size_t s_ref = 0
static
CNullBufferAllocationMonitor 
s_nullMonitor


Function Documentation

static CIOPool::ThreadCount CalculateNumberOfThreads ( CIOPool::ThreadCount  numThreads  )  [static]

static DWORD GetTlsIndex (  )  [static]

static DWORD JetByteTools::IO::MapDisposition ( CFileOutputStream::CreationDisposition  disposition  )  [static]

static HANDLE OpenFile ( const _tstring &  filePath,
CFileOutputStream::CreationDisposition  disposition 
) [static]

static HANDLE OpenFile ( const _tstring &  filePath  )  [static]

static void ReleaseTlsIndex (  )  [static]


Variable Documentation

CCriticalSection s_criticalSection [static]

CNullBufferAllocationMonitor s_nullMonitor [static]

CNullBufferAllocationMonitor s_nullMonitor [static]

CNullIOPoolMonitor s_nullPoolMonitor

CThreadLocalStorage* s_pTls = 0 [static]

size_t s_ref = 0 [static]

const CLocalTimeProvider s_timeProvider [static]


Generated on Tue Oct 2 15:45:24 2007 for JetByte Tools - v5.2 by  doxygen 1.5.3