Difference between revisions of "Documentation/DevGuide/WritingUNO/XUnoTunnel"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Documentation/Developers Guide/Writing UNO Components)
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
|NextPage=Documentation/DevGuide/WritingUNO/Simple Component in Java
 
|NextPage=Documentation/DevGuide/WritingUNO/Simple Component in Java
 
}}
 
}}
 +
{{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:XUnoTunnel}}
 
{{DISPLAYTITLE:XUnoTunnel}}
 
<!--<idltopic>com.sun.star.lang.XUnoTunnel</idltopic>-->
 
<!--<idltopic>com.sun.star.lang.XUnoTunnel</idltopic>-->
Line 16: Line 17:
 
The byte sequence contains an identifier that both the caller and implementer must know. The implementer returns the this pointer of the object if the byte sequence is equal to the byte sequence previously stored in a static variable. The byte sequence is usually generated ''once per process'' per implementation.  
 
The byte sequence contains an identifier that both the caller and implementer must know. The implementer returns the this pointer of the object if the byte sequence is equal to the byte sequence previously stored in a static variable. The byte sequence is usually generated ''once per process'' per implementation.  
  
{{Documentation/Note|Note that the previously mentioned 'per process' is important because the <tt>this</tt> pointer of a class you know is useless, if the instance lives in a different process.}}
+
{{Note|Note that the previously mentioned 'per process' is important because the <tt>this</tt> pointer of a class you know is useless, if the instance lives in a different process.}}
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:Documentation/Developer's Guide/Writing UNO Components]]
 
[[Category:Documentation/Developer's Guide/Writing UNO Components]]

Revision as of 14:48, 4 July 2018



The com.sun.star.lang.XUnoTunnel interface allows access to the this pointer of an object. This interface is used to cast a UNO interface that is coming back to its implementation class through a UNO method. Using this interface is a result of an unsatisfactory interface design, because it indicates that some functionality only works when non-UNO functions are used. In general, these objects cannot be replaced by a different implementation, because they undermine the general UNO interface concept. This interface can be understood as admittance to an already existing code that cannot be split into UNO components easily. If designing new services, do not use this interface.

  interface XUnoTunnel: com::sun::star::uno::XInterface
  { 
      hyper getSomething( [in] sequence< byte > aIdentifier );
  };

The byte sequence contains an identifier that both the caller and implementer must know. The implementer returns the this pointer of the object if the byte sequence is equal to the byte sequence previously stored in a static variable. The byte sequence is usually generated once per process per implementation.

Documentation note.png Note that the previously mentioned 'per process' is important because the this pointer of a class you know is useless, if the instance lives in a different process.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages