Scope
scope::ScopeLogger::Impl Class Reference

#include <ScopeLogger_p.h>

Public Member Functions

 Impl (const log_message_type &filem=log_all, const log_message_type &consolem=log_all, const log_message_type &logboxm=log_all)
 
void SetFilepath (const std::wstring &_filepath=L"C:\\ScopeData")
 
void Log (const std::wstring &message, const log_message_type &msgtype)
 
void AttachLogFrame (gui::CLogFrame *const _logframe)
 
HWND GetLogFrameWindow ()
 
bool HasLogFrame () const
 
void GetUserLoggings ()
 
void DetachLogFrame ()
 
void Shutdown ()
 

Protected Member Functions

 Impl (const Impl &i)
 
Impl operator= (const Impl &i)
 
ControllerReturnStatus WriteToConsole (StopCondition *const sc, const std::wstring message)
 
ControllerReturnStatus WriteToLogbox (StopCondition *const sc, const std::wstring message, const log_message_type msgtype)
 
ControllerReturnStatus FlushLogbox (StopCondition *const sc)
 

Protected Attributes

Active< ControllerReturnStatus > active
 
std::wstring file_path
 
bool filepath_set
 
std::wofstream userlogfile
 
log_message_type file_messages
 
log_message_type console_message
 
log_message_type logframe_message
 
gui::CLogFramelogframe
 
std::wstring logbooktext
 
std::list< std::wstring > logbookentries
 

Detailed Description

Implementation class of the ScopeLogger.

Definition at line 12 of file ScopeLogger_p.h.

Constructor & Destructor Documentation

scope::ScopeLogger::Impl::Impl ( const Impl i)
protected

disable copy

scope::ScopeLogger::Impl::Impl ( const log_message_type &  filem = log_all,
const log_message_type &  consolem = log_all,
const log_message_type &  logboxm = log_all 
)
inline

Create logfiles.

Definition at line 96 of file ScopeLogger_p.h.

Member Function Documentation

Impl scope::ScopeLogger::Impl::operator= ( const Impl i)
protected

disable assignment

ControllerReturnStatus scope::ScopeLogger::Impl::WriteToConsole ( StopCondition *const  sc,
const std::wstring  message 
)
inlineprotected

Writes message to debug console.

Definition at line 53 of file ScopeLogger_p.h.

ControllerReturnStatus scope::ScopeLogger::Impl::WriteToLogbox ( StopCondition *const  sc,
const std::wstring  message,
const log_message_type  msgtype 
)
inlineprotected

Writes message to the logbook window.

Definition at line 59 of file ScopeLogger_p.h.

ControllerReturnStatus scope::ScopeLogger::Impl::FlushLogbox ( StopCondition *const  sc)
inlineprotected

Updates the logbook window , writes complete logbook to disk, overwrites the old logbook on disk.

Since user can edit logbook everywhere, we always have to (over)write everything

Definition at line 82 of file ScopeLogger_p.h.

void scope::ScopeLogger::Impl::SetFilepath ( const std::wstring &  _filepath = L"C:\\ScopeData")
inline

Sets the filepath and creates logfile.

Definition at line 114 of file ScopeLogger_p.h.

void scope::ScopeLogger::Impl::Log ( const std::wstring &  message,
const log_message_type &  msgtype 
)
inline

Logs a message.

Definition at line 130 of file ScopeLogger_p.h.

void scope::ScopeLogger::Impl::AttachLogFrame ( gui::CLogFrame *const  _logframe)
inline

Attaches a CLogFrame as the logbook window.

Definition at line 142 of file ScopeLogger_p.h.

HWND scope::ScopeLogger::Impl::GetLogFrameWindow ( )
inline

Saves log frame parameters into Window (for recreating windows on startup)

Definition at line 148 of file ScopeLogger_p.h.

bool scope::ScopeLogger::Impl::HasLogFrame ( ) const
inline
Returns
logbook already attached?

Definition at line 153 of file ScopeLogger_p.h.

void scope::ScopeLogger::Impl::GetUserLoggings ( )
inline

Gets the text in the logbook window and calls FlushLogbox.

Definition at line 158 of file ScopeLogger_p.h.

void scope::ScopeLogger::Impl::DetachLogFrame ( )
inline

Detaches a CLogFrame.

Definition at line 165 of file ScopeLogger_p.h.

void scope::ScopeLogger::Impl::Shutdown ( )
inline

Shutdown the Active, called from Run in scope.cpp.

avoids a dangling async thread from the ScopeLogger (generates problems since ScopeLoggerImpl is static and destructor is called very late/at undefined timepoint).

Definition at line 173 of file ScopeLogger_p.h.

Member Data Documentation

Active<ControllerReturnStatus> scope::ScopeLogger::Impl::active
protected

Active object for running the loggings.

Definition at line 16 of file ScopeLogger_p.h.

std::wstring scope::ScopeLogger::Impl::file_path
protected

path string for log file

Definition at line 19 of file ScopeLogger_p.h.

bool scope::ScopeLogger::Impl::filepath_set
protected

true if file path set and files opened

Definition at line 22 of file ScopeLogger_p.h.

std::wofstream scope::ScopeLogger::Impl::userlogfile
protected

File with user comments and logging of performed scans etc.

Definition at line 25 of file ScopeLogger_p.h.

log_message_type scope::ScopeLogger::Impl::file_messages
protected

which message types to save to disk

Definition at line 28 of file ScopeLogger_p.h.

log_message_type scope::ScopeLogger::Impl::console_message
protected

which message types to print out on debug console

Definition at line 31 of file ScopeLogger_p.h.

log_message_type scope::ScopeLogger::Impl::logframe_message
protected

which message types to print in log frame

Definition at line 34 of file ScopeLogger_p.h.

gui::CLogFrame* scope::ScopeLogger::Impl::logframe
protected

pointer to the log window frame

Definition at line 37 of file ScopeLogger_p.h.

std::wstring scope::ScopeLogger::Impl::logbooktext
protected

the complete log text as a string

Definition at line 40 of file ScopeLogger_p.h.

std::list<std::wstring> scope::ScopeLogger::Impl::logbookentries
protected

a vector of all log entries done by scope

Definition at line 43 of file ScopeLogger_p.h.


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