| 
    SNAP Library 2.0, Developer Reference
    2013-05-13 16:33:57
    
   SNAP, a general purpose, high performance system for analysis and manipulation of large networks 
   | 
  
  
  
 
#include <ut.h>


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 &) | |
| TNotify & | operator= (const TNotify &) | 
Private Attributes | |
| TCRef | CRef | 
Friends | |
| class | TPt< TNotify > | 
| TNotify::TNotify | ( | const TNotify & | ) |  [private] | 
        
| TNotify::TNotify | ( | ) |  [inline] | 
        
| virtual TNotify::~TNotify | ( | ) |  [inline, virtual] | 
        
| 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;
  }
}

| 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();
  }
}

| virtual void TNotify::OnLn | ( | const TStr & | ) |  [inline, virtual] | 
        
| static void TNotify::OnLn | ( | const PNotify & | Notify, | 
| const TStr & | MsgStr | ||
| ) |  [inline, static] | 
        
| void TNotify::OnLnFmt | ( | const char * | FmtStr, | 
| ... | |||
| ) | 
| 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().
{}

| 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().

| 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)); }
}

| virtual void TNotify::OnStatus | ( | const TStr & | ) |  [inline, virtual] | 
        
Reimplemented in TLogNotify, TStdErrNotify, TStdNotify, TNativeCallbackNotify, TFPathNotify, TCallbackNotify, and TNullNotify.
Definition at line 39 of file ut.h.
Referenced by TEnv::GetIfArgPrefixBool(), TEnv::GetIfArgPrefixFlt(), TEnv::GetIfArgPrefixInt(), TEnv::GetIfArgPrefixStr(), TEnv::GetIfArgPrefixStrV(), TEnv::IsArgStr(), TSs::LoadTxt(), OnStatus(), TLogNotify::OnStatus(), and OnStatusFmt().
{}

| 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().

| 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)); }
}

| virtual void TNotify::OnTxt | ( | const TStr & | ) |  [inline, virtual] | 
        
Definition at line 41 of file ut.h.
Referenced by OnTxt(), and OnTxtFmt().
{}

| static void TNotify::OnTxt | ( | const PNotify & | Notify, | 
| const TStr & | MsgStr | ||
| ) |  [inline, static] | 
        
| void TNotify::OnTxtFmt | ( | const char * | FmtStr, | 
| ... | |||
| ) | 
TCRef TNotify::CRef [private] | 
        
const PNotify TNotify::NullNotify = TNullNotify::New() [static] | 
        
const PNotify TNotify::StdErrNotify = TStdErrNotify::New() [static] | 
        
const PNotify TNotify::StdNotify = TStdNotify::New() [static] |