SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TStdNotify Class Reference

#include <ut.h>

Inherits TNotify.

Public Member Functions

 TStdNotify ()
 
void OnNotify (const TNotifyType &Type, const TStr &MsgStr)
 
void OnStatus (const TStr &MsgStr)
 
- Public Member Functions inherited from TNotify
 TNotify ()
 
virtual ~TNotify ()
 
virtual void OnLn (const TStr &)
 
virtual void OnTxt (const TStr &)
 
void OnNotifyFmt (const TNotifyType &Type, const char *FmtStr,...)
 
void OnStatusFmt (const char *FmtStr,...)
 
void OnLnFmt (const char *FmtStr,...)
 
void OnTxtFmt (const char *FmtStr,...)
 

Static Public Member Functions

static PNotify New ()
 
- Static Public Member Functions inherited from TNotify
static TStr GetTypeStr (const TNotifyType &Type, const bool &Brief=true)
 
static void OnNotify (const PNotify &Notify, const TNotifyType &Type, const TStr &MsgStr)
 
static void OnStatus (const PNotify &Notify, const TStr &MsgStr)
 
static void OnLn (const PNotify &Notify, const TStr &MsgStr)
 
static void OnTxt (const PNotify &Notify, const TStr &MsgStr)
 
static void DfOnNotify (const TNotifyType &Type, const TStr &MsgStr)
 

Additional Inherited Members

- Static Public Attributes inherited from TNotify
static const PNotify NullNotify =TNullNotify::New()
 
static const PNotify StdNotify =TStdNotify::New()
 
static const PNotify StdErrNotify =TStdErrNotify::New()
 

Detailed Description

Definition at line 126 of file ut.h.

Constructor & Destructor Documentation

TStdNotify::TStdNotify ( )
inline

Definition at line 128 of file ut.h.

128 {}

Member Function Documentation

static PNotify TStdNotify::New ( )
inlinestatic

Definition at line 129 of file ut.h.

129 {return PNotify(new TStdNotify());}
TPt< TNotify > PNotify
Definition: ut.h:30
TStdNotify()
Definition: ut.h:128
void TStdNotify::OnNotify ( const TNotifyType Type,
const TStr MsgStr 
)
virtual

Reimplemented from TNotify.

Definition at line 70 of file ut.cpp.

70  {
71  if (Type==ntInfo){
72  printf("%s\n", MsgStr.CStr());
73  } else {
74  TStr TypeStr=TNotify::GetTypeStr(Type, false);
75  printf("%s: %s\n", TypeStr.CStr(), MsgStr.CStr());
76  }
77 }
static TStr GetTypeStr(const TNotifyType &Type, const bool &Brief=true)
Definition: ut.cpp:39
Definition: dt.h:412
Definition: ut.h:28
char * CStr()
Definition: dt.h:479
void TStdNotify::OnStatus ( const TStr MsgStr)
virtual

Reimplemented from TNotify.

Definition at line 79 of file ut.cpp.

79  {
80  printf("%s", MsgStr.CStr());
81  // print '\n' if message not overlayed
82  if ((!MsgStr.Empty())&&(MsgStr.LastCh()!='\r')){
83  printf("\n");}
84 }
char LastCh() const
Definition: dt.h:487
bool Empty() const
Definition: dt.h:491
char * CStr()
Definition: dt.h:479

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