src/xs/Stash.h

filter: Statementstmt 65.7% 75 / 114 Branchbran 33.4% 87 / 260 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 43.3% 162 / 374 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/xs/catch.cc ↑ Summary t/svapi/ref.cc »
1 #pragma once
2 #include <xs/Sub.h>
3 #include <xs/Hash.h>
4 #include <xs/Glob.h>
5 #include <xs/next.h>
6 #include <xs/Array.h>
7 #include <xs/Scalar.h>
8 #include <xs/Simple.h>
9 #include <panda/string.h>
10  
11 namespace xs {
12  
13 using xs::my_perl;
14  
15 struct Stash : Hash {
16 using string_view = panda::string_view;
17  
18 struct op_proxy : Glob {
19 0 ▶ op_proxy (SV** ptr) : Glob(), ptr(ptr) { if (ptr) set(*ptr); }
Branch: 2 branches
BranchTrueFalseTotal
op_proxy (SV** ptr) : Glob(), ptr(ptr) { if (ptr) set(*ptr); } 0 0 0
op_proxy (SV** ptr) : Glob(), ptr(ptr) { if (ptr) set(*ptr); } 0 0 0
20 op_proxy (const op_proxy&) = default;
21 op_proxy (op_proxy&&) = default;
22  
23 op_proxy& operator= (SV*);
24 1 op_proxy& operator= (AV* v) { _throw(); slot(v); return *this; }
25 1 op_proxy& operator= (HV* v) { _throw(); slot(v); return *this; }
26 1 op_proxy& operator= (CV* v) { _throw(); slot(v); return *this; }
27 1 op_proxy& operator= (IO* v) { _throw(); slot(v); return *this; }
28 op_proxy& operator= (GV*);
29 1 op_proxy& operator= (std::nullptr_t) { return operator=((SV*)NULL); }
30 4 op_proxy& operator= (const Sv& v) { return operator=(v.get()); }
31 4 op_proxy& operator= (const Scalar& v) { _throw(); slot(v); return *this; }
32 2 op_proxy& operator= (const Array& v) { _throw(); slot(v); return *this; }
33 3 op_proxy& operator= (const Hash& v) { _throw(); slot(v); return *this; }
34 0 op_proxy& operator= (const Sub& v) { _throw(); slot(v); return *this; }
35 2 op_proxy& operator= (const Io& v) { _throw(); slot(v); return *this; }
36 0 op_proxy& operator= (const Glob& v) { return operator=(v.get<GV>()); }
37 1 op_proxy& operator= (const op_proxy& v) { return operator=(v.get<GV>()); }
38  
39 0 ▶ inline void _throw () { if (!ptr) throw std::logic_error("store: empty object"); }
Branch: 2 branches
BranchTrueFalseTotal
inline void _throw () { if (!ptr) throw std::logic_error("store: empty object"); } 0 0 0
inline void _throw () { if (!ptr) throw std::logic_error("store: empty object"); } 0 0 0
40  
41 private:
42 SV** ptr;
43 };
44  
45 0 static Stash root () { return PL_defstash; }
46  
47 static Stash from_name (SV* fqn, I32 flags = 0) { return gv_stashsv(fqn, flags); }
48  
49 0 Stash (std::nullptr_t = nullptr) {}
50 0 ▶ Stash (SV* sv, bool policy = INCREMENT) : Hash(sv, policy) { _validate(); }
Branch: 1 branch
BranchTrueFalseTotal
Stash (SV* sv, bool policy = INCREMENT) : Hash(sv, policy) { _validate(); } 0 0 0
51 0 ▶ Stash (HV* sv, bool policy = INCREMENT) : Hash(sv, policy) { _validate(); }
Branch: 1 branch
BranchTrueFalseTotal
Stash (HV* sv, bool policy = INCREMENT) : Hash(sv, policy) { _validate(); } 0 0 0
52  
53 0 Stash (const string_view& package, I32 flags = 0) {
54 0 ▶ *this = gv_stashpvn(package.data(), package.length(), flags);
Branch: 2 branches
BranchTrueFalseTotal
*this = gv_stashpvn(package.data(), package.length(), flags); 0 0 0
*this = gv_stashpvn(package.data(), package.length(), flags); 0 0 0
55 0 }
56  
57 49 Stash (const Stash& oth) : Hash(oth) {}
58 3 ▶ Stash (const Hash& oth) : Hash(oth) { _validate(); }
Branch: 1 branch
BranchTrueFalseTotal
Stash (const Hash& oth) : Hash(oth) { _validate(); } 1 1 2
59 2 Stash (const Sv& oth) : Stash(oth.get()) {}
60 1 Stash (Stash&& oth) : Hash(std::move(oth)) {}
61 3 ▶ Stash (Hash&& oth) : Hash(std::move(oth)) { _validate(); }
Branch: 1 branch
BranchTrueFalseTotal
Stash (Hash&& oth) : Hash(std::move(oth)) { _validate(); } 1 1 2
62 3 ▶ Stash (Sv&& oth) : Hash(std::move(oth)) { _validate(); }
Branch: 1 branch
BranchTrueFalseTotal
Stash (Sv&& oth) : Hash(std::move(oth)) { _validate(); } 1 1 2
63  
64 Stash (const Simple&) = delete;
65 Stash (const Array&) = delete;
66 Stash (const Sub&) = delete;
67 Stash (const Glob&) = delete;
68 Stash (const Io&) = delete;
69  
70 28 Stash& operator= (SV* val) { Hash::operator=(val); _validate(); return *this; }
71 0 Stash& operator= (HV* val) { Hash::operator=(val); _validate(); return *this; }
72 Stash& operator= (std::nullptr_t) { Hash::operator=(nullptr); return *this; }
73 2 Stash& operator= (const Stash& oth) { Hash::operator=(oth); return *this; }
74 2 Stash& operator= (Stash&& oth) { Hash::operator=(std::move(oth)); return *this; }
75 4 Stash& operator= (const Hash& oth) { Hash::operator=(oth); _validate(); return *this; }
76 4 Stash& operator= (Hash&& oth) { Hash::operator=(std::move(oth)); _validate(); return *this; }
77 4 Stash& operator= (const Sv& oth) { return operator=(oth.get()); }
78 4 Stash& operator= (Sv&& oth) { Hash::operator=(std::move(oth)); _validate(); return *this; }
79 Stash& operator= (const Simple&) = delete;
80 Stash& operator= (const Array&) = delete;
81 Stash& operator= (const Sub&) = delete;
82 Stash& operator= (const Glob&) = delete;
83 Stash& operator= (const Io&) = delete;
84  
85 using Hash::set;
86 1 void set (HV* val) { Hash::operator=(val); }
87  
88 0 Glob fetch (const string_view& key) const {
89 0 ▶ auto elem = Hash::fetch(key);
Branch: 1 branch
BranchTrueFalseTotal
auto elem = Hash::fetch(key); 0 0 0
90 0 ▶ _promote(elem.get<GV>(), key);
Branch: 1 branch
BranchTrueFalseTotal
_promote(elem.get<GV>(), key); 0 0 0
91 0 ▶ return elem.get<GV>();
Branch: 1 branch
BranchTrueFalseTotal
return elem.get<GV>(); 0 0 0
92 0 }
93  
94 2 Glob at (const string_view& key) const {
95 2 Glob ret = fetch(key);
96 2 ▶ if (!ret) throw std::out_of_range("at: no key");
Branch: 2 branches
BranchTrueFalseTotal
if (!ret) throw std::out_of_range("at: no key"); 1 1 2
if (!ret) throw std::out_of_range("at: no key"); 1 0 1
97 1 return ret;
98 1 }
99  
100 1 Glob operator[] (const string_view& key) const { return fetch(key); }
101  
102 1 ▶ void store (const string_view& key, SV* v) { operator[](key) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void store (const string_view& key, SV* v) { operator[](key) = v; } 1 0 1
void store (const string_view& key, SV* v) { operator[](key) = v; } 1 0 1
103 void store (const string_view& key, AV* v) { operator[](key) = v; }
104 void store (const string_view& key, HV* v) { operator[](key) = v; }
105 void store (const string_view& key, CV* v) { operator[](key) = v; }
106 void store (const string_view& key, GV* v) { operator[](key) = v; }
107 void store (const string_view& key, const Sv& v) { operator[](key) = v; }
108 void store (const string_view& key, const Scalar& v) { operator[](key) = v; }
109 void store (const string_view& key, const Array& v) { operator[](key) = v; }
110 void store (const string_view& key, const Hash& v) { operator[](key) = v; }
111 void store (const string_view& key, const Sub& v) { operator[](key) = v; }
112 void store (const string_view& key, const Io& v) { operator[](key) = v; }
113 1 ▶ void store (const string_view& key, const Glob& v) { operator[](key) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void store (const string_view& key, const Glob& v) { operator[](key) = v; } 1 0 1
void store (const string_view& key, const Glob& v) { operator[](key) = v; } 1 0 1
114  
115 0 op_proxy operator[] (const string_view& key) {
116 0 ▶ if (!sv) return NULL;
Branch: 2 branches
BranchTrueFalseTotal
if (!sv) return NULL; 0 0 0
if (!sv) return NULL; 0 0 0
117 0 ▶ SV** ref = hv_fetch((HV*)sv, key.data(), key.length(), 1);
Branch: 1 branch
BranchTrueFalseTotal
SV** ref = hv_fetch((HV*)sv, key.data(), key.length(), 1); 0 0 0
118 0 ▶ _promote((GV*)*ref, key);
Branch: 1 branch
BranchTrueFalseTotal
_promote((GV*)*ref, key); 0 0 0
119 0 ▶ return ref;
Branch: 1 branch
BranchTrueFalseTotal
return ref; 0 0 0
120 }
121  
122 0 ▶ string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); }
Branch: 10 branches
BranchTrueFalseTotal
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
string_view name () const { return string_view(HvNAME(sv), HvNAMELEN(sv)); } 0 0 0
123 18 ▶ HEK* name_hek () const { return HvNAME_HEK_NN((HV*)sv); }
Branch: 1 branch
BranchTrueFalseTotal
HEK* name_hek () const { return HvNAME_HEK_NN((HV*)sv); } 0 18 18
124 32 ▶ const Simple& name_sv () const { if (!_name_sv) _name_sv = Simple::shared(name_hek()); return _name_sv; }
Branch: 2 branches
BranchTrueFalseTotal
const Simple& name_sv () const { if (!_name_sv) _name_sv = Simple::shared(name_hek()); return _name_sv; } 17 15 32
const Simple& name_sv () const { if (!_name_sv) _name_sv = Simple::shared(name_hek()); return _name_sv; } 17 0 17
125 1 ▶ string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); }
Branch: 12 branches
BranchTrueFalseTotal
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 0 1 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 0 1 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 0 1 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 0 1 1
string_view effective_name () const { return string_view(HvENAME(sv), HvENAMELEN(sv)); } 1 0 1
126 panda::string path () const;
127  
128 31 ▶ Scalar scalar (const string_view& name) const { return fetch(name).scalar(); }
Branch: 2 branches
BranchTrueFalseTotal
Scalar scalar (const string_view& name) const { return fetch(name).scalar(); } 31 0 31
Scalar scalar (const string_view& name) const { return fetch(name).scalar(); } 31 0 31
129 0 ▶ Array array (const string_view& name) const { return fetch(name).array(); }
Branch: 2 branches
BranchTrueFalseTotal
Array array (const string_view& name) const { return fetch(name).array(); } 0 0 0
Array array (const string_view& name) const { return fetch(name).array(); } 0 0 0
130 0 ▶ Hash hash (const string_view& name) const { return fetch(name).hash(); }
Branch: 2 branches
BranchTrueFalseTotal
Hash hash (const string_view& name) const { return fetch(name).hash(); } 0 0 0
Hash hash (const string_view& name) const { return fetch(name).hash(); } 0 0 0
131 23 ▶ Sub sub (const string_view& name) const { return fetch(name).sub(); }
Branch: 2 branches
BranchTrueFalseTotal
Sub sub (const string_view& name) const { return fetch(name).sub(); } 23 0 23
Sub sub (const string_view& name) const { return fetch(name).sub(); } 23 0 23
132 2 ▶ Io io (const string_view& name) const { return fetch(name).io(); }
Branch: 2 branches
BranchTrueFalseTotal
Io io (const string_view& name) const { return fetch(name).io(); } 2 0 2
Io io (const string_view& name) const { return fetch(name).io(); } 2 0 2
133  
134 1 ▶ void scalar (const string_view& name, const Scalar& v) { operator[](name) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void scalar (const string_view& name, const Scalar& v) { operator[](name) = v; } 1 0 1
void scalar (const string_view& name, const Scalar& v) { operator[](name) = v; } 1 0 1
135 1 ▶ void array (const string_view& name, const Array& v) { operator[](name) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void array (const string_view& name, const Array& v) { operator[](name) = v; } 1 0 1
void array (const string_view& name, const Array& v) { operator[](name) = v; } 1 0 1
136 1 ▶ void hash (const string_view& name, const Hash& v) { operator[](name) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void hash (const string_view& name, const Hash& v) { operator[](name) = v; } 1 0 1
void hash (const string_view& name, const Hash& v) { operator[](name) = v; } 1 0 1
137 0 ▶ void sub (const string_view& name, const Sub& v) { operator[](name) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void sub (const string_view& name, const Sub& v) { operator[](name) = v; } 0 0 0
void sub (const string_view& name, const Sub& v) { operator[](name) = v; } 0 0 0
138 1 ▶ void io (const string_view& name, const Io& v) { operator[](name) = v; }
Branch: 2 branches
BranchTrueFalseTotal
void io (const string_view& name, const Io& v) { operator[](name) = v; } 1 0 1
void io (const string_view& name, const Io& v) { operator[](name) = v; } 1 0 1
139  
140 Sub method (const Sv& name) const {
141 GV* gv = gv_fetchmeth_sv((HV*)sv, name, 0, 0);
142 return gv ? Sub(GvCV(gv)) : Sub();
143 }
144  
145 0 Sub method (const string_view& name) const {
146 0 GV* gv = gv_fetchmeth_pvn((HV*)sv, name.data(), name.length(), 0, 0);
147 0 ▶ return gv ? Sub(GvCV(gv)) : Sub();
Branch: 1 branch
BranchTrueFalseTotal
return gv ? Sub(GvCV(gv)) : Sub(); 0 0 0
148 }
149  
150 Sub method_strict (const Sv& name) const {
151 Sub ret = method(name);
152 if (!ret) _throw_nomethod(name);
153 return ret;
154 }
155  
156 0 Sub method_strict (const string_view& name) const {
157 0 Sub ret = method(name);
158 0 ▶ if (!ret) _throw_nomethod(name);
Branch: 2 branches
BranchTrueFalseTotal
if (!ret) _throw_nomethod(name); 0 0 0
if (!ret) _throw_nomethod(name); 0 0 0
159 0 return ret;
160 }
161  
162 8 Sub next_method (const Sub& current) const { return xs::next::method((HV*)sv, current.get<CV>()); }
163 17 Sub next_method_strict (const Sub& current) const { return xs::next::method_strict((HV*)sv, current.get<CV>()); }
164  
165 7 Sub super_method (const Sub& current) const { return xs::super::method((HV*)sv, current.get<CV>()); }
166 14 Sub super_method_strict (const Sub& current) const { return xs::super::method_strict((HV*)sv, current.get<CV>()); }
167  
168 void mark_as_loaded (const Stash& source) const;
169 void mark_as_loaded (const string_view& source) const { mark_as_loaded(Stash(source, GV_ADD)); }
170  
171 void inherit (const Stash& parent);
172 void inherit (const string_view& parent) { inherit(Stash(parent, GV_ADD)); }
173  
174 bool isa (const string_view& parent, U32 hash = 0, int flags = 0) const;
175 2 ▶ bool isa (HEK* hek) const { return isa(string_view(HEK_KEY(hek), HEK_LEN(hek)), HEK_HASH(hek), HEK_UTF8(hek)); }
Branch: 1 branch
BranchTrueFalseTotal
bool isa (HEK* hek) const { return isa(string_view(HEK_KEY(hek), HEK_LEN(hek)), HEK_HASH(hek), HEK_UTF8(hek)); } 2 0 2
176 2 ▶ bool isa (const Stash& parent) const { return isa(HvNAME_HEK(parent.get<HV>())); }
Branch: 3 branches
BranchTrueFalseTotal
bool isa (const Stash& parent) const { return isa(HvNAME_HEK(parent.get<HV>())); } 2 0 2
bool isa (const Stash& parent) const { return isa(HvNAME_HEK(parent.get<HV>())); } 2 0 2
bool isa (const Stash& parent) const { return isa(HvNAME_HEK(parent.get<HV>())); } 0 2 2
177  
178 template <class...R, class...A> Sub::call_t<R...> call (const Sv& name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); }
179 7 ▶ template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); }
Branch: 18 branches
BranchTrueFalseTotal
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 2 0 2
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 2 0 2
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 2 0 2
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
template <class...R, class...A> Sub::call_t<R...> call (string_view name, A&&...args) const { return method_strict(name).call<R...>(name_sv(), std::forward<A>(args)...); } 1 0 1
180 3 ▶ template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); }
Branch: 6 branches
BranchTrueFalseTotal
template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); } 0 1 1
template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); } 0 0 0
template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); } 0 0 0
template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); } 2 0 2
template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); } 2 0 2
template <class...R, class...A> Sub::call_t<R...> call_SUPER (const Sub& ctx, A&&...args) const { return ctx.SUPER_strict().call<R...>(name_sv(), std::forward<A>(args)...); } 2 0 2
181 4 ▶ template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); }
Branch: 6 branches
BranchTrueFalseTotal
template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 0 1 1
template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 0 0 0
template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 0 0 0
template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 3 0 3
template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 3 0 3
template <class...R, class...A> Sub::call_t<R...> call_next (const Sub& ctx, A&&...args) const { return next_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 3 0 3
182 7 ▶ template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); }
Branch: 6 branches
BranchTrueFalseTotal
template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 0 2 2
template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 0 0 0
template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 0 0 0
template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 5 0 5
template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 5 0 5
template <class...R, class...A> Sub::call_t<R...> call_super (const Sub& ctx, A&&...args) const { return super_method_strict(ctx).call<R...>(name_sv(), std::forward<A>(args)...); } 5 0 5
183  
184 template <class...R, class...A>
185 4 Sub::call_t<R...> call_next_maybe (const Sub& ctx, A&&...args) const {
186 4 ▶ auto sub = next_method(ctx);
Branch: 1 branch
BranchTrueFalseTotal
auto sub = next_method(ctx); 4 0 4
187 4 ▶ if (!sub) return Sub::call_t<R...>();
Branch: 1 branch
BranchTrueFalseTotal
if (!sub) return Sub::call_t<R...>(); 1 3 4
188 3 ▶ return sub.call<R...>(name_sv(), std::forward<A>(args)...);
Branch: 2 branches
BranchTrueFalseTotal
return sub.call<R...>(name_sv(), std::forward<A>(args)...); 3 0 3
return sub.call<R...>(name_sv(), std::forward<A>(args)...); 3 0 3
189 4 }
190  
191 template <class...R, class...A>
192 3 Sub::call_t<R...> call_super_maybe (const Sub& ctx, A&&...args) const {
193 3 ▶ auto sub = super_method(ctx);
Branch: 1 branch
BranchTrueFalseTotal
auto sub = super_method(ctx); 3 0 3
194 3 ▶ if (!sub) return Sub::call_t<R...>();
Branch: 1 branch
BranchTrueFalseTotal
if (!sub) return Sub::call_t<R...>(); 1 2 3
195 2 ▶ return sub.call<R...>(name_sv(), std::forward<A>(args)...);
Branch: 2 branches
BranchTrueFalseTotal
return sub.call<R...>(name_sv(), std::forward<A>(args)...); 2 0 2
return sub.call<R...>(name_sv(), std::forward<A>(args)...); 2 0 2
196 3 }
197  
198 Object bless () const;
199 Object bless (const Sv& what) const;
200  
201 void add_const_sub (const panda::string_view& name, const Sv& val);
202  
203 private:
204 mutable Simple _name_sv;
205  
206 0 void _validate () {
207 0 ▶ if (!sv) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!sv) return; 0 0 0
208 0 ▶ if (HvNAME(sv)) return;
Branch: 6 branches
BranchTrueFalseTotal
if (HvNAME(sv)) return; 0 0 0
if (HvNAME(sv)) return; 0 0 0
if (HvNAME(sv)) return; 0 0 0
if (HvNAME(sv)) return; 0 0 0
if (HvNAME(sv)) return; 0 0 0
if (HvNAME(sv)) return; 0 0 0
209 0 ▶ if (is_undef()) return reset();
Branch: 1 branch
BranchTrueFalseTotal
if (is_undef()) return reset(); 0 0 0
210 0 reset();
211 0 ▶ throw std::invalid_argument("SV is not a Stash or Stash reference");
Branch: 1 branch
BranchTrueFalseTotal
throw std::invalid_argument("SV is not a Stash or Stash reference"); 0 0 0
212 }
213  
214 void _promote (GV* gv, const panda::string_view& key) const;
215  
216 void _throw_nomethod (const panda::string_view&) const;
217  
218 void _throw_nomethod (const Sv& name) const {
219 panda::string_view _name = Simple(name);
220 _throw_nomethod(_name);
221 }
222 };
223  
224 }
« src/xs/catch.cc ↑ Summary t/svapi/ref.cc »