CAsyncFileLog Class Reference
[Asynchronous I/OInterfacesFileIOLog files and the pluggable logging system]

Inheritance diagram for CAsyncFileLog:

Inheritance graph
[legend]
Collaboration diagram for CAsyncFileLog:

Collaboration graph
[legend]

List of all members.


Detailed Description

A class that implements JetByteTools::ILogMessages to provide an asynchronous file log that uses overlapped I/O to perform writes to the log file.

Public Types

typedef unsigned long DataLength

Public Member Functions

 CAsyncFileLog (const JetByteTools::Win32::_tstring &filename)
 Construct an async file log using the supplied filename for the log file. File I/O will be done using a default I/O thread pool with a single thread and buffers will be allocated from a default allocator with a buffer size of 100 bytes and a pool size of 10.
 CAsyncFileLog (const JetByteTools::Win32::_tstring &filename, JetByteTools::IO::IIOPool &pool, JetByteTools::IO::IAllocateBuffers &allocator)
 Construct an async file log using the supplied filename for the log file. File I/O will be done using the threads in the IIOPool provided and data buffers obtained from the supplied buffer allocator.
 CAsyncFileLog (const JetByteTools::Win32::_tstring &filename, JetByteTools::IO::IIOPool &pool, JetByteTools::IO::IAllocateBuffers &allocator, const JetByteTools::Win32::IProvideLocalTime &timeProvider)
 Construct an async file log using the supplied filename for the log file. File I/O will be done using the threads in the IIOPool provided and data buffers obtained from the supplied buffer allocator.
 ~CAsyncFileLog ()
 Waits for any pending writes to complete and then destroys the log object.
virtual void SetThreadIdentifier (const std::string &identifier)
 Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned.
virtual void SetThreadIdentifier (const std::wstring &identifier)
 Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned.
virtual void SetLogName (const std::string &logName)
virtual void SetLogName (const std::wstring &logName)
virtual void LogMessage (const std::string &message)
virtual void LogMessage (const std::wstring &message)
virtual void LogMessage (const char *const pString)
virtual void LogMessage (const wchar_t *const pString)
virtual void LogMessage (const char *const pString, const DataLength stringLength)
virtual void LogMessage (const wchar_t *const pString, const DataLength stringLength)
virtual HANDLE GetWaitHandle () const
 Access a HANDLE to wait on by passing it to one of the Wait Functions.
virtual void Wait () const
 Wait indefinitely for the object to become signalled.
virtual bool Wait (const Milliseconds timeoutMillis) const
 Wait, with a time limit, for the object to become signalled.

Static Public Member Functions

static void Wait (HANDLE handle)
 Wait indefinitely for the supplied handle to become signalled.
static bool Wait (HANDLE handle, const Milliseconds timeout)
 Wait, with a time limit, for the supplied handle to become signalled.

Member Typedef Documentation

typedef unsigned long DataLength [inherited]


Constructor & Destructor Documentation

CAsyncFileLog ( const JetByteTools::Win32::_tstring filename  )  [explicit]

Construct an async file log using the supplied filename for the log file. File I/O will be done using a default I/O thread pool with a single thread and buffers will be allocated from a default allocator with a buffer size of 100 bytes and a pool size of 10.

CAsyncFileLog ( const JetByteTools::Win32::_tstring filename,
JetByteTools::IO::IIOPool pool,
JetByteTools::IO::IAllocateBuffers allocator 
)

Construct an async file log using the supplied filename for the log file. File I/O will be done using the threads in the IIOPool provided and data buffers obtained from the supplied buffer allocator.

CAsyncFileLog ( const JetByteTools::Win32::_tstring filename,
JetByteTools::IO::IIOPool pool,
JetByteTools::IO::IAllocateBuffers allocator,
const JetByteTools::Win32::IProvideLocalTime timeProvider 
)

Construct an async file log using the supplied filename for the log file. File I/O will be done using the threads in the IIOPool provided and data buffers obtained from the supplied buffer allocator.

~CAsyncFileLog (  ) 

Waits for any pending writes to complete and then destroys the log object.


Member Function Documentation

void SetThreadIdentifier ( const std::string &  identifier  )  [virtual]

Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned.

Implements ILogMessages.

void SetThreadIdentifier ( const std::wstring &  identifier  )  [virtual]

Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned.

Implements ILogMessages.

void SetLogName ( const std::string &  logName  )  [virtual]

Implements ILogMessages.

void SetLogName ( const std::wstring &  logName  )  [virtual]

Implements ILogMessages.

void LogMessage ( const std::string &  message  )  [virtual]

Implements ILogMessages.

void LogMessage ( const std::wstring &  message  )  [virtual]

Implements ILogMessages.

void LogMessage ( const char *const   pString  )  [virtual]

Implements ILogMessages.

void LogMessage ( const wchar_t *const   pString  )  [virtual]

Implements ILogMessages.

void LogMessage ( const char *const   pString,
const DataLength  stringLength 
) [virtual]

Implements ILogMessages.

void LogMessage ( const wchar_t *const   pString,
const DataLength  stringLength 
) [virtual]

Implements ILogMessages.

HANDLE GetWaitHandle (  )  const [virtual]

Access a HANDLE to wait on by passing it to one of the Wait Functions.

Implements IWaitable.

void Wait (  )  const [virtual]

Wait indefinitely for the object to become signalled.

Implements IWaitable.

bool Wait ( const Milliseconds  timeout  )  const [virtual]

Wait, with a time limit, for the object to become signalled.

Implements IWaitable.

void Wait ( HANDLE  handle  )  [static, inherited]

Wait indefinitely for the supplied handle to become signalled.

bool Wait ( HANDLE  handle,
const Milliseconds  timeout 
) [static, inherited]

Wait, with a time limit, for the supplied handle to become signalled.


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