SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bd.h File Reference

Go to the source code of this file.

Classes

class  TPt< TRec >
 
class  TOnExeStop
 
struct  TStaticAssert< BoolVal >
 
struct  TStaticAssert< true >
 
struct  TStaticAssertTest< IntVal >
 
class  TEq< T >
 
class  TNEq< T >
 
class  TLss< T >
 
class  TLEq< T >
 
class  TGtr< T >
 
class  TGEq< T >
 
class  TCmp< T >
 
class  TCRef
 
class  TPt< TRec >
 
class  TSStr
 
class  TConv_Pt64Ints32
 
class  TPairHashImpl1
 Computes a hash code from a pair of hash codes. More...
 
class  TPairHashImpl2
 Computes a hash code from a pair of hash codes. More...
 

Macros

#define forever   for(;;)
 
#define TSizeMx   SIZE_MAX
 
#define ClassT(TNm)   class TNm{
 
#define ClassTV(TNm, TNmV)
 
#define ClassTVQ(TNm, TNmV, TNmQ)
 
#define ClassTP(TNm, PNm)
 
#define ClassHdTP(TNm, PNm)
 
#define ClassTPE(TNm, PNm, ENm)
 
#define ClassTPEE(TNm, PNm, ENm1, ENm2)
 
#define ClassTE(TNm, ENm)
 
#define ClassTPV(TNm, PNm, TNmV)
 
#define ClassHdTPV(TNm, PNm, TNmV)
 
#define ClassTPVL(TNm, PNm, TNmV, TNmL, TNmLN)
 
#define UndefDefaultCopyAssign(TNm)
 
#define UndefCopyAssign(TNm)
 
#define UndefCopy(TNm)
 
#define UndefAssign(TNm)
 
#define Fail   ExeStop(NULL, NULL, "Fail", __FILE__, __LINE__)
 
#define FailR(Reason)   ExeStop((Reason), NULL, "Fail", __FILE__, __LINE__)
 
#define FailRA(Reason, ArgStr)   ExeStop((TStr(Reason)+" ("+ArgStr+")").CStr(), NULL, "Fail", __FILE__, __LINE__)
 
#define EFail   TExcept::ThrowFull("", TStr("[")+ TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) + "]")
 
#define EFailR(Reason)   TExcept::ThrowFull(Reason, TStr("[")+TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)+"]")
 
#define Assert(Cond)   ((Cond) ? static_cast<void>(0) : ExeStop(NULL, NULL, #Cond, __FILE__, __LINE__))
 
#define AssertR(Cond, Reason)
 
#define IAssert(Cond)   ((Cond) ? static_cast<void>(0) : ExeStop(NULL, NULL, #Cond, __FILE__, __LINE__))
 
#define IAssertR(Cond, Reason)   ((Cond) ? static_cast<void>(0) : ExeStop(NULL, TStr(Reason).CStr(), #Cond, __FILE__, __LINE__))
 
#define WAssert(Cond, MsgCStr)   ((Cond) ? static_cast<void>(0) : WarnNotify(MsgCStr))
 
#define SAssert(Cond)   ((Cond) ? static_cast<void>(0) : ExeStop(TSysStr::GetLastMsgCStr(), NULL, #Cond, __FILE__, __LINE__))
 
#define FAssert(Cond, MsgCStr)   ((Cond) ? static_cast<void>(0) : ExeStop(TStr(MsgCStr).CStr(), NULL, NULL, __FILE__, __LINE__))
 
#define FSAssert(Cond)   ((Cond) ? static_cast<void>(0) : ExeStop(TSysStr::GetLastMsgCStr(), NULL, NULL, __FILE__, __LINE__))
 
#define EAssert(Cond)   ((Cond) ? static_cast<void>(0) : TExcept::ThrowFull(#Cond, TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) +": "+ TStr(#Cond)))
 
#define EAssertR(Cond, MsgStr)   ((Cond) ? static_cast<void>(0) : TExcept::ThrowFull(MsgStr, TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)+": "+TStr(#Cond)))
 
#define EAssertRA(Cond, MsgStr, ArgStr)   ((Cond) ? static_cast<void>(0) : TExcept::Throw(MsgStr, ArgStr))
 
#define EAssertRAA(Cond, MsgStr, ArgStr1, ArgStr2)   ((Cond) ? static_cast<void>(0) : TExcept::Throw(MsgStr, ArgStr1, ArgStr2))
 
#define ESAssert(Cond)
 
#define CAssert(Cond)   /* typedef TStaticAssertTest<sizeof(TStaticAssert<(Cond)==0?false:true>)> TestStaticAssert; */
 
#define XLoadHd(Nm)
 
#define XLoad(Nm)   Nm.LoadXml(XmlTok->GetTagTok(#Nm), #Nm);
 
#define XSaveHd(Nm)
 
#define XSaveHdArg(Nm, ArgNm, ArgVal)
 
#define XSaveBETag(Nm)
 
#define XSaveBETagArg(Nm, ArgNm, ArgVal)
 
#define XSaveBETagArg4(Nm, ArgNm1, ArgVal1, ArgNm2, ArgVal2, ArgNm3, ArgVal3, ArgNm4, ArgVal4)
 
#define XSave(Nm)   Nm.SaveXml(SOut, #Nm)
 
#define XSaveToFile(Nm, FNm)   {TFOut SOut(FNm); Nm.SaveXml(SOut, #Nm);}
 
#define MIN(a, b)   ((a)<(b)?(a):(b))
 
#define MAX(a, b)   ((a)>(b)?(a):(b))
 

Typedefs

typedef unsigned char uchar
 
typedef unsigned int uint
 
typedef unsigned long ulong
 
typedef unsigned short ushort
 
typedef float sdouble
 
typedef long double ldouble
 
typedef FILE * TFileId
 
typedef char int8
 
typedef short int16
 
typedef int int32
 
typedef long long int64
 
typedef unsigned char uint8
 
typedef unsigned short uint16
 
typedef unsigned int uint32
 
typedef unsigned long long uint64
 
typedef ptrdiff_t ssize_t
 
typedef size_t TSize
 
typedef TPt< TXmlTokPXmlTok
 
typedef TPt< TExceptPExcept
 
typedef TPt< TXmlDocPXmlDoc
 
typedef TPairHashImpl2 TPairHashImpl
 

Enumerations

enum  TLoc { lUndef, lUs, lSi }
 
enum  TLogOp { loUndef, loNot, loAnd, loOr }
 
enum  TRelOp {
  roUndef, roLs, roLEq, roEq,
  roNEq, roGEq, roGt
}
 

Functions

void WrNotify (const char *CaptionCStr, const char *NotifyCStr)
 
void SaveToErrLog (const char *MsgCStr)
 
void InfoNotify (const char *NotifyCStr)
 
void WarnNotify (const char *NotifyCStr)
 
void ErrNotify (const char *NotifyCStr)
 
void StatNotify (const char *NotifyCStr)
 
void ExeStop (const char *MsgStr, const char *ReasonStr, const char *CondStr, const char *FNm, const int &LnN)
 
template<class TRec >
bool IsXLoadFromFileOk (const TStr &FNm, const TStr &Nm, TRec &Rec, TStr &MsgStr)
 
template<class TRec >
void XLoadFromFile (const TStr &FNm, const TStr &Nm, TRec &Rec)
 
template<class TRec >
bool operator!= (const TRec &Rec1, const TRec &Rec2)
 
template<class TRec >
bool operator> (const TRec &Rec1, const TRec &Rec2)
 
template<class TRec >
bool operator<= (const TRec &Rec1, const TRec &Rec2)
 
template<class TRec >
bool operator>= (const TRec &Rec1, const TRec &Rec2)
 
template<class TRec >
bool Cmp (const int &RelOp, const TRec &Rec1, const TRec &Rec2)
 
template<class TRec >
void Swap (TRec &Rec1, TRec &Rec2)
 

Macro Definition Documentation

#define Assert (   Cond)    ((Cond) ? static_cast<void>(0) : ExeStop(NULL, NULL, #Cond, __FILE__, __LINE__))

Definition at line 251 of file bd.h.

#define AssertR (   Cond,
  Reason 
)
Value:
((Cond) ? static_cast<void>(0) : \
ExeStop(NULL, TStr(Reason).CStr(), #Cond, __FILE__, __LINE__))
void ExeStop(const char *MsgStr, const char *ReasonStr, const char *CondStr, const char *FNm, const int &LnN)
Definition: bd.cpp:88
Definition: dt.h:412

Definition at line 258 of file bd.h.

#define CAssert (   Cond)    /* typedef TStaticAssertTest<sizeof(TStaticAssert<(Cond)==0?false:true>)> TestStaticAssert; */

Definition at line 302 of file bd.h.

#define ClassHdTP (   TNm,
  PNm 
)
Value:
class TNm; \
typedef TPt<TNm> PNm;
Definition: bd.h:196

Definition at line 135 of file bd.h.

#define ClassHdTPV (   TNm,
  PNm,
  TNmV 
)
Value:
class TNm; \
typedef TPt<TNm> PNm; \
typedef TVec<PNm> TNmV;
Definition: bd.h:196
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:429

Definition at line 172 of file bd.h.

#define ClassT (   TNm)    class TNm{

Definition at line 112 of file bd.h.

#define ClassTE (   TNm,
  ENm 
)
Value:
class TNm; \
class TNm: public ENm{ \
public: \

Definition at line 157 of file bd.h.

#define ClassTP (   TNm,
  PNm 
)
Value:
class TNm; \
typedef TPt<TNm> PNm; \
class TNm{ \
private: \
TCRef CRef; \
public: \
friend class TPt<TNm>;
Definition: bd.h:196

Definition at line 126 of file bd.h.

#define ClassTPE (   TNm,
  PNm,
  ENm 
)
Value:
class TNm; \
typedef TPt<TNm> PNm; \
class TNm: public ENm{ \
private: \
TCRef CRef; \
public: \
friend class TPt<TNm>;
Definition: bd.h:196

Definition at line 139 of file bd.h.

#define ClassTPEE (   TNm,
  PNm,
  ENm1,
  ENm2 
)
Value:
class TNm; \
typedef TPt<TNm> PNm; \
class TNm: public ENm1, public ENm2{ \
private: \
TCRef CRef; \
public: \
friend class TPt<TNm>;
Definition: bd.h:196

Definition at line 148 of file bd.h.

#define ClassTPV (   TNm,
  PNm,
  TNmV 
)
Value:
class TNm; \
typedef TPt<TNm> PNm; \
typedef TVec<PNm> TNmV; \
class TNm{ \
private: \
TCRef CRef; \
public: \
friend class TPt<TNm>;
Definition: bd.h:196
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:429

Definition at line 162 of file bd.h.

#define ClassTPVL (   TNm,
  PNm,
  TNmV,
  TNmL,
  TNmLN 
)
Value:
class TNm; \
typedef TPt<TNm> PNm; \
typedef TVec<PNm> TNmV; \
typedef TLst<PNm> TNmL; \
typedef TLstNd<PNm>* TNmLN; \
class TNm{ \
private: \
TCRef CRef; \
public: \
friend class TPt<TNm>;
Definition: ds.h:2636
Definition: ds.h:2612
Definition: bd.h:196
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:429

Definition at line 177 of file bd.h.

#define ClassTV (   TNm,
  TNmV 
)
Value:
class TNm; \
typedef TVec<TNm> TNmV; \
class TNm{
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:429

Definition at line 115 of file bd.h.

#define ClassTVQ (   TNm,
  TNmV,
  TNmQ 
)
Value:
class TNm; \
typedef TVec<TNm> TNmV; \
typedef TQQueue<TNm> TNmQ; \
class TNm{
Definition: ds.h:2544
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:429

Definition at line 120 of file bd.h.

#define EAssert (   Cond)    ((Cond) ? static_cast<void>(0) : TExcept::ThrowFull(#Cond, TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) +": "+ TStr(#Cond)))

Definition at line 280 of file bd.h.

#define EAssertR (   Cond,
  MsgStr 
)    ((Cond) ? static_cast<void>(0) : TExcept::ThrowFull(MsgStr, TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)+": "+TStr(#Cond)))

Definition at line 283 of file bd.h.

#define EAssertRA (   Cond,
  MsgStr,
  ArgStr 
)    ((Cond) ? static_cast<void>(0) : TExcept::Throw(MsgStr, ArgStr))

Definition at line 286 of file bd.h.

#define EAssertRAA (   Cond,
  MsgStr,
  ArgStr1,
  ArgStr2 
)    ((Cond) ? static_cast<void>(0) : TExcept::Throw(MsgStr, ArgStr1, ArgStr2))

Definition at line 289 of file bd.h.

#define EFail   TExcept::ThrowFull("", TStr("[")+ TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) + "]")

Definition at line 244 of file bd.h.

#define EFailR (   Reason)    TExcept::ThrowFull(Reason, TStr("[")+TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)+"]")

Definition at line 246 of file bd.h.

#define ESAssert (   Cond)
Value:
((Cond) ? static_cast<void>(0) : TExcept::Throw(TSysStr::GetLastMsgCStr(), \
TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) +": "+ TStr(#Cond)))
TStr GetStr() const
Definition: dt.h:1107
static void Throw(const TStr &MsgStr)
Definition: ut.h:187
Definition: dt.h:412

Definition at line 292 of file bd.h.

#define Fail   ExeStop(NULL, NULL, "Fail", __FILE__, __LINE__)

Definition at line 238 of file bd.h.

#define FailR (   Reason)    ExeStop((Reason), NULL, "Fail", __FILE__, __LINE__)

Definition at line 240 of file bd.h.

#define FailRA (   Reason,
  ArgStr 
)    ExeStop((TStr(Reason)+" ("+ArgStr+")").CStr(), NULL, "Fail", __FILE__, __LINE__)

Definition at line 241 of file bd.h.

#define FAssert (   Cond,
  MsgCStr 
)    ((Cond) ? static_cast<void>(0) : ExeStop(TStr(MsgCStr).CStr(), NULL, NULL, __FILE__, __LINE__))

Definition at line 274 of file bd.h.

#define forever   for(;;)

Definition at line 6 of file bd.h.

#define FSAssert (   Cond)    ((Cond) ? static_cast<void>(0) : ExeStop(TSysStr::GetLastMsgCStr(), NULL, NULL, __FILE__, __LINE__))

Definition at line 277 of file bd.h.

#define IAssert (   Cond)    ((Cond) ? static_cast<void>(0) : ExeStop(NULL, NULL, #Cond, __FILE__, __LINE__))

Definition at line 262 of file bd.h.

#define IAssertR (   Cond,
  Reason 
)    ((Cond) ? static_cast<void>(0) : ExeStop(NULL, TStr(Reason).CStr(), #Cond, __FILE__, __LINE__))

Definition at line 265 of file bd.h.

#define MAX (   a,
 
)    ((a)>(b)?(a):(b))

Definition at line 350 of file bd.h.

#define MIN (   a,
 
)    ((a)<(b)?(a):(b))

Definition at line 346 of file bd.h.

#define SAssert (   Cond)    ((Cond) ? static_cast<void>(0) : ExeStop(TSysStr::GetLastMsgCStr(), NULL, #Cond, __FILE__, __LINE__))

Definition at line 271 of file bd.h.

#define TSizeMx   SIZE_MAX

Definition at line 59 of file bd.h.

#define UndefAssign (   TNm)
Value:
private: \
TNm& operator=(const TNm&)

Definition at line 218 of file bd.h.

#define UndefCopy (   TNm)
Value:
private: \
TNm(const TNm&)

Definition at line 214 of file bd.h.

#define UndefCopyAssign (   TNm)
Value:
private: \
TNm(const TNm&); \
TNm& operator=(const TNm&)

Definition at line 209 of file bd.h.

#define UndefDefaultCopyAssign (   TNm)
Value:
private: \
TNm(){} \
TNm(const TNm&); \
TNm& operator=(const TNm&)

Definition at line 203 of file bd.h.

#define WAssert (   Cond,
  MsgCStr 
)    ((Cond) ? static_cast<void>(0) : WarnNotify(MsgCStr))

Definition at line 268 of file bd.h.

#define XLoad (   Nm)    Nm.LoadXml(XmlTok->GetTagTok(#Nm), #Nm);

Definition at line 315 of file bd.h.

#define XLoadHd (   Nm)
Value:
{TStr TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
TXmlObjSer::AssertXmlHd(XmlTok, Nm, TypeNm);}
static TStr GetTagNm(const TStr &TypeNm)
Definition: xml.cpp:5
Definition: dt.h:412
static void AssertXmlHd(const PXmlTok &XmlTok, const TStr &Nm, const TStr &TypeNm)
Definition: xml.cpp:22

Definition at line 312 of file bd.h.

#define XSave (   Nm)    Nm.SaveXml(SOut, #Nm)

Definition at line 333 of file bd.h.

#define XSaveBETag (   Nm)
Value:
TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
TXmlObjSerTagNm XmlObjSerTagNm(SOut, true, Nm, _TypeNm);
static TStr GetTagNm(const TStr &TypeNm)
Definition: xml.cpp:5
Definition: dt.h:412

Definition at line 324 of file bd.h.

#define XSaveBETagArg (   Nm,
  ArgNm,
  ArgVal 
)
Value:
TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
TXmlObjSerTagNm XmlObjSerTagNm(SOut, true, Nm, _TypeNm, ArgNm, ArgVal);
static TStr GetTagNm(const TStr &TypeNm)
Definition: xml.cpp:5
Definition: dt.h:412

Definition at line 327 of file bd.h.

#define XSaveBETagArg4 (   Nm,
  ArgNm1,
  ArgVal1,
  ArgNm2,
  ArgVal2,
  ArgNm3,
  ArgVal3,
  ArgNm4,
  ArgVal4 
)
Value:
TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
TXmlObjSerTagNm XmlObjSerTagNm(SOut, true, Nm, _TypeNm, ArgNm1, ArgVal1, ArgNm2, ArgVal2, ArgNm3, ArgVal3, ArgNm4, ArgVal4);
static TStr GetTagNm(const TStr &TypeNm)
Definition: xml.cpp:5
Definition: dt.h:412

Definition at line 330 of file bd.h.

#define XSaveHd (   Nm)
Value:
TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
TXmlObjSerTagNm XmlObjSerTagNm(SOut, false, Nm, _TypeNm);
static TStr GetTagNm(const TStr &TypeNm)
Definition: xml.cpp:5
Definition: dt.h:412

Definition at line 318 of file bd.h.

#define XSaveHdArg (   Nm,
  ArgNm,
  ArgVal 
)
Value:
TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
TXmlObjSerTagNm XmlObjSerTagNm(SOut, false, Nm, _TypeNm, ArgNm, ArgVal);
static TStr GetTagNm(const TStr &TypeNm)
Definition: xml.cpp:5
Definition: dt.h:412

Definition at line 321 of file bd.h.

#define XSaveToFile (   Nm,
  FNm 
)    {TFOut SOut(FNm); Nm.SaveXml(SOut, #Nm);}

Definition at line 335 of file bd.h.

Typedef Documentation

typedef short int16

Definition at line 20 of file bd.h.

typedef int int32

Definition at line 21 of file bd.h.

typedef long long int64

Definition at line 27 of file bd.h.

typedef char int8

Definition at line 19 of file bd.h.

typedef long double ldouble

Definition at line 16 of file bd.h.

typedef TPt< TExcept > PExcept

Definition at line 198 of file bd.h.

typedef TPt< TXmlDoc > PXmlDoc

Definition at line 199 of file bd.h.

typedef TPt< TXmlTok > PXmlTok

Definition at line 197 of file bd.h.

typedef float sdouble

Definition at line 15 of file bd.h.

typedef ptrdiff_t ssize_t

Definition at line 42 of file bd.h.

typedef FILE* TFileId

Definition at line 17 of file bd.h.

Definition at line 605 of file bd.h.

typedef size_t TSize

Definition at line 58 of file bd.h.

typedef unsigned char uchar

Definition at line 10 of file bd.h.

typedef unsigned int uint

Definition at line 11 of file bd.h.

typedef unsigned short uint16

Definition at line 31 of file bd.h.

typedef unsigned int uint32

Definition at line 32 of file bd.h.

typedef unsigned long long uint64

Definition at line 38 of file bd.h.

typedef unsigned char uint8

Definition at line 30 of file bd.h.

typedef unsigned long ulong

Definition at line 12 of file bd.h.

typedef unsigned short ushort

Definition at line 13 of file bd.h.

Enumeration Type Documentation

enum TLoc
Enumerator
lUndef 
lUs 
lSi 

Definition at line 63 of file bd.h.

63 {lUndef, lUs, lSi} TLoc;
Definition: bd.h:63
TLoc
Definition: bd.h:63
Definition: bd.h:63
Definition: bd.h:63
enum TLogOp
Enumerator
loUndef 
loNot 
loAnd 
loOr 

Definition at line 340 of file bd.h.

Definition: bd.h:340
Definition: bd.h:340
Definition: bd.h:340
TLogOp
Definition: bd.h:340
Definition: bd.h:340
enum TRelOp
Enumerator
roUndef 
roLs 
roLEq 
roEq 
roNEq 
roGEq 
roGt 

Definition at line 341 of file bd.h.

Definition: bd.h:341
TRelOp
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341

Function Documentation

template<class TRec >
bool Cmp ( const int &  RelOp,
const TRec &  Rec1,
const TRec &  Rec2 
)

Definition at line 426 of file bd.h.

426  {
427  switch (RelOp){
428  case roLs: return Rec1<Rec2;
429  case roLEq: return Rec1<=Rec2;
430  case roEq: return Rec1==Rec2;
431  case roNEq: return Rec1!=Rec2;
432  case roGEq: return Rec1>=Rec2;
433  case roGt: return Rec1>Rec2;
434  default: Fail; return false;
435  }
436 }
Definition: bd.h:341
#define Fail
Definition: bd.h:238
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
Definition: bd.h:341
void ErrNotify ( const char *  NotifyCStr)
inline

Definition at line 74 of file bd.h.

74  {
75  WrNotify("Error", NotifyCStr);}
void WrNotify(const char *CaptionCStr, const char *NotifyCStr)
Definition: bd.cpp:41
void ExeStop ( const char *  MsgStr,
const char *  ReasonStr,
const char *  CondStr,
const char *  FNm,
const int &  LnN 
)

Definition at line 88 of file bd.cpp.

90  {
91  char ReasonMsgCStr[1000];
92 
93 #if SW_TRACE
94  PrintBacktrace();
95  Crash();
96 #endif
97 
98  // construct reason message
99  if (ReasonCStr==NULL){ReasonMsgCStr[0]=0;}
100  else {sprintf(ReasonMsgCStr, " [Reason:'%s']", ReasonCStr);}
101  // construct full message
102  char FullMsgCStr[1000];
103  if (MsgCStr==NULL){
104  if (CondCStr==NULL){
105  sprintf(FullMsgCStr, "Execution stopped%s!", ReasonMsgCStr);
106  } else {
107  sprintf(FullMsgCStr, "Execution stopped: %s%s, file %s, line %d",
108  CondCStr, ReasonMsgCStr, FNm, LnN);
109  }
110  } else {
111  if (CondCStr==NULL){
112  sprintf(FullMsgCStr, "%s\nExecution stopped!", MsgCStr);
113  } else {
114  sprintf(FullMsgCStr, "Message: %s%s\nExecution stopped: %s, file %s, line %d",
115  MsgCStr, ReasonMsgCStr, CondCStr, FNm, LnN);
116  }
117  }
118  // report full message to log file
119  SaveToErrLog(FullMsgCStr);
120 
121 #if defined(SW_NOABORT)
122  TExcept::Throw(FullMsgCStr);
123 #endif
124 
125  // report to screen & stop execution
126  bool Continue=false;
127  // call handler
129  Continue=!((*TOnExeStop::GetOnExeStopF())(FullMsgCStr));}
130  if (!Continue){
131  ErrNotify(FullMsgCStr);
132 #ifdef GLib_WIN32
133  abort();
134  //ExitProcess(1);
135 #else
136  exit(1);
137 #endif
138  }
139 }
void ErrNotify(const char *NotifyCStr)
Definition: bd.h:74
static void Throw(const TStr &MsgStr)
Definition: ut.h:187
void SaveToErrLog(const char *MsgCStr)
Definition: bd.cpp:49
static bool IsOnExeStopF()
Definition: bd.h:229
static TOnExeStopF GetOnExeStopF()
Definition: bd.h:231
void InfoNotify ( const char *  NotifyCStr)
inline

Definition at line 70 of file bd.h.

70  {
71  WrNotify("Information", NotifyCStr);}
void WrNotify(const char *CaptionCStr, const char *NotifyCStr)
Definition: bd.cpp:41
template<class TRec >
bool IsXLoadFromFileOk ( const TStr FNm,
const TStr Nm,
TRec &  Rec,
TStr MsgStr 
)

Definition at line 45 of file xmlser.h.

45  {
46  bool Ok=true;
47  try {
48  PXmlDoc XmlDoc=TXmlDoc::LoadTxt(FNm);
49  if (XmlDoc->IsOk()){
50  PXmlTok XmlTok=XmlDoc->GetTok();
51  Rec.LoadXml(XmlTok, Nm);
52  } else {
53  Ok=false; MsgStr=XmlDoc->GetMsgStr();
54  }
55  }
56  catch (PExcept Except){
57  Ok=false; MsgStr=Except->GetMsgStr();
58  }
59  return Ok;
60 }
static PXmlDoc LoadTxt(TXmlLx &Lx)
Definition: xml.cpp:1401
Definition: bd.h:196
void LoadXml(const TPt< TXmlTok > &XmlTok, const TStr &Nm)
Definition: xmlser.h:21
template<class TRec >
bool operator!= ( const TRec &  Rec1,
const TRec &  Rec2 
)

Definition at line 414 of file bd.h.

414 {return !(Rec1==Rec2);}
template<class TRec >
bool operator<= ( const TRec &  Rec1,
const TRec &  Rec2 
)

Definition at line 420 of file bd.h.

420 {return !(Rec2<Rec1);}
template<class TRec >
bool operator> ( const TRec &  Rec1,
const TRec &  Rec2 
)

Definition at line 417 of file bd.h.

417 {return Rec2<Rec1;}
template<class TRec >
bool operator>= ( const TRec &  Rec1,
const TRec &  Rec2 
)

Definition at line 423 of file bd.h.

423 {return !(Rec1<Rec2);}
void SaveToErrLog ( const char *  MsgCStr)

Definition at line 49 of file bd.cpp.

49  {
50  int MxFNmLen=1000;
51  char* FNm=new char[MxFNmLen]; if (FNm==NULL){return;}
52  int FNmLen=GetModuleFileName(NULL, FNm, MxFNmLen); if (FNmLen==0){return;}
53  FNm[FNmLen++]='.'; FNm[FNmLen++]='E'; FNm[FNmLen++]='r'; FNm[FNmLen++]='r';
54  FNm[FNmLen++]=char(0);
55  time_t Time=time(NULL);
56  FILE* fOut=fopen(FNm, "a+b"); if (fOut==NULL){return;}
57  fprintf(fOut, "--------\r\n%s\r\n%s%s\r\n--------\r\n",
58  FNm, ctime(&Time), MsgCStr);
59  fclose(fOut);
60  delete[] FNm;
61 }
void StatNotify ( const char *  NotifyCStr)
inline

Definition at line 76 of file bd.h.

76  {
77  WrNotify("Status", NotifyCStr);}
void WrNotify(const char *CaptionCStr, const char *NotifyCStr)
Definition: bd.cpp:41
template<class TRec >
void Swap ( TRec &  Rec1,
TRec &  Rec2 
)

Definition at line 568 of file bd.h.

568  {
569  TRec Rec=Rec1; Rec1=Rec2; Rec2=Rec;
570 }
void WarnNotify ( const char *  NotifyCStr)
inline

Definition at line 72 of file bd.h.

72  {
73  WrNotify("Warning", NotifyCStr);}
void WrNotify(const char *CaptionCStr, const char *NotifyCStr)
Definition: bd.cpp:41
void WrNotify ( const char *  CaptionCStr,
const char *  NotifyCStr 
)

Definition at line 41 of file bd.cpp.

41  {
42 #if defined(__CONSOLE__) || defined(_CONSOLE)
43  printf("*** %s: %s\n", CaptionCStr, NotifyCStr);
44 #else
45  MessageBox(NULL, NotifyCStr, CaptionCStr, MB_OK);
46 #endif
47 }
template<class TRec >
void XLoadFromFile ( const TStr FNm,
const TStr Nm,
TRec &  Rec 
)

Definition at line 63 of file xmlser.h.

63  {
64  TStr MsgStr;
65  if (!IsXLoadFromFileOk(FNm, Nm, Rec, MsgStr)){
66  TExcept::Throw(MsgStr);
67  }
68 }
static void Throw(const TStr &MsgStr)
Definition: ut.h:187
Definition: dt.h:412
bool IsXLoadFromFileOk(const TStr &FNm, const TStr &Nm, TRec &Rec, TStr &MsgStr)
Definition: xmlser.h:45