line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODULE = Geo::Geos PACKAGE = Geo::Geos::Index::SpatialIndex |
2
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
Array SpatialIndex::query(Envelope& env, SV* arg = NULL) { |
5
|
14
|
50
|
|
|
|
|
Object me {ST(0)}; |
|
|
100
|
|
|
|
|
|
6
|
7
|
|
|
|
|
|
auto payload = me.payload(&payload_marker_SVs_map); |
7
|
7
|
|
|
|
|
|
auto real_payload = static_cast(payload.ptr); |
8
|
|
|
|
|
|
|
|
9
|
7
|
100
|
|
|
|
|
if (!arg) { |
10
|
10
|
|
|
|
|
|
std::vector v; |
11
|
5
|
50
|
|
|
|
|
THIS->query(&env, v); |
12
|
5
|
50
|
|
|
|
|
RETVAL = Helper::wrap_inc_SVs(&v, real_payload->map); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
else { |
15
|
4
|
50
|
|
|
|
|
Sub visitor {arg}; |
16
|
2
|
50
|
|
|
|
|
if (!visitor) throw "Unsupported argument"; |
17
|
4
|
50
|
|
|
|
|
SubItemVisitor v{visitor, real_payload->map}; |
|
|
50
|
|
|
|
|
|
18
|
2
|
50
|
|
|
|
|
THIS->query(&env, v); |
19
|
2
|
|
|
|
|
|
XSRETURN_UNDEF; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
void SpatialIndex::insert(Envelope& env, SV* item) { |
24
|
32
|
50
|
|
|
|
|
Object me{ST(0)}; |
25
|
|
|
|
|
|
|
|
26
|
16
|
|
|
|
|
|
auto payload = me.payload(&payload_marker_SVs_map); |
27
|
16
|
|
|
|
|
|
auto real_payload = static_cast(payload.ptr); |
28
|
16
|
50
|
|
|
|
|
SV* value = Helper::store_sv(item, real_payload->map); |
29
|
16
|
50
|
|
|
|
|
THIS->insert(&env, value); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
bool SpatialIndex::remove(Envelope& env, SV *item) { |
33
|
6
|
50
|
|
|
|
|
Object me{ST(0)}; |
34
|
3
|
|
|
|
|
|
auto payload = me.payload(&payload_marker_SVs_map); |
35
|
3
|
|
|
|
|
|
auto real_payload = static_cast(payload.ptr); |
36
|
|
|
|
|
|
|
|
37
|
3
|
50
|
|
|
|
|
SV* value = hv_delete_ent(real_payload->map, item, 0, 0); |
38
|
3
|
50
|
|
|
|
|
if (!value) throw "value is n/a in hash"; |
39
|
|
|
|
|
|
|
|
40
|
3
|
50
|
|
|
|
|
THIS->remove(&env, value); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
BOOT { |
44
|
46
|
|
|
|
|
|
payload_marker_SVs_map.svt_free = payload_marker_SVs_map_free; |
45
|
|
|
|
|
|
|
} |