SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
bd.h
Go to the documentation of this file.
1 #ifndef bd_h
2 #define bd_h
3 
5 // Basic-Macro-Definitions
6 #define forever for(;;)
7 
9 // Basic-Type-Definitions
10 typedef unsigned char uchar;
11 typedef unsigned int uint;
12 typedef unsigned long ulong;
13 typedef unsigned short ushort;
14 
15 typedef float sdouble;
16 typedef long double ldouble;
17 typedef FILE* TFileId;
18 
19 typedef char int8;
20 typedef short int16;
21 typedef int int32;
22 #ifdef GLib_WIN32
23 typedef __int64 int64;
24 #elif defined(GLib_GLIBC)
25 typedef int64_t int64;
26 #else
27 typedef long long int64;
28 #endif
29 
30 typedef unsigned char uint8;
31 typedef unsigned short uint16;
32 typedef unsigned int uint32;
33 #ifdef GLib_WIN32
34 typedef unsigned __int64 uint64;
35 #elif defined(GLib_GLIBC)
36 typedef u_int64_t uint64;
37 #else
38 typedef unsigned long long uint64;
39 #endif
40 
41 #if (!defined(__ssize_t_defined) && !defined(GLib_MACOSX))
42 typedef ptrdiff_t ssize_t;
43 #endif
44 
45 #if defined(GLib_UNIX)
46 #define _isnan(x) isnan(x)
47 #if defined(GLib_MACOSX)
48  #define _finite(x) isfinite(x)
49 #else
50  #define _finite(x) finite(x)
51 #endif
52 #endif
53 
54 #if defined(GLib_WIN32)
55 #define _vsnprintf vsnprintf
56 #endif
57 
58 typedef size_t TSize;
59 #define TSizeMx SIZE_MAX
60 
62 // Localization
63 typedef enum {lUndef, lUs, lSi} TLoc;
64 
66 // Messages
67 void WrNotify(const char* CaptionCStr, const char* NotifyCStr);
68 void SaveToErrLog(const char* MsgCStr);
69 
70 inline void InfoNotify(const char* NotifyCStr){
71  WrNotify("Information", NotifyCStr);}
72 inline void WarnNotify(const char* NotifyCStr){
73  WrNotify("Warning", NotifyCStr);}
74 inline void ErrNotify(const char* NotifyCStr){
75  WrNotify("Error", NotifyCStr);}
76 inline void StatNotify(const char* NotifyCStr){
77  WrNotify("Status", NotifyCStr);}
78 
80 // Compiler-Options
81 #if defined (GLib_WIN)
82  #define snprintf _snprintf
83  #define vsnprintf _vsnprintf
84  // disable warning 'debug symbol greater than 255 chars'
85  #pragma warning(disable: 4786)
86  // disable warning 'return type for 'identifier::operator->'
87  // is not a UDT or reference to a UDT.
88  //#pragma warning(disable: 4284)
89  // 'declaration' : function differs from 'declaration'
90  // only by calling convention
91  //#pragma warning(disable: 4666)
92  #pragma warning(disable: 4996)
93 #endif
94 
95 #if defined (GLib_GCC)
96  #define _CONSOLE
97 #endif
98 
99 // use console output if console already exists, otherwise
100 // define GLib_COUT to use console (class COut)
101 #if defined(_CONSOLE)||defined(__CONSOLE__)
102  #define GLib_Console
103 #endif
104 
105 // create console if want to output but there is no console allocated
106 #if defined(GLib_Console) && (! (defined(__CONSOLE__)||defined(_CONSOLE)))
107  #define GLib_CreateConsole
108 #endif
109 
111 // Class-Definition
112 #define ClassT(TNm) \
113 class TNm{
114 
115 #define ClassTV(TNm, TNmV) \
116 class TNm; \
117 typedef TVec<TNm> TNmV; \
118 class TNm{
119 
120 #define ClassTVQ(TNm, TNmV, TNmQ) \
121 class TNm; \
122 typedef TVec<TNm> TNmV; \
123 typedef TQQueue<TNm> TNmQ; \
124 class TNm{
125 
126 #define ClassTP(TNm, PNm) \
127 class TNm; \
128 typedef TPt<TNm> PNm; \
129 class TNm{ \
130 private: \
131  TCRef CRef; \
132 public: \
133  friend class TPt<TNm>;
134 
135 #define ClassHdTP(TNm, PNm) \
136 class TNm; \
137 typedef TPt<TNm> PNm;
138 
139 #define ClassTPE(TNm, PNm, ENm) \
140 class TNm; \
141 typedef TPt<TNm> PNm; \
142 class TNm: public ENm{ \
143 private: \
144  TCRef CRef; \
145 public: \
146  friend class TPt<TNm>;
147 
148 #define ClassTPEE(TNm, PNm, ENm1, ENm2) \
149 class TNm; \
150 typedef TPt<TNm> PNm; \
151 class TNm: public ENm1, public ENm2{ \
152 private: \
153  TCRef CRef; \
154 public: \
155  friend class TPt<TNm>;
156 
157 #define ClassTE(TNm, ENm) \
158 class TNm; \
159 class TNm: public ENm{ \
160 public: \
161 
162 #define ClassTPV(TNm, PNm, TNmV) \
163 class TNm; \
164 typedef TPt<TNm> PNm; \
165 typedef TVec<PNm> TNmV; \
166 class TNm{ \
167 private: \
168  TCRef CRef; \
169 public: \
170  friend class TPt<TNm>;
171 
172 #define ClassHdTPV(TNm, PNm, TNmV) \
173 class TNm; \
174 typedef TPt<TNm> PNm; \
175 typedef TVec<PNm> TNmV;
176 
177 #define ClassTPVL(TNm, PNm, TNmV, TNmL, TNmLN) \
178 class TNm; \
179 typedef TPt<TNm> PNm; \
180 typedef TVec<PNm> TNmV; \
181 typedef TLst<PNm> TNmL; \
182 typedef TLstNd<PNm>* TNmLN; \
183 class TNm{ \
184 private: \
185  TCRef CRef; \
186 public: \
187  friend class TPt<TNm>;
188 
190 // Forward-Definitions
191 class TSIn;
192 class TSOut;
193 class TStr;
194 class TXmlObjSer;
195 class TXmlObjSerTagNm;
196 template <class TRec> class TPt;
200 
202 // DefaultConstructor/CopyConstructor/AssignmentOperator-UnDefinition
203 #define UndefDefaultCopyAssign(TNm) \
204 private: \
205  TNm(){} \
206  TNm(const TNm&); \
207  TNm& operator=(const TNm&)
208 
209 #define UndefCopyAssign(TNm) \
210 private: \
211  TNm(const TNm&); \
212  TNm& operator=(const TNm&)
213 
214 #define UndefCopy(TNm) \
215 private: \
216  TNm(const TNm&)
217 
218 #define UndefAssign(TNm) \
219 private: \
220  TNm& operator=(const TNm&)
221 
223 // Assertions
225 private:
226  typedef bool (*TOnExeStopF)(char* MsgCStr);
228 public:
229  static bool IsOnExeStopF(){return OnExeStopF!=NULL;}
230  static void PutOnExeStopF(TOnExeStopF _OnExeStopF){OnExeStopF=_OnExeStopF;}
232 };
233 
234 void ExeStop(
235  const char* MsgStr, const char* ReasonStr,
236  const char* CondStr, const char* FNm, const int& LnN);
237 
238 #define Fail ExeStop(NULL, NULL, "Fail", __FILE__, __LINE__)
239 
240 #define FailR(Reason) ExeStop((Reason), NULL, "Fail", __FILE__, __LINE__)
241 #define FailRA(Reason, ArgStr) \
242  ExeStop((TStr(Reason)+" ("+ArgStr+")").CStr(), NULL, "Fail", __FILE__, __LINE__)
243 
244 #define EFail TExcept::ThrowFull("", TStr("[")+ TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) + "]")
245 
246 #define EFailR(Reason) TExcept::ThrowFull(Reason, TStr("[")+TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)+"]")
247 
248 #ifdef NDEBUG
249 #define Assert(Cond)
250 #else
251 #define Assert(Cond) \
252  ((Cond) ? static_cast<void>(0) : ExeStop(NULL, NULL, #Cond, __FILE__, __LINE__))
253 #endif
254 
255 #ifdef NDEBUG
256 #define AssertR(Cond, Reason)
257 #else
258 #define AssertR(Cond, Reason) ((Cond) ? static_cast<void>(0) : \
259  ExeStop(NULL, TStr(Reason).CStr(), #Cond, __FILE__, __LINE__))
260 #endif
261 
262 #define IAssert(Cond) \
263  ((Cond) ? static_cast<void>(0) : ExeStop(NULL, NULL, #Cond, __FILE__, __LINE__))
264 
265 #define IAssertR(Cond, Reason) \
266  ((Cond) ? static_cast<void>(0) : ExeStop(NULL, TStr(Reason).CStr(), #Cond, __FILE__, __LINE__))
267 
268 #define WAssert(Cond, MsgCStr) \
269  ((Cond) ? static_cast<void>(0) : WarnNotify(MsgCStr))
270 
271 #define SAssert(Cond) \
272  ((Cond) ? static_cast<void>(0) : ExeStop(TSysStr::GetLastMsgCStr(), NULL, #Cond, __FILE__, __LINE__))
273 
274 #define FAssert(Cond, MsgCStr) \
275  ((Cond) ? static_cast<void>(0) : ExeStop(TStr(MsgCStr).CStr(), NULL, NULL, __FILE__, __LINE__))
276 
277 #define FSAssert(Cond) \
278  ((Cond) ? static_cast<void>(0) : ExeStop(TSysStr::GetLastMsgCStr(), NULL, NULL, __FILE__, __LINE__))
279 
280 #define EAssert(Cond) \
281  ((Cond) ? static_cast<void>(0) : TExcept::ThrowFull(#Cond, TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) +": "+ TStr(#Cond)))
282 
283 #define EAssertR(Cond, MsgStr) \
284  ((Cond) ? static_cast<void>(0) : TExcept::ThrowFull(MsgStr, TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)+": "+TStr(#Cond)))
285 
286 #define EAssertRA(Cond, MsgStr, ArgStr) \
287  ((Cond) ? static_cast<void>(0) : TExcept::Throw(MsgStr, ArgStr))
288 
289 #define EAssertRAA(Cond, MsgStr, ArgStr1, ArgStr2) \
290  ((Cond) ? static_cast<void>(0) : TExcept::Throw(MsgStr, ArgStr1, ArgStr2))
291 
292 #define ESAssert(Cond) \
293  ((Cond) ? static_cast<void>(0) : TExcept::Throw(TSysStr::GetLastMsgCStr(), \
294  TStr(__FILE__) + " line " + TInt::GetStr(__LINE__) +": "+ TStr(#Cond)))
295 
296 // compile time assert
297 // #define STATIC_ASSERT(x) { const char temp[ (((x) == 0) ? 0 : 1) ] = {'\0'}; }
298 template <bool BoolVal> struct TStaticAssert;
299 template <> struct TStaticAssert<true> { enum { value = 1 }; };
300 template<int IntVal> struct TStaticAssertTest{};
301 
302 #define CAssert(Cond) \
303  /* typedef TStaticAssertTest<sizeof(TStaticAssert<(Cond)==0?false:true>)> TestStaticAssert; */
304 
306 // Xml-Object-Serialization
307 template <class TRec>
308 bool IsXLoadFromFileOk(const TStr& FNm, const TStr& Nm, TRec& Rec, TStr& MsgStr);
309 template <class TRec>
310 void XLoadFromFile(const TStr& FNm, const TStr& Nm, TRec& Rec);
311 
312 #define XLoadHd(Nm) \
313  {TStr TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
314  TXmlObjSer::AssertXmlHd(XmlTok, Nm, TypeNm);}
315 #define XLoad(Nm) \
316  Nm.LoadXml(XmlTok->GetTagTok(#Nm), #Nm);
317 
318 #define XSaveHd(Nm) \
319  TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
320  TXmlObjSerTagNm XmlObjSerTagNm(SOut, false, Nm, _TypeNm);
321 #define XSaveHdArg(Nm, ArgNm, ArgVal) \
322  TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
323  TXmlObjSerTagNm XmlObjSerTagNm(SOut, false, Nm, _TypeNm, ArgNm, ArgVal);
324 #define XSaveBETag(Nm) \
325  TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
326  TXmlObjSerTagNm XmlObjSerTagNm(SOut, true, Nm, _TypeNm);
327 #define XSaveBETagArg(Nm, ArgNm, ArgVal) \
328  TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
329  TXmlObjSerTagNm XmlObjSerTagNm(SOut, true, Nm, _TypeNm, ArgNm, ArgVal);
330 #define XSaveBETagArg4(Nm, ArgNm1, ArgVal1, ArgNm2, ArgVal2, ArgNm3, ArgVal3, ArgNm4, ArgVal4) \
331  TStr _TypeNm=TXmlObjSer::GetTagNm(TStr(typeid(*this).name())); \
332  TXmlObjSerTagNm XmlObjSerTagNm(SOut, true, Nm, _TypeNm, ArgNm1, ArgVal1, ArgNm2, ArgVal2, ArgNm3, ArgVal3, ArgNm4, ArgVal4);
333 #define XSave(Nm) \
334  Nm.SaveXml(SOut, #Nm)
335 #define XSaveToFile(Nm, FNm) \
336  {TFOut SOut(FNm); Nm.SaveXml(SOut, #Nm);}
337 
339 // Basic-Operators
340 typedef enum {loUndef, loNot, loAnd, loOr} TLogOp;
341 typedef enum {roUndef, roLs, roLEq, roEq, roNEq, roGEq, roGt} TRelOp;
342 
344 // Comparation-Macros
345 #ifndef MIN
346  #define MIN(a,b) ((a)<(b)?(a):(b))
347 #endif
348 
349 #ifndef MAX
350  #define MAX(a,b) ((a)>(b)?(a):(b))
351 #endif
352 
354 // Comparator-Definitions
355 template<class T>
356 class TEq{
357 public:
358  bool operator()(const T& x, const T& y) const {return x==y;}
359 };
360 
361 template<class T>
362 class TNEq{
363 public:
364  bool operator()(const T& x, const T& y) const {return x!=y;}
365 };
366 
367 template<class T>
368 class TLss{
369 public:
370  bool operator()(const T& x, const T& y) const {return x<y;}
371  int Cmp(const T& d1, const T& d2) const {
372  if (d1<d2){return -1;}
373  else if (d2<d1){return 1;}
374  else {return 0;}
375  }
376 };
377 
378 template<class T>
379 class TLEq{
380 public:
381  bool operator()(const T& x, const T& y) const {return x<=y;}
382 };
383 
384 template<class T>
385 class TGtr{
386 public:
387  bool operator() (const T& x, const T& y) const { return x>y; }
388  int Cmp(const T& d1, const T& d2) const { //** vprasaj Janeza za uporabo
389  if (d1<d2){return 1;}
390  else if (d2<d1){return -1;}
391  else {return 0;}
392  }
393 };
394 
395 template<class T>
396 class TGEq{
397 public:
398  bool operator()(const T& x, const T& y) const {return x>=y;}
399 };
400 
401 template<class T>
402 class TCmp{
403 public:
404  int operator()(const T& x, const T& y) const {
405  if (x < y){return -1;}
406  else if (x > y){return 1;}
407  else {return 0;}
408  }
409 };
410 
412 // Operator-Definitions
413 template <class TRec>
414 bool operator!=(const TRec& Rec1, const TRec& Rec2){return !(Rec1==Rec2);}
415 
416 template <class TRec>
417 bool operator>(const TRec& Rec1, const TRec& Rec2){return Rec2<Rec1;}
418 
419 template <class TRec>
420 bool operator<=(const TRec& Rec1, const TRec& Rec2){return !(Rec2<Rec1);}
421 
422 template <class TRec>
423 bool operator>=(const TRec& Rec1, const TRec& Rec2){return !(Rec1<Rec2);}
424 
425 template <class TRec>
426 bool Cmp(const int& RelOp, const TRec& Rec1, const TRec& Rec2){
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 }
437 
439 // Reference-Count
440 class TCRef{
441 private:
442  int Refs;
443 private:
444  TCRef& operator=(const TCRef&);
445  TCRef(const TCRef&);
446 public:
447  TCRef(): Refs(0){}
448  ~TCRef(){Assert(Refs==0);}
449 
450  void MkRef(){Refs++;}
451  void UnRef(){Assert(Refs>0); Refs--;}
452  bool NoRef() const {return Refs==0;}
453  int GetRefs() const {return Refs;}
454 };
455 
457 // Smart-Pointer-With-Reference-Count
458 template <class TRec>
459 class TPt{
460 public:
461  typedef TRec TObj;
462 private:
463  TRec* Addr;
464  void MkRef() const {
465  if (Addr!=NULL){
466  Addr->CRef.MkRef();
467  }
468  }
469  void UnRef() const {
470  if (Addr!=NULL){
471  Addr->CRef.UnRef();
472  if (Addr->CRef.NoRef()){delete Addr;}
473  }
474  }
475 public:
476  TPt(): Addr(NULL){}
477  TPt(const TPt& Pt): Addr(Pt.Addr){MkRef();}
478  TPt(TRec* _Addr): Addr(_Addr){MkRef();}
479  static TPt New(){return TObj::New();}
480  ~TPt(){UnRef();}
481  explicit TPt(TSIn& SIn);
482  explicit TPt(TSIn& SIn, void* ThisPt);
483  void Save(TSOut& SOut) const;
484  void LoadXml(const TPt<TXmlTok>& XmlTok, const TStr& Nm);
485  void SaveXml(TSOut& SOut, const TStr& Nm) const;
486 
487  TPt& operator=(const TPt& Pt){
488  if (this!=&Pt){Pt.MkRef(); UnRef(); Addr=Pt.Addr;} return *this;}
489  bool operator==(const TPt& Pt) const {return *Addr==*Pt.Addr;}
490  bool operator!=(const TPt& Pt) const {return *Addr!=*Pt.Addr;}
491  bool operator<(const TPt& Pt) const {return *Addr<*Pt.Addr;}
492 
493  TRec* operator->() const {Assert(Addr!=NULL); return Addr;}
494  TRec& operator*() const {Assert(Addr!=NULL); return *Addr;}
495  TRec& operator[](const int& RecN) const {
496  Assert(Addr!=NULL); return Addr[RecN];}
497  TRec* operator()() const {return Addr;}
498  //const TRec* operator()() const {return Addr;}
499  //TRec* operator()() {return Addr;}
500 
501  bool Empty() const { return Addr==NULL;}
502  void Clr(){UnRef(); Addr=NULL;}
503  int GetRefs() const {
504  if (Addr==NULL){return -1;} else {return Addr->CRef.GetRefs();}}
505 
506  int GetPrimHashCd() const {return Addr->GetPrimHashCd();}
507  int GetSecHashCd() const {return Addr->GetSecHashCd();}
508 
509  TPt<TRec> Clone(){return MkClone(*this);}
510 };
511 
513 // Simple-String
514 class TSStr{
515 private:
516  char* Bf;
517 public:
518  TSStr(): Bf(NULL){
519  Bf=new char[0+1]; Bf[0]=0;}
520  TSStr(const TSStr& SStr): Bf(NULL){
521  Bf=new char[strlen(SStr.Bf)+1]; strcpy(Bf, SStr.Bf);}
522  TSStr(const char* _Bf): Bf(NULL){
523  Bf=new char[strlen(_Bf)+1]; strcpy(Bf, _Bf);}
524  ~TSStr(){delete[] Bf;}
525 
526  TSStr& operator=(const TSStr& SStr){
527  if (this!=&SStr){
528  delete[] Bf; Bf=new char[strlen(SStr.Bf)+1]; strcpy(Bf, SStr.Bf);}
529  return *this;}
530 
531  char* CStr() {return Bf;}
532  const char* CStr() const {return Bf;}
533  bool Empty() const {return Bf[0]==0;}
534  int Len() const {return int(strlen(Bf));}
535 };
536 
538 // Conversion-Pointer64-To-Integers32
540 private:
541  union{
542  void* Pt;
544  struct {uint Ls; uint Ms;} UInt32;
545  } Val;
547 public:
549  Val.Pt=0; Val.UInt32.Ms=0; Val.UInt32.Ls=0;}
551  Val.UInt32.Ms=0; Val.UInt32.Ls=0; Val.Pt=Pt;}
552  TConv_Pt64Ints32(const uint& Ms, const uint& Ls){
553  Val.Pt=0; Val.UInt32.Ms=Ms; Val.UInt32.Ls=Ls;}
554 
555  void PutPt(void* Pt){Val.Pt=Pt;}
556  void* GetPt() const {return Val.Pt;}
557  void PutUInt64(const uint64& _UInt64){Val.UInt64=_UInt64;}
558  uint64 GetUInt64() const {return Val.UInt64;}
559  void PutMsUInt32(const uint& Ms){Val.UInt32.Ms=Ms;}
560  uint GetMsUInt32() const {return Val.UInt32.Ms;}
561  void PutLsUInt32(const uint& Ls){Val.UInt32.Ls=Ls;}
562  uint GetLsUInt32() const {return Val.UInt32.Ls;}
563 };
564 
566 // Swap
567 template <class TRec>
568 void Swap(TRec& Rec1, TRec& Rec2){
569  TRec Rec=Rec1; Rec1=Rec2; Rec2=Rec;
570 }
571 
573 
575 
578 public:
579  static inline int GetHashCd(const int hc1, const int hc2) {
580  unsigned long long sum = ((unsigned long long) hc1) + ((unsigned long long) hc2);
581  unsigned long long c = ((sum * (sum + 1)) >> 1) + hc1;
582  return (int) (c % 0x7fffffffULL); }
583 };
584 
586 
589 public:
590  static inline int GetHashCd(const int hc1, const int hc2) {
591  unsigned long long sum = ((unsigned long long) hc1) + ((unsigned long long) hc2);
592  unsigned long long c = ((sum * (sum + 1)) >> 1) + hc1;
593  unsigned int R = (unsigned int) (c >> 31), Q = (unsigned int) (c & 0x7fffffffULL);
594  if ((R & 0x80000000U) != 0) R -= 0x7fffffffU;
595  unsigned int RQ = R + Q;
596  if (RQ < 0x7fffffffU) return (int) RQ;
597  RQ -= 0x7fffffffU;
598  return (RQ == 0x7fffffffU) ? 0 : (int) RQ; }
599 };
600 
601 // Depending on the platform and compiler settings choose the faster implementation (of the same hash function)
602 #if (defined(GLib_64Bit)) && ! (defined(DEBUG) || defined(_DEBUG))
604 #else
606 #endif
607 
608 
609 #endif
Definition: bd.h:440
Definition: bd.h:514
void PutLsUInt32(const uint &Ls)
Definition: bd.h:561
bool(* TOnExeStopF)(char *MsgCStr)
Definition: bd.h:226
UndefCopyAssign(TConv_Pt64Ints32)
int Refs
Definition: bd.h:442
void XLoadFromFile(const TStr &FNm, const TStr &Nm, TRec &Rec)
Definition: xmlser.h:63
char * CStr()
Definition: bd.h:531
const char * CStr() const
Definition: bd.h:532
TPairHashImpl2 TPairHashImpl
Definition: bd.h:605
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:579
bool operator!=(const TPt &Pt) const
Definition: bd.h:490
#define ClassHdTP(TNm, PNm)
Definition: bd.h:135
TPt & operator=(const TPt &Pt)
Definition: bd.h:487
static void PutOnExeStopF(TOnExeStopF _OnExeStopF)
Definition: bd.h:230
void UnRef()
Definition: bd.h:451
Definition: bd.h:341
Definition: bd.h:340
void ExeStop(const char *MsgStr, const char *ReasonStr, const char *CondStr, const char *FNm, const int &LnN)
Definition: bd.cpp:90
TRelOp
Definition: bd.h:341
long double ldouble
Definition: bd.h:16
uint64 GetUInt64() const
Definition: bd.h:558
unsigned int uint
Definition: bd.h:11
int GetRefs() const
Definition: bd.h:453
#define Fail
Definition: bd.h:238
static TPt New()
Definition: bd.h:479
bool Empty() const
Definition: bd.h:501
void SaveXml(TSOut &SOut, const TStr &Nm) const
Definition: xmlser.h:33
Definition: bd.h:340
TCRef()
Definition: bd.h:447
TConv_Pt64Ints32()
Definition: bd.h:548
TRec * operator->() const
Definition: bd.h:493
TSStr(const char *_Bf)
Definition: bd.h:522
uint GetLsUInt32() const
Definition: bd.h:562
Definition: bd.h:340
bool operator()(const T &x, const T &y) const
Definition: bd.h:364
bool operator()(const T &x, const T &y) const
Definition: bd.h:370
void Clr()
Definition: bd.h:502
int Cmp(const T &d1, const T &d2) const
Definition: bd.h:371
TSStr(const TSStr &SStr)
Definition: bd.h:520
Definition: bd.h:341
unsigned char uint8
Definition: bd.h:30
void PutPt(void *Pt)
Definition: bd.h:555
TPt()
Definition: bd.h:476
bool IsXLoadFromFileOk(const TStr &FNm, const TStr &Nm, TRec &Rec, TStr &MsgStr)
Definition: xmlser.h:45
void ErrNotify(const char *NotifyCStr)
Definition: bd.h:74
Definition: bd.h:224
~TPt()
Definition: bd.h:480
Definition: fl.h:58
Definition: xml.h:5
Definition: bd.h:63
bool operator!=(const TRec &Rec1, const TRec &Rec2)
Definition: bd.h:414
ptrdiff_t ssize_t
Definition: bd.h:42
TLogOp
Definition: bd.h:340
void SaveToErrLog(const char *MsgCStr)
Definition: bd.cpp:51
bool Empty() const
Definition: bd.h:533
Definition: bd.h:341
void * Pt
Definition: bd.h:542
TRec TObj
Definition: bd.h:461
void WarnNotify(const char *NotifyCStr)
Definition: bd.h:72
Definition: bd.h:368
Definition: bd.h:341
TConv_Pt64Ints32(const uint &Ms, const uint &Ls)
Definition: bd.h:552
struct TConv_Pt64Ints32::@1::@2 UInt32
int int32
Definition: bd.h:21
unsigned long long uint64
Definition: bd.h:38
TSStr & operator=(const TSStr &SStr)
Definition: bd.h:526
void PutMsUInt32(const uint &Ms)
Definition: bd.h:559
TLoc
Definition: bd.h:63
TRec & operator[](const int &RecN) const
Definition: bd.h:495
uint64 UInt64
Definition: bd.h:543
Definition: bd.h:356
Definition: bd.h:402
bool operator>=(const TRec &Rec1, const TRec &Rec2)
Definition: bd.h:423
size_t TSize
Definition: bd.h:58
#define Assert(Cond)
Definition: bd.h:251
char int8
Definition: bd.h:19
int GetSecHashCd() const
Definition: bd.h:507
TRec * operator()() const
Definition: bd.h:497
unsigned long ulong
Definition: bd.h:12
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590
~TCRef()
Definition: bd.h:448
Definition: bd.h:341
~TSStr()
Definition: bd.h:524
TPt(const TPt &Pt)
Definition: bd.h:477
bool operator==(const TPt &Pt) const
Definition: bd.h:489
unsigned char uchar
Definition: bd.h:10
static TOnExeStopF OnExeStopF
Definition: bd.h:227
bool operator<=(const TRec &Rec1, const TRec &Rec2)
Definition: bd.h:420
Definition: fl.h:128
void MkRef()
Definition: bd.h:450
unsigned int uint32
Definition: bd.h:32
void MkRef() const
Definition: bd.h:464
TRec & operator*() const
Definition: bd.h:494
unsigned short ushort
Definition: bd.h:13
Definition: xml.h:198
void InfoNotify(const char *NotifyCStr)
Definition: bd.h:70
Definition: bd.h:63
static bool IsOnExeStopF()
Definition: bd.h:229
int Len() const
Definition: bd.h:534
Definition: bd.h:396
bool operator()(const T &x, const T &y) const
Definition: bd.h:398
TCRef & operator=(const TCRef &)
Definition: ut.h:161
float sdouble
Definition: bd.h:15
Computes a hash code from a pair of hash codes.
Definition: bd.h:577
Definition: bd.h:379
Definition: bd.h:362
TRec * Addr
Definition: bd.h:463
Definition: bd.h:385
long long int64
Definition: bd.h:27
TPt< TRec > Clone()
Definition: bd.h:509
void Save(TSOut &SOut) const
Definition: xmlser.h:16
Definition: dt.h:412
void UnRef() const
Definition: bd.h:469
TSStr()
Definition: bd.h:518
FILE * TFileId
Definition: bd.h:17
uint Ls
Definition: bd.h:544
int GetRefs() const
Definition: bd.h:503
Definition: xml.h:326
Definition: bd.h:63
Definition: bd.h:196
TConv_Pt64Ints32(void *Pt)
Definition: bd.h:550
short int16
Definition: bd.h:20
void StatNotify(const char *NotifyCStr)
Definition: bd.h:76
uint Ms
Definition: bd.h:544
bool Cmp(const int &RelOp, const TRec &Rec1, const TRec &Rec2)
Definition: bd.h:426
bool operator<(const TPt &Pt) const
Definition: bd.h:491
void WrNotify(const char *CaptionCStr, const char *NotifyCStr)
Definition: bd.cpp:43
uint GetMsUInt32() const
Definition: bd.h:560
bool operator()(const T &x, const T &y) const
Definition: bd.h:387
int operator()(const T &x, const T &y) const
Definition: bd.h:404
Definition: bd.h:341
bool operator()(const T &x, const T &y) const
Definition: bd.h:358
unsigned short uint16
Definition: bd.h:31
void PutUInt64(const uint64 &_UInt64)
Definition: bd.h:557
Definition: bd.h:340
Definition: bd.h:341
TPt(TRec *_Addr)
Definition: bd.h:478
Computes a hash code from a pair of hash codes.
Definition: bd.h:588
void LoadXml(const TPt< TXmlTok > &XmlTok, const TStr &Nm)
Definition: xmlser.h:21
static TOnExeStopF GetOnExeStopF()
Definition: bd.h:231
int GetPrimHashCd() const
Definition: bd.h:506
union TConv_Pt64Ints32::@1 Val
bool operator()(const T &x, const T &y) const
Definition: bd.h:381
char * Bf
Definition: bd.h:516
void Swap(TRec &Rec1, TRec &Rec2)
Definition: bd.h:568
void * GetPt() const
Definition: bd.h:556
bool NoRef() const
Definition: bd.h:452
int Cmp(const T &d1, const T &d2) const
Definition: bd.h:388
bool operator>(const TRec &Rec1, const TRec &Rec2)
Definition: bd.h:417