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
TExcept Class Reference

#include <ut.h>

Inherited by TNSException.

Public Types

typedef void(* TOnExceptF) (const TStr &MsgStr)
 

Public Member Functions

 TExcept (const TStr &_MsgStr)
 
 TExcept (const TStr &_MsgStr, const TStr &_LocStr)
 
virtual ~TExcept ()
 
TStr GetMsgStr () const
 
TStr GetLocStr () const
 
TStr GetStr () const
 

Static Public Member Functions

static PExcept New (const TStr &MsgStr, const TStr &LocStr=TStr())
 
static bool IsOnExceptF ()
 
static void PutOnExceptF (TOnExceptF _OnExceptF)
 
static TOnExceptF GetOnExceptF ()
 
static void Throw (const TStr &MsgStr)
 
static void Throw (const TStr &MsgStr, const TStr &ArgStr)
 
static void Throw (const TStr &MsgStr, const TStr &ArgStr1, const TStr &ArgStr2)
 
static void ThrowFull (const TStr &MsgStr, const TStr &LocStr)
 

Static Public Attributes

static TOnExceptF OnExceptF =NULL
 

Private Member Functions

 UndefDefaultCopyAssign (TExcept)
 

Private Attributes

TCRef CRef
 
TStr MsgStr
 
TStr LocStr
 

Friends

class TPt< TExcept >
 

Detailed Description

Definition at line 161 of file ut.h.

Member Typedef Documentation

typedef void(* TExcept::TOnExceptF) (const TStr &MsgStr)

Definition at line 180 of file ut.h.

Constructor & Destructor Documentation

TExcept::TExcept ( const TStr _MsgStr)
inline

Definition at line 167 of file ut.h.

167 : MsgStr(_MsgStr), LocStr(){}
TStr MsgStr
Definition: ut.h:163
TStr LocStr
Definition: ut.h:164
TExcept::TExcept ( const TStr _MsgStr,
const TStr _LocStr 
)
inline

Definition at line 168 of file ut.h.

168 : MsgStr(_MsgStr), LocStr(_LocStr){}
TStr MsgStr
Definition: ut.h:163
TStr LocStr
Definition: ut.h:164
virtual TExcept::~TExcept ( )
inlinevirtual

Definition at line 171 of file ut.h.

171 {}

Member Function Documentation

TStr TExcept::GetLocStr ( ) const
inline

Definition at line 174 of file ut.h.

174 {return LocStr;}
TStr LocStr
Definition: ut.h:164
TStr TExcept::GetMsgStr ( ) const
inline

Definition at line 173 of file ut.h.

173 {return MsgStr;}
TStr MsgStr
Definition: ut.h:163
static TOnExceptF TExcept::GetOnExceptF ( )
inlinestatic

Definition at line 184 of file ut.h.

184 {return OnExceptF;}
static TOnExceptF OnExceptF
Definition: ut.h:181
TStr TExcept::GetStr ( ) const
inline

Definition at line 175 of file ut.h.

175  {
176  if (LocStr.Empty()){return GetMsgStr();}
177  else {return GetLocStr()+": "+GetMsgStr();}}
TStr GetLocStr() const
Definition: ut.h:174
TStr LocStr
Definition: ut.h:164
TStr GetMsgStr() const
Definition: ut.h:173
bool Empty() const
Definition: dt.h:491
static bool TExcept::IsOnExceptF ( )
inlinestatic

Definition at line 182 of file ut.h.

182 {return OnExceptF!=NULL;}
static TOnExceptF OnExceptF
Definition: ut.h:181
static PExcept TExcept::New ( const TStr MsgStr,
const TStr LocStr = TStr() 
)
inlinestatic

Definition at line 169 of file ut.h.

169  {
170  return PExcept(new TExcept(MsgStr, LocStr)); }
TExcept(const TStr &_MsgStr)
Definition: ut.h:167
TPt< TExcept > PExcept
Definition: ut.h:161
static void TExcept::PutOnExceptF ( TOnExceptF  _OnExceptF)
inlinestatic

Definition at line 183 of file ut.h.

183 {OnExceptF=_OnExceptF;}
static TOnExceptF OnExceptF
Definition: ut.h:181
static void TExcept::Throw ( const TStr MsgStr)
inlinestatic

Definition at line 187 of file ut.h.

187  {
188  if (IsOnExceptF()){(*OnExceptF)(MsgStr);}
189  else {throw TExcept::New(MsgStr);}}
static PExcept New(const TStr &MsgStr, const TStr &LocStr=TStr())
Definition: ut.h:169
TStr MsgStr
Definition: ut.h:163
static bool IsOnExceptF()
Definition: ut.h:182
static void TExcept::Throw ( const TStr MsgStr,
const TStr ArgStr 
)
inlinestatic

Definition at line 190 of file ut.h.

190  {
191  TStr FullMsgStr=MsgStr+" ("+ArgStr+")";
192  if (IsOnExceptF()){(*OnExceptF)(FullMsgStr);}
193  else {throw TExcept::New(FullMsgStr);}}
static PExcept New(const TStr &MsgStr, const TStr &LocStr=TStr())
Definition: ut.h:169
static bool IsOnExceptF()
Definition: ut.h:182
Definition: dt.h:412
static void TExcept::Throw ( const TStr MsgStr,
const TStr ArgStr1,
const TStr ArgStr2 
)
inlinestatic

Definition at line 194 of file ut.h.

194  {
195  TStr FullMsgStr=MsgStr+" ("+ArgStr1+", "+ArgStr2+")";
196  if (IsOnExceptF()){(*OnExceptF)(FullMsgStr);}
197  else {throw TExcept::New(FullMsgStr);}}
static PExcept New(const TStr &MsgStr, const TStr &LocStr=TStr())
Definition: ut.h:169
static bool IsOnExceptF()
Definition: ut.h:182
Definition: dt.h:412
static void TExcept::ThrowFull ( const TStr MsgStr,
const TStr LocStr 
)
inlinestatic

Definition at line 198 of file ut.h.

198  {
199  if (IsOnExceptF()){(*OnExceptF)(MsgStr);}
200  else {throw TExcept::New(MsgStr, LocStr);}}
static PExcept New(const TStr &MsgStr, const TStr &LocStr=TStr())
Definition: ut.h:169
TStr MsgStr
Definition: ut.h:163
static bool IsOnExceptF()
Definition: ut.h:182
TExcept::UndefDefaultCopyAssign ( TExcept  )
private

Friends And Related Function Documentation

friend class TPt< TExcept >
friend

Definition at line 161 of file ut.h.

Member Data Documentation

TCRef TExcept::CRef
private

Definition at line 161 of file ut.h.

TStr TExcept::LocStr
private

Definition at line 164 of file ut.h.

TStr TExcept::MsgStr
private

Definition at line 163 of file ut.h.

TExcept::TOnExceptF TExcept::OnExceptF =NULL
static

Definition at line 181 of file ut.h.


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