man-pages/man3/Net::DBus::Binding::Introspector.3pm.html
2021-03-31 01:06:50 +01:00

369 lines
11 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Net::DBus::Binding::Introspector</TITLE>
</HEAD><BODY>
<H1>Net::DBus::Binding::Introspector</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-12-26<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Net::DBus::Binding::Introspector - Handler for object introspection data
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
# Create an object populating with info from an
# XML doc containing introspection data.
my $ins = Net::DBus::Binding::Introspector-&gt;new(xml =&gt; $data);
# Create an object, defining introspection data
# programmatically
my $ins = Net::DBus::Binding::Introspector-&gt;new(object_path =&gt; $object-&gt;get_object_path);
$ins-&gt;add_method(&quot;DoSomething&quot;, [&quot;string&quot;], [], &quot;org.example.MyObject&quot;);
$ins-&gt;add_method(&quot;TestSomething&quot;, [&quot;int32&quot;], [], &quot;org.example.MyObject&quot;);
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This class is responsible for managing introspection data, and
answering questions about it. This is not intended for use by
application developers, whom should instead consult the higher
level <FONT SIZE="-1">API</FONT> in Net::DBus::Exporter.
<A NAME="lbAE">&nbsp;</A>
<H2>METHODS</H2>
<DL COMPACT>
<DT id="1">my $ins = Net::DBus::Binding::Introspector-&gt;new(object_path =&gt; $object_path, xml =&gt; $xml);<DD>
Creates a new introspection data manager for the object registered
at the path specified for the <TT>&quot;object_path&quot;</TT> parameter. The optional
<TT>&quot;xml&quot;</TT> parameter can be used to pre-load the manager with introspection
metadata from an <FONT SIZE="-1">XML</FONT> document.
<DT id="2">$ins-&gt;add_interface($name)<DD>
Register the object as providing an interface with the name <TT>$name</TT>
<DT id="3">my $bool = $ins-&gt;has_interface($name)<DD>
Return a true value if the object is registered as providing
an interface with the name <TT>$name</TT>; returns false otherwise.
<DT id="4">my @interfaces = $ins-&gt;has_method($name, [$interface])<DD>
Return a list of all interfaces provided by the object, which
contain a method called <TT>$name</TT>. This may be an empty list.
The optional <TT>$interface</TT> parameter can restrict the check to
just that one interface.
<DT id="5">my $boolean = $ins-&gt;is_method_allowed($name[, $interface])<DD>
Checks according to whether the remote caller is allowed to invoke
the method <TT>$name</TT> on the object associated with this introspector.
If this object has 'strict exports' enabled, then only explicitly
exported methods will be allowed. The optional <TT>$interface</TT> parameter
can restrict the check to just that one interface. Returns a non-zero
value if the method should be allowed.
<DT id="6">my @interfaces = $ins-&gt;has_signal($name)<DD>
Return a list of all interfaces provided by the object, which
contain a signal called <TT>$name</TT>. This may be an empty list.
<DT id="7">my @interfaces = $ins-&gt;has_property($name)<DD>
Return a list of all interfaces provided by the object, which
contain a property called <TT>$name</TT>. This may be an empty list.
The optional <TT>$interface</TT> parameter can restrict the check to
just that one interface.
<DT id="8">$ins-&gt;add_method($name, $params, $returns, $interface, $attributes, $paramnames, $returnnames);<DD>
Register the object as providing a method called <TT>$name</TT> accepting parameters
whose types are declared by <TT>$params</TT> and returning values whose type
are declared by <TT>$returns</TT>. The method will be scoped to the interface
named by <TT>$interface</TT>. The <TT>$attributes</TT> parameter is a hash reference
for annotating the method. The <TT>$paramnames</TT> and <TT>$returnames</TT> parameters
are a list of argument and return value names.
<DT id="9">$ins-&gt;add_signal($name, $params, $interface, $attributes);<DD>
Register the object as providing a signal called <TT>$name</TT> with parameters
whose types are declared by <TT>$params</TT>. The signal will be scoped to the interface
named by <TT>$interface</TT>. The <TT>$attributes</TT> parameter is a hash reference
for annotating the signal.
<DT id="10">$ins-&gt;add_property($name, $type, $access, $interface, $attributes);<DD>
Register the object as providing a property called <TT>$name</TT> with a type
of <TT>$type</TT>. The <TT>$access</TT> parameter can be one of <TT>&quot;read&quot;</TT>, <TT>&quot;write&quot;</TT>,
or <TT>&quot;readwrite&quot;</TT>. The property will be scoped to the interface
named by <TT>$interface</TT>. The <TT>$attributes</TT> parameter is a hash reference
for annotating the signal.
<DT id="11">my $boolean = $ins-&gt;is_method_deprecated($name, $interface)<DD>
Returns a true value if the method called <TT>$name</TT> in the interface
<TT>$interface</TT> is marked as deprecated
<DT id="12">my $boolean = $ins-&gt;is_signal_deprecated($name, $interface)<DD>
Returns a true value if the signal called <TT>$name</TT> in the interface
<TT>$interface</TT> is marked as deprecated
<DT id="13">my $boolean = $ins-&gt;is_property_deprecated($name, $interface)<DD>
Returns a true value if the property called <TT>$name</TT> in the interface
<TT>$interface</TT> is marked as deprecated
<DT id="14">my $boolean = $ins-&gt;does_method_reply($name, $interface)<DD>
Returns a true value if the method called <TT>$name</TT> in the interface
<TT>$interface</TT> will generate a reply. Returns a false value otherwise.
<DT id="15">my $boolean = $ins-&gt;method_has_strict_exceptions($name, $interface)<DD>
Returns true if the method called <TT>$name</TT> in the interface <TT>$interface</TT> has
the strict_exceptions attribute; that is any exceptions which aren't
Net::DBus::Error objects should not be caught and allowed to travel up the
stack.
<DT id="16">my @names = $ins-&gt;list_interfaces<DD>
Returns a list of all interfaces registered as being provided
by the object.
<DT id="17">my @names = $ins-&gt;list_methods($interface)<DD>
Returns a list of all methods registered as being provided
by the object, within the interface <TT>$interface</TT>.
<DT id="18">my @names = $ins-&gt;list_signals($interface)<DD>
Returns a list of all signals registered as being provided
by the object, within the interface <TT>$interface</TT>.
<DT id="19">my @names = $ins-&gt;list_properties($interface)<DD>
Returns a list of all properties registered as being provided
by the object, within the interface <TT>$interface</TT>.
<DT id="20">my @paths = $self-&gt;list_children;<DD>
Returns a list of object paths representing all the children
of this node.
<DT id="21">my $path = $ins-&gt;get_object_path<DD>
Returns the path of the object associated with this introspection
data
<DT id="22">my @types = $ins-&gt;get_method_params($interface, $name)<DD>
Returns a list of declared data types for parameters of the
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
<DT id="23">my @types = $ins-&gt;get_method_param_names($interface, $name)<DD>
Returns a list of declared names for parameters of the
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
<DT id="24">my @types = $ins-&gt;get_method_returns($interface, $name)<DD>
Returns a list of declared data types for return values of the
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
<DT id="25">my @types = $ins-&gt;get_method_return_names($interface, $name)<DD>
Returns a list of declared names for return values of the
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
<DT id="26">my @types = $ins-&gt;get_signal_params($interface, $name)<DD>
Returns a list of declared data types for values associated with the
signal called <TT>$name</TT> within the interface <TT>$interface</TT>.
<DT id="27">my @types = $ins-&gt;get_signal_param_names($interface, $name)<DD>
Returns a list of declared names for values associated with the
signal called <TT>$name</TT> within the interface <TT>$interface</TT>.
<DT id="28">my $type = $ins-&gt;get_property_type($interface, $name)<DD>
Returns the declared data type for property called <TT>$name</TT> within
the interface <TT>$interface</TT>.
<DT id="29">my $bool = $ins-&gt;is_property_readable($interface, $name);<DD>
Returns a true value if the property called <TT>$name</TT> within the
interface <TT>$interface</TT> can have its value read.
<DT id="30">my $bool = $ins-&gt;is_property_writable($interface, $name);<DD>
Returns a true value if the property called <TT>$name</TT> within the
interface <TT>$interface</TT> can have its value written to.
<DT id="31">my $xml = $ins-&gt;format([$obj])<DD>
Return a string containing an <FONT SIZE="-1">XML</FONT> document representing the
state of the introspection data. The optional <TT>$obj</TT> parameter
can be an instance of Net::DBus::Object to include object
specific information in the <FONT SIZE="-1">XML</FONT> (eg child nodes).
<DT id="32">my $xml_fragment = $ins-&gt;to_xml<DD>
Returns a string containing an <FONT SIZE="-1">XML</FONT> fragment representing the
state of the introspection data. This is basically the same
as the <TT>&quot;format&quot;</TT> method, but without the leading doctype
declaration.
<DT id="33">$type = $ins-&gt;to_xml_type($type)<DD>
Takes a text-based representation of a data type and returns
the compact representation used in <FONT SIZE="-1">XML</FONT> introspection data.
<DT id="34">$ins-&gt;encode($message, $type, $name, $direction, @args)<DD>
Append a set of values &lt;@args&gt; to a message object <TT>$message</TT>.
The <TT>$type</TT> parameter is either <TT>&quot;signal&quot;</TT> or <TT>&quot;method&quot;</TT> and
<TT>$direction</TT> is either <TT>&quot;params&quot;</TT> or <TT>&quot;returns&quot;</TT>. The introspection
data will be queried to obtain the declared data types &amp; the
argument marshalling accordingly.
<DT id="35">my @args = $ins-&gt;decode($message, $type, $name, $direction)<DD>
Unmarshalls the contents of a message object <TT>$message</TT>.
The <TT>$type</TT> parameter is either <TT>&quot;signal&quot;</TT> or <TT>&quot;method&quot;</TT> and
<TT>$direction</TT> is either <TT>&quot;params&quot;</TT> or <TT>&quot;returns&quot;</TT>. The introspection
data will be queried to obtain the declared data types &amp; the
arguments unmarshalled accordingly.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHOR</H2>
Daniel P. Berrange
<A NAME="lbAG">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright (C) 2004-2011 Daniel P. Berrange
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
Net::DBus::Exporter, Net::DBus::Binding::Message
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="36"><A HREF="#lbAB">NAME</A><DD>
<DT id="37"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="38"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="39"><A HREF="#lbAE">METHODS</A><DD>
<DT id="40"><A HREF="#lbAF">AUTHOR</A><DD>
<DT id="41"><A HREF="#lbAG">COPYRIGHT</A><DD>
<DT id="42"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:48 GMT, March 31, 2021
</BODY>
</HTML>