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
32// ============================================================
34zfclassNotPOD ZFLIB_ZFCore zfcharConst_zfstlLess {
35public:
36 inline zfbool operator () (const zfchar * const &k1, const zfchar * const &k2) const {
37 return (zfscmp(k1, k2) < 0);
38 }
39};
40zfclassNotPOD ZFLIB_ZFCore zfcharConst_zfstlHash {
41public:
42 zfstlsize operator () (const zfchar * const &v) const {
44 }
45};
46zfclassNotPOD ZFLIB_ZFCore zfcharConst_zfstlEqual {
47public:
48 inline zfbool operator () (const zfchar * const &k1, const zfchar * const &k2) const {
49 return (zfscmp(k1, k2) == 0);
50 }
51};
52
53zfclassNotPOD ZFLIB_ZFCore zfchar_zfstlLess {
54public:
55 inline zfbool operator () (zfchar * const &k1, zfchar * const &k2) const {
56 return (zfscmp(k1, k2) < 0);
57 }
58};
59zfclassNotPOD ZFLIB_ZFCore zfchar_zfstlHash {
60public:
61 zfstlsize operator () (zfchar * const &v) const {
63 }
64};
65zfclassNotPOD ZFLIB_ZFCore zfchar_zfstlEqual {
66public:
67 inline zfbool operator () (zfchar * const &k1, zfchar * const &k2) const {
68 return (zfscmp(k1, k2) == 0);
69 }
70};
71
72template<typename T_POD>
73zfclassNotPOD ZFLIB_ZFCore zfpod_zfstlLess {
74public:
75 inline zfbool operator () (T_POD const &k1, T_POD const &k2) const {
76 return zfcmpPOD(k1, k2) < 0;
77 }
78};
79template<typename T_POD>
80zfclassNotPOD zfpod_zfstlHash {
81public:
82 zfstlsize operator () (T_POD const &v) const {
83 return (zfstlsize)zfidentityCalc(v);
84 }
85};
86template<typename T_POD>
87zfclassNotPOD zfpod_zfstlEqual {
88public:
89 inline zfbool operator () (T_POD const &k1, T_POD const &k2) const {
90 return zfcmpPOD(k1, k2) == 0;
91 }
92};
94
95#endif // #ifndef _ZFI_zfstl_define_h_
96
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:546
zfidentity zfidentityCalc(T_Type const &v)
calculate identity from POD object
Definition ZFIdentityUtil.h:92
zfidentity zfidentityCalcString(const zfchar *src, zfindex srcLen=((zfindex) -1))
calculate identity from string
#define zfstlsize
size_t wrapper
Definition zfstl_define.h:29