line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
namespace xs { |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
using xs::my_perl; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
struct HashEntry { |
9
|
0
|
|
|
|
|
|
HashEntry (HE* he = NULL) : he(he) {} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
U32 hash () const { return HeHASH(he); } |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
panda::string_view key () const { return panda::string_view(HeKEY(he), HeKLEN(he)); } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
HEK* hek () const { return HeKEY_hek(he); } |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
Scalar value () const { |
18
|
0
|
|
|
|
|
|
Scalar ret; |
19
|
0
|
0
|
|
|
|
|
ret.set(HeVAL(he)); |
20
|
0
|
|
|
|
|
|
return ret; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
void value (const Scalar& val) { |
24
|
|
|
|
|
|
|
SvREFCNT_inc_simple_void(val.get()); |
25
|
|
|
|
|
|
|
auto old = HeVAL(he); |
26
|
|
|
|
|
|
|
HeVAL(he) = val.get(); |
27
|
|
|
|
|
|
|
SvREFCNT_dec(old); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
void value (SV* v) { value(Scalar(v)); } |
30
|
|
|
|
|
|
|
void value (const Sv& v) { value(Scalar(v)); } |
31
|
|
|
|
|
|
|
void value (const Array&) = delete; |
32
|
|
|
|
|
|
|
void value (const Hash&) = delete; |
33
|
|
|
|
|
|
|
void value (const Sub&) = delete; |
34
|
|
|
|
|
|
|
void value (const Io&) = delete; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
bool operator== (const HashEntry& oth) const { return he == oth.he; } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
explicit |
39
|
0
|
|
|
|
|
|
operator bool () const { return he; } |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
operator HE* () const { return he; } |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
HE* operator-> () const { return he; } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
private: |
46
|
|
|
|
|
|
|
HE* he; |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |