w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Retro::RlogFile Class Reference

FIXME_docs. More...

#include <RlogFile.hpp>

Collaboration diagram for Retro::RlogFile:
[legend]

Public Member Functions

 RlogFile ()
 Default constructor.
 
 RlogFile (std::ostream *os, const std::string &name="")
 FIXME_docs.
 
 ~RlogFile ()
 Destructor.
 
 RlogFile (const RlogFile &)=delete
 
RlogFileoperator= (const RlogFile &)=delete
 
bool IsNew () const
 FIXME_docs.
 
bool Open (std::string name, RerrMsg &emsg)
 FIXME_docs.
 
void Close ()
 FIXME_docs.
 
void UseStream (std::ostream *os, const std::string &name="")
 FIXME_docs.
 
const std::string & Name () const
 FIXME_docs.
 
void Write (const std::string &str, char tag=0)
 FIXME_docs.
 
void Dump (std::ostream &os, int ind=0, const char *text=0) const
 FIXME_docs.
 
void lock ()
 FIXME_docs.
 
void unlock ()
 FIXME_docs.
 
RlogFileoperator<< (const RlogMsg &lmsg)
 FIXME_docs.
 

Protected Member Functions

std::ostream & Stream ()
 FIXME_docs.
 
void ClearTime ()
 FIXME_docs.
 
std::string BuildinStreamName (std::ostream *os, const std::string &str)
 FIXME_docs.
 

Protected Attributes

std::ostream * fpExtStream
 pointer to external stream
 
std::ofstream fIntStream
 internal stream
 
bool fNew
 true if never opened or used
 
std::string fName
 log file name
 
int fTagYear
 year of last time tag
 
int fTagMonth
 month of last time tag
 
int fTagDay
 day of last time tag
 
std::mutex fMutex
 mutex to lock file
 

Detailed Description

FIXME_docs.

Definition at line 34 of file RlogFile.hpp.

Constructor & Destructor Documentation

◆ RlogFile() [1/3]

Retro::RlogFile::RlogFile ( )

Default constructor.

Definition at line 47 of file RlogFile.cpp.

References ClearTime().

◆ RlogFile() [2/3]

Retro::RlogFile::RlogFile ( std::ostream *  os,
const std::string &  name = "" 
)
explicit

FIXME_docs.

Definition at line 60 of file RlogFile.cpp.

References ClearTime().

◆ ~RlogFile()

Retro::RlogFile::~RlogFile ( )

Destructor.

Definition at line 73 of file RlogFile.cpp.

◆ RlogFile() [3/3]

Retro::RlogFile::RlogFile ( const RlogFile )
delete

Member Function Documentation

◆ operator=()

RlogFile & Retro::RlogFile::operator= ( const RlogFile )
delete

◆ IsNew()

bool Retro::RlogFile::IsNew ( ) const
inline

FIXME_docs.

Definition at line 22 of file RlogFile.ipp.

References fNew.

◆ Open()

bool Retro::RlogFile::Open ( std::string  name,
RerrMsg emsg 
)

FIXME_docs.

Definition at line 79 of file RlogFile.cpp.

References fIntStream, fName, fNew, fpExtStream, Retro::RerrMsg::InitErrno(), and UseStream().

◆ Close()

void Retro::RlogFile::Close ( )

FIXME_docs.

Definition at line 104 of file RlogFile.cpp.

References fIntStream.

Referenced by UseStream().

◆ UseStream()

void Retro::RlogFile::UseStream ( std::ostream *  os,
const std::string &  name = "" 
)

FIXME_docs.

Definition at line 113 of file RlogFile.cpp.

References BuildinStreamName(), Close(), fIntStream, fName, fNew, and fpExtStream.

Referenced by Open().

◆ Name()

const std::string & Retro::RlogFile::Name ( ) const
inline

FIXME_docs.

Definition at line 30 of file RlogFile.ipp.

References fName.

Referenced by Retro::RlinkConnect::LogFileName(), and Retro::RtclRlinkConnect::M_default().

◆ Write()

void Retro::RlogFile::Write ( const std::string &  str,
char  tag = 0 
)

FIXME_docs.

Definition at line 125 of file RlogFile.cpp.

References fIntStream, fpExtStream, fTagDay, fTagMonth, fTagYear, lock(), and Retro::RosPrintf().

Referenced by Retro::RtclRlinkConnect::M_log(), and operator<<().

◆ Dump()

void Retro::RlogFile::Dump ( std::ostream &  os,
int  ind = 0,
const char *  text = 0 
) const

FIXME_docs.

Definition at line 168 of file RlogFile.cpp.

References fIntStream, fName, fNew, fpExtStream, fTagDay, fTagMonth, fTagYear, and Retro::RosPrintf().

◆ lock()

void Retro::RlogFile::lock ( )

FIXME_docs.

Definition at line 184 of file RlogFile.cpp.

References fMutex.

Referenced by Write().

◆ unlock()

void Retro::RlogFile::unlock ( )

FIXME_docs.

Definition at line 193 of file RlogFile.cpp.

References fMutex.

◆ operator<<()

RlogFile & Retro::RlogFile::operator<< ( const RlogMsg lmsg)

FIXME_docs.

Definition at line 202 of file RlogFile.cpp.

References Retro::RlogMsg::String(), Retro::RlogMsg::Tag(), and Write().

◆ Stream()

std::ostream & Retro::RlogFile::Stream ( )
inlineprotected

FIXME_docs.

Definition at line 38 of file RlogFile.ipp.

References fIntStream, and fpExtStream.

◆ ClearTime()

void Retro::RlogFile::ClearTime ( )
protected

FIXME_docs.

Definition at line 212 of file RlogFile.cpp.

References fTagDay, fTagMonth, and fTagYear.

Referenced by RlogFile().

◆ BuildinStreamName()

std::string Retro::RlogFile::BuildinStreamName ( std::ostream *  os,
const std::string &  str 
)
protected

FIXME_docs.

Definition at line 223 of file RlogFile.cpp.

Referenced by UseStream().

Member Data Documentation

◆ fpExtStream

std::ostream* Retro::RlogFile::fpExtStream
protected

pointer to external stream

Definition at line 65 of file RlogFile.hpp.

Referenced by Dump(), Open(), Stream(), UseStream(), and Write().

◆ fIntStream

std::ofstream Retro::RlogFile::fIntStream
protected

internal stream

Definition at line 66 of file RlogFile.hpp.

Referenced by Close(), Dump(), Open(), Stream(), UseStream(), and Write().

◆ fNew

bool Retro::RlogFile::fNew
protected

true if never opened or used

Definition at line 67 of file RlogFile.hpp.

Referenced by Dump(), IsNew(), Open(), and UseStream().

◆ fName

std::string Retro::RlogFile::fName
protected

log file name

Definition at line 68 of file RlogFile.hpp.

Referenced by Dump(), Name(), Open(), and UseStream().

◆ fTagYear

int Retro::RlogFile::fTagYear
protected

year of last time tag

Definition at line 69 of file RlogFile.hpp.

Referenced by ClearTime(), Dump(), and Write().

◆ fTagMonth

int Retro::RlogFile::fTagMonth
protected

month of last time tag

Definition at line 70 of file RlogFile.hpp.

Referenced by ClearTime(), Dump(), and Write().

◆ fTagDay

int Retro::RlogFile::fTagDay
protected

day of last time tag

Definition at line 71 of file RlogFile.hpp.

Referenced by ClearTime(), Dump(), and Write().

◆ fMutex

std::mutex Retro::RlogFile::fMutex
protected

mutex to lock file

Definition at line 72 of file RlogFile.hpp.

Referenced by lock(), and unlock().


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