SNAP Library 2.1, Developer 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
TNotify Class Reference

#include <ut.h>

Inheritance diagram for TNotify:
Collaboration diagram for TNotify:

List of all members.

Public Member Functions

 TNotify ()
virtual ~TNotify ()
virtual void OnNotify (const TNotifyType &, const TStr &)
virtual void OnStatus (const TStr &)
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 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)

Static Public Attributes

static const PNotify NullNotify = TNullNotify::New()
static const PNotify StdNotify = TStdNotify::New()
static const PNotify StdErrNotify = TStdErrNotify::New()

Private Member Functions

 TNotify (const TNotify &)
TNotifyoperator= (const TNotify &)

Private Attributes

TCRef CRef

Friends

class TPt< TNotify >

Detailed Description

Definition at line 30 of file ut.h.


Constructor & Destructor Documentation

TNotify::TNotify ( const TNotify ) [private]
TNotify::TNotify ( ) [inline]

Definition at line 35 of file ut.h.

{}
virtual TNotify::~TNotify ( ) [inline, virtual]

Definition at line 36 of file ut.h.

{}

Member Function Documentation

void TNotify::DfOnNotify ( const TNotifyType Type,
const TStr MsgStr 
) [static]

Definition at line 54 of file ut.cpp.

References ErrNotify(), Fail, InfoNotify(), ntErr, ntInfo, ntStat, ntWarn, StatNotify(), and WarnNotify().

                                                                   {
  switch (Type){
    case ntInfo: InfoNotify(MsgStr); break;
    case ntWarn: WarnNotify(MsgStr); break;
    case ntErr: ErrNotify(MsgStr); break;
    case ntStat: StatNotify(MsgStr); break;
    default: Fail;
  }
}

Here is the call graph for this function:

TStr TNotify::GetTypeStr ( const TNotifyType Type,
const bool &  Brief = true 
) [static]

Definition at line 39 of file ut.cpp.

References Fail, ntErr, ntInfo, ntStat, and ntWarn.

Referenced by TStdNotify::OnNotify(), and TStdErrNotify::OnNotify().

                                            {
  static TStr InfoSStr="I"; static TStr InfoLStr="Information";
  static TStr WarnSStr="W"; static TStr WarnLStr="Warning";
  static TStr ErrSStr="E"; static TStr ErrLStr="Error";
  static TStr StatSStr=""; static TStr StatLStr="Status";
  switch (Type){
    case ntInfo: if (Brief){return InfoSStr;} else {return InfoLStr;}
    case ntWarn: if (Brief){return WarnSStr;} else {return WarnLStr;}
    case ntErr: if (Brief){return ErrSStr;} else {return ErrLStr;}
    case ntStat: if (Brief){return StatSStr;} else {return StatLStr;}
    default: Fail; return TStr();
  }
}

Here is the caller graph for this function:

virtual void TNotify::OnLn ( const TStr ) [inline, virtual]

Definition at line 40 of file ut.h.

Referenced by OnLn(), and OnLnFmt().

{}

Here is the caller graph for this function:

static void TNotify::OnLn ( const PNotify Notify,
const TStr MsgStr 
) [inline, static]

Definition at line 56 of file ut.h.

References TPt< TRec >::Empty(), and OnLn().

                                                             {
    if (!Notify.Empty()){Notify->OnLn(MsgStr);}}

Here is the call graph for this function:

void TNotify::OnLnFmt ( const char *  FmtStr,
  ... 
)

Definition at line 21 of file ut.cpp.

References OnLn().

                                             {
  char Bf[10*1024];
  va_list valist;
  va_start(valist, FmtStr);
  const int RetVal=vsnprintf(Bf, 10*1024-2, FmtStr, valist);
  va_end(valist);
  if (RetVal!=-1) { OnLn(TStr(Bf)); }
}

Here is the call graph for this function:

virtual void TNotify::OnNotify ( const TNotifyType ,
const TStr  
) [inline, virtual]

Reimplemented in TStdErrNotify, TStdNotify, TNativeCallbackNotify, TCallbackNotify, and TNullNotify.

Definition at line 38 of file ut.h.

Referenced by TSs::LoadTxt(), OnNotify(), and OnNotifyFmt().

{}

Here is the caller graph for this function:

static void TNotify::OnNotify ( const PNotify Notify,
const TNotifyType Type,
const TStr MsgStr 
) [inline, static]

Definition at line 51 of file ut.h.

References TPt< TRec >::Empty(), and OnNotify().

                                               {
    if (!Notify.Empty()){Notify->OnNotify(Type, MsgStr);}}

Here is the call graph for this function:

void TNotify::OnNotifyFmt ( const TNotifyType Type,
const char *  FmtStr,
  ... 
)

Definition at line 3 of file ut.cpp.

References OnNotify().

                                                                          {
  char Bf[10*1024];
  va_list valist;
  va_start(valist, FmtStr);
  const int RetVal=vsnprintf(Bf, 10*1024-2, FmtStr, valist);
  va_end(valist);
  if (RetVal!=-1) { OnNotify(Type, TStr(Bf)); }
}

Here is the call graph for this function:

static void TNotify::OnStatus ( const PNotify Notify,
const TStr MsgStr 
) [inline, static]

Definition at line 54 of file ut.h.

References TPt< TRec >::Empty(), and OnStatus().

                                                                 {
    if (!Notify.Empty()){Notify->OnStatus(MsgStr);}}

Here is the call graph for this function:

void TNotify::OnStatusFmt ( const char *  FmtStr,
  ... 
)

Definition at line 12 of file ut.cpp.

References OnStatus().

                                                 {
  char Bf[10*1024];
  va_list valist;
  va_start(valist, FmtStr);
  const int RetVal=vsnprintf(Bf, 10*1024-2, FmtStr, valist);
  va_end(valist);
  if (RetVal!=-1) { OnStatus(TStr(Bf)); }
}

Here is the call graph for this function:

virtual void TNotify::OnTxt ( const TStr ) [inline, virtual]

Definition at line 41 of file ut.h.

Referenced by OnTxt(), and OnTxtFmt().

{}

Here is the caller graph for this function:

static void TNotify::OnTxt ( const PNotify Notify,
const TStr MsgStr 
) [inline, static]

Definition at line 58 of file ut.h.

References TPt< TRec >::Empty(), and OnTxt().

                                                              {
    if (!Notify.Empty()){Notify->OnTxt(MsgStr);}}

Here is the call graph for this function:

void TNotify::OnTxtFmt ( const char *  FmtStr,
  ... 
)

Definition at line 30 of file ut.cpp.

References OnTxt().

                                              {
  char Bf[10*1024];
  va_list valist;
  va_start(valist, FmtStr);
  const int RetVal=vsnprintf(Bf, 10*1024-2, FmtStr, valist);
  va_end(valist);
  if (RetVal!=-1) { OnTxt(TStr(Bf)); }
}

Here is the call graph for this function:

TNotify& TNotify::operator= ( const TNotify ) [private]

Friends And Related Function Documentation

friend class TPt< TNotify > [friend]

Definition at line 30 of file ut.h.


Member Data Documentation

TCRef TNotify::CRef [private]

Definition at line 30 of file ut.h.

Definition at line 62 of file ut.h.

Definition at line 64 of file ut.h.

Definition at line 63 of file ut.h.


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