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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m
Line 8: Line 8:
 
<!--<idltopic>com.sun.star.lang.XUnoTunnel</idltopic>-->
 
<!--<idltopic>com.sun.star.lang.XUnoTunnel</idltopic>-->
 
The <idl>com.sun.star.lang.XUnoTunnel</idl> interface allows access to the <code>this</code> 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.
 
The <idl>com.sun.star.lang.XUnoTunnel</idl> interface allows access to the <code>this</code> 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.
 
+
<source lang="idl">
 
   interface XUnoTunnel: com::sun::star::uno::XInterface
 
   interface XUnoTunnel: com::sun::star::uno::XInterface
 
   {  
 
   {  
 
       hyper getSomething( [in] sequence< byte > aIdentifier );
 
       hyper getSomething( [in] sequence< byte > aIdentifier );
 
   };  
 
   };  
 
+
</source>
 
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.  
  

Revision as of 20:58, 21 March 2008



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.

Template:Documentation/Note

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools