SNAP Library 2.1, User Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TFPathNotify Class Reference

#include <xfl.h>

Inherits TNotify.

List of all members.

Public Member Functions

 TFPathNotify (const TStr &_LogFPath, const TStr &_PrefixFNm, const bool &_FlushP)
void OnStatus (const TStr &MsgStr)

Static Public Member Functions

static PNotify New (const TStr &LogFPath, const TStr &PrefixFNm, const bool &FlushP)

Private Member Functions

void UpdateSOut (const TTm &NowTm)
 UndefDefaultCopyAssign (TFPathNotify)

Private Attributes

TStr LogFPath
TStr PrefixFNm
TTm LastTm
PSOut LogSOut
TBool FlushP

Detailed Description

Definition at line 83 of file xfl.h.


Constructor & Destructor Documentation

TFPathNotify::TFPathNotify ( const TStr _LogFPath,
const TStr _PrefixFNm,
const bool &  _FlushP 
)

Definition at line 262 of file xfl.cpp.

                                    : LogFPath(_LogFPath), PrefixFNm(_PrefixFNm),
                        FlushP(_FlushP) { 

        LastTm = TTm::GetCurUniTm();
        UpdateSOut(LastTm);
}

Member Function Documentation

static PNotify TFPathNotify::New ( const TStr LogFPath,
const TStr PrefixFNm,
const bool &  FlushP 
) [inline, static]

Definition at line 97 of file xfl.h.

                                                                                            {
                return PNotify(new TFPathNotify(LogFPath, PrefixFNm, FlushP));}
void TFPathNotify::OnStatus ( const TStr MsgStr) [virtual]

Reimplemented from TNotify.

Definition at line 270 of file xfl.cpp.

                                              {
        // check if new hour so we switch to new log file
        TTm NowTm = TTm::GetCurUniTm();
        if (NowTm.GetHour() != LastTm.GetHour()) { 
                LastTm = NowTm; UpdateSOut(LastTm);
        }
        // write log line
        LogSOut->PutStrLn(MsgStr); 
        // we flush for each line when in debug mode
        if (FlushP) { LogSOut->Flush(); }
}
void TFPathNotify::UpdateSOut ( const TTm NowTm) [private]

Definition at line 255 of file xfl.cpp.

                                           {
        if (!LogSOut.Empty()) { LogSOut->Flush(); LogSOut.Clr(); }
        TStr FNm = TStr::Fmt("%s-Y%04d-M%02d-D%02d-H%02d.log", PrefixFNm.CStr(),
                Tm.GetYear(), Tm.GetMonth(), Tm.GetDay(), Tm.GetHour());
        LogSOut = TFOut::New(LogFPath + FNm, true);
}

Member Data Documentation

Definition at line 89 of file xfl.h.

Definition at line 87 of file xfl.h.

Definition at line 85 of file xfl.h.

Definition at line 88 of file xfl.h.

Definition at line 86 of file xfl.h.


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