=head1 NAME XS::Framework::Manual::SVAPI::Scope - XS::Framework scope utils =head1 Scope::Hints - compiler scope hints =head2 Overview This class contains static methods for setting scope hints at compile time and getting it in runtime. Example: use MyModule::strict_mode; # MyModule::strict_mode::import() XS function calls Scope::Hints::set ... MyModule::somefunc($arg); # XS function may use Scope::Hints::get to alter its behaviour ... no MyModule::strict_mode; # MyModule::strict_mode::unimport() XS function calls Scope::Hints::remove =head2 void set (string_view name, const Sv& value) Set hint C with value C. Must be called at compile time to take effect, i.e. from XS C function or from XS function that is called from C block. Scope::Hints::set("myhint", Simple("myvalue")); Have the same effect as calling from perl BEGIN { $^H{myhint} = "myvalue" } =head2 void remove (string_view name) Removes hint C and its associated value. Must be called at compile time to take effect (usually from C). =head2 bool exists (string_view name) Returns true if hint C exists in current scope. Must be called at runtime. =head2 Scalar get (string_view name) Returns value associated with hint C or empty scalar if no such hint in scope. Must be called at runtime. =head2 Hash get () Returns all hints and their values in scope as hashref. Must be called at runtime. =head2 Scalar get_ct (string_view name) Compile-time version of C. Returns value associated with hint C or empty scalar if no such hint enabled. Must be called at compile time. Have the same effect as calling from perl BEGIN { my $val = $^H{myhint}; } =head1 SEE ALSO L L =cut