WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
WMVLog::LogOutputFile Class Reference

Thread-safe log output sink that writes messages to a file on disk. More...

#include <LogOutputFile.h>

Inheritance diagram for WMVLog::LogOutputFile:
[legend]
Collaboration diagram for WMVLog::LogOutputFile:
[legend]

Public Member Functions

 LogOutputFile (std::string fileName)
 Construct a file output sink that writes to the given path.
 
void write (const std::string &message)
 Write a log message to the file (thread-safe).
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()
 
virtual bool addChild (Component *)
 Add a child component to this node.
 
virtual bool removeChild (Component *)
 Remove a child component from this node.
 
virtual void removeAllChildren ()
 
virtual unsigned int nbChildren () const
 
virtual bool findChildComponent (Component *, bool)
 
virtual ComponentgetChild (unsigned int)
 
virtual const ComponentgetChild (unsigned int) const
 
void setParentComponent (Component *)
 Set the parent of this component.
 
virtual void onParentSet (Component *)
 Called after the parent has been set; override for custom logic.
 
const Componentparent () const
 Get the parent component (const).
 
Componentparent ()
 Get the parent component.
 
template<class DataType >
const DataType * firstParentOfType ()
 Walk up the parent chain and return the first ancestor of the given type.
 
void ref ()
 Increment the reference counter.
 
void unref ()
 Decrement the reference counter; deletes this when it reaches zero.
 
void setName (const std::string &name)
 
std::string name () const
 
virtual void onNameChanged ()
 
void print (int l_depth=0)
 
virtual void doPrint ()
 
void copy (const Component &component, bool)
 

Private Member Functions

 LogOutputFile ()
 
 LogOutputFile (const LogOutputFile &)
 
LogOutputFileoperator= (const LogOutputFile &)=delete
 

Private Attributes

std::mutex m_mutex
 
std::ofstream m_logFile
 

Detailed Description

Thread-safe log output sink that writes messages to a file on disk.

Definition at line 10 of file LogOutputFile.h.

Constructor & Destructor Documentation

◆ LogOutputFile() [1/3]

LogOutputFile::LogOutputFile ( std::string  fileName)

Construct a file output sink that writes to the given path.

Definition at line 5 of file LogOutputFile.cpp.

◆ LogOutputFile() [2/3]

WMVLog::LogOutputFile::LogOutputFile ( )
private

◆ LogOutputFile() [3/3]

WMVLog::LogOutputFile::LogOutputFile ( const LogOutputFile )
private

Member Function Documentation

◆ operator=()

LogOutputFile & WMVLog::LogOutputFile::operator= ( const LogOutputFile )
privatedelete

◆ write()

void LogOutputFile::write ( const std::string &  message)
virtual

Write a log message to the file (thread-safe).

Implements WMVLog::LogOutput.

Definition at line 10 of file LogOutputFile.cpp.

Member Data Documentation

◆ m_logFile

std::ofstream WMVLog::LogOutputFile::m_logFile
private

Definition at line 25 of file LogOutputFile.h.

◆ m_mutex

std::mutex WMVLog::LogOutputFile::m_mutex
mutableprivate

Definition at line 24 of file LogOutputFile.h.


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