ZFFramework
Loading...
Searching...
No Matches
zfstl_define.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_zfstl_define_h_
7#define _ZFI_zfstl_define_h_
8
9#include "../ZFCoreDef.h"
10
28#ifndef zfstlsize
29 #define zfstlsize size_t
30#endif
31
33#ifndef zfstlptrdiff_t
34 #define zfstlptrdiff_t std::ptrdiff_t
35#endif
36
37// ============================================================
39zfclassNotPOD ZFLIB_ZFCore zfcharConst_zfstlLess {
40public:
41 inline zfbool operator () (const zfchar * const &k1, const zfchar * const &k2) const {
42 return (zfscmp(k1, k2) < 0);
43 }
44};
45zfclassNotPOD ZFLIB_ZFCore zfcharConst_zfstlHash {
46public:
47 zfstlsize operator () (const zfchar * const &v) const {
49 }
50};
51zfclassNotPOD ZFLIB_ZFCore zfcharConst_zfstlEqual {
52public:
53 inline zfbool operator () (const zfchar * const &k1, const zfchar * const &k2) const {
54 return (zfscmp(k1, k2) == 0);
55 }
56};
57
58zfclassNotPOD ZFLIB_ZFCore zfchar_zfstlLess {
59public:
60 inline zfbool operator () (zfchar * const &k1, zfchar * const &k2) const {
61 return (zfscmp(k1, k2) < 0);
62 }
63};
64zfclassNotPOD ZFLIB_ZFCore zfchar_zfstlHash {
65public:
66 zfstlsize operator () (zfchar * const &v) const {
68 }
69};
70zfclassNotPOD ZFLIB_ZFCore zfchar_zfstlEqual {
71public:
72 inline zfbool operator () (zfchar * const &k1, zfchar * const &k2) const {
73 return (zfscmp(k1, k2) == 0);
74 }
75};
76
77template<typename T_POD>
78zfclassNotPOD ZFLIB_ZFCore zfpod_zfstlLess {
79public:
80 inline zfbool operator () (T_POD const &k1, T_POD const &k2) const {
81 return zfcmpPOD(k1, k2) < 0;
82 }
83};
84template<typename T_POD>
85zfclassNotPOD zfpod_zfstlHash {
86public:
87 zfstlsize operator () (T_POD const &v) const {
88 return (zfstlsize)zfidentityCalc(v);
89 }
90};
91template<typename T_POD>
92zfclassNotPOD zfpod_zfstlEqual {
93public:
94 inline zfbool operator () (T_POD const &k1, T_POD const &k2) const {
95 return zfcmpPOD(k1, k2) == 0;
96 }
97};
99
100#endif // #ifndef _ZFI_zfstl_define_h_
101
necessary header file for all types
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
zfint zfscmp(const zfchar *s1, const zfchar *s2)
strcmp wrapper as zfchar type
Definition ZFCoreTypeDef_CharType.h:152
#define zfclassNotPOD
shows the class is not a POD type, you should not memset it or declare it in stack or copy value by c...
Definition ZFCoreTypeDef_ClassType.h:48
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
zfint zfcmpPOD(T_Element const &v0, T_Element const &v1)
util method to compare two POD type
Definition ZFCoreUtilTemplate.h:548
zfidentity zfidentityCalcString(const zfchar *src, zfindex srcLen)
calculate identity from string
zfidentity zfidentityCalc(T_Type const &v)
calculate identity from POD object
Definition ZFIdentityUtil.h:100
#define zfstlsize
size_t wrapper
Definition zfstl_define.h:29