namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
class RuntimeException; class XInterface; class Type; class Any;
/** Enum defining UNO_REF_NO_ACQUIRE for setting reference without acquiring a given interface. Deprecated,pleaseuseSAL_NO_ACQUIRE. @deprecated
*/ enum UnoReference_NoAcquire
{ /** This enum value can be used for creating a reference granting a given interface, i.e.transferringownershiptoit.
*/
UNO_REF_NO_ACQUIRE
};
/** This base class serves as a base class for all template reference classes and hasbeenintroducedduetocompilerproblemswithtemplatedoperators==,=!.
*/ class BaseReference
{ protected: /** the interface pointer
*/
XInterface * _pInterface;
/** Queries given interface for type rType.
@parampInterfaceinterfacepointer @paramrTypeinterfacetype @returninterfaceofdemandedtype(maybenull)
*/ inlinestatic XInterface * SAL_CALL iquery( XInterface * pInterface, const Type & rType ); /** Queries given interface for type rType. ThrowsaRuntimeExceptionifthedemandedinterfacecannotbequeried.
/** Enum defining UNO_QUERY for implicit interface query.
*/ enum UnoReference_Query
{ /** This enum value can be used for implicit interface query.
*/
UNO_QUERY
}; /** Enum defining UNO_QUERY_THROW for implicit interface query. Ifthedemandedinterfaceisunavailable,thenaRuntimeExceptionisthrown.
*/ enum UnoReference_QueryThrow
{ /** This enum value can be used for implicit interface query.
*/
UNO_QUERY_THROW
}; /** Enum defining UNO_SET_THROW for throwing if attempts are made to assign a null interface
/** Template reference class for interface type derived from BaseReference. AspecialconstructorgiventheUNO_QUERYidentifierqueriesinterfaces forreferencetype.
*/ template< class interface_type > class SAL_DLLPUBLIC_RTTI Reference : public BaseReference
{ /** Queries given interface for type interface_type.
@parampInterfaceinterfacepointer @returninterfaceofdemandedtype(maybenull)
*/ inlinestatic XInterface * SAL_CALL iquery( XInterface * pInterface ); /** Queries given interface for type interface_type. ThrowsaRuntimeExceptionifthedemandedinterfacecannotbequeried.
@parampInterfaceinterfacepointer @returninterfaceofdemandedtype
*/ inlinestatic XInterface * SAL_CALL iquery_throw( XInterface * pInterface ); /** Returns the given interface if it is not <NULL/>, throws a RuntimeException otherwise.
/** Constructor: Queries given interface for reference interface type (interface_type).
@paramrRefanotherreference @paramdummyUNO_QUERYtoforceobviousdistinctiontootherconstructors
*/ inline Reference( const BaseReference & rRef, UnoReference_Query dummy ); /** Constructor: Queries given interface for reference interface type (interface_type).
@parampInterfaceaninterfacepointer @paramdummyUNO_QUERYtoforceobviousdistinctiontootherconstructors
*/ inline Reference( XInterface * pInterface, UnoReference_Query dummy); /** Constructor: Queries given any for reference interface type (interface_type).
@paramrAnyanany @paramdummyUNO_QUERYtoforceobviousdistinctiontootherconstructors
*/ inline Reference( const Any & rAny, UnoReference_Query dummy); /** Constructor: Queries given interface for reference interface type (interface_type). ThrowsaRuntimeExceptionifthedemandedinterfacecannotbequeried.
@parampInterfaceaninterfacepointer @paramdummyUNO_QUERY_THROWtoforceobviousdistinction tootherconstructors
*/ inline Reference( XInterface * pInterface, UnoReference_QueryThrow dummy ); /** Constructor: Queries given any for reference interface type (interface_type). ThrowsaRuntimeExceptionifthedemandedinterfacecannotbequeried.
@paramrAnyanany @paramdummyUNO_QUERY_THROWtoforceobviousdistinction tootherconstructors
*/ inline Reference( const Any & rAny, UnoReference_QueryThrow dummy ); /** Constructor: assigns from the given interface of the same type. Throws a RuntimeException ifthesourceinterfaceisNULL.
@sinceUDK3.2.8
*/ inline Reference( const Reference< interface_type > & rRef, UnoReference_SetThrow dummy ); /** Constructor: assigns from the given interface of the same type. Throws a RuntimeException ifthesourceinterfaceisNULL.
/** Clears reference, i.e. releases interface. Reference is null after clear() call.
*/ inlinevoid SAL_CALL clear();
/** Sets the given interface. An interface already set will be released.
@paramrRefanotherreference @returntrue,ifnon-nullinterfacewasset
*/ inlinebool SAL_CALL set( const Reference< interface_type > & rRef ); /** Sets the given interface. An interface already set will be released.
/** Sets interface pointer without acquiring it. An interface already set will be released.
@parampInterfaceaninterfacepointer @paramdummySAL_NO_ACQUIREtoforceobviousdistinctiontosetmethods @returntrue,ifnon-nullinterfacewasset
*/ inlinebool SAL_CALL set( interface_type * pInterface, __sal_NoAcquire dummy); /** Sets interface pointer without acquiring it. An interface already set will be released. Deprecated,pleaseuseSAL_NO_ACQUIREversion.
/** Queries given interface for reference interface type (interface_type) and sets it. Aninterfacealreadysetwillbereleased. ThrowsaRuntimeExceptionifthedemandedinterfacecannotbeset.
@parampInterfaceaninterfacepointer @paramdummyUNO_QUERY_THROWtoforceobviousdistinction tosetmethods
*/ inlinevoid SAL_CALL set( XInterface * pInterface, UnoReference_QueryThrow dummy ); /** Queries given interface for reference interface type (interface_type) and sets it. Aninterfacealreadysetwillbereleased. ThrowsaRuntimeExceptionifthedemandedinterfacecannotbeset.
/** Queries given any for reference interface type (interface_type) and setsit.Aninterfacealreadysetwillbereleased. ThrowsaRuntimeExceptionifthedemandedinterfacecannotbeset.
@paramrAny anAnycontaininganinterface @paramdummy UNO_QUERY_THROWtoforceobviousdistinctiontosetmethods
*/ inlinevoid set( Any const & rAny, UnoReference_QueryThrow dummy); /** sets the given interface Aninterfacealreadysetwillbereleased. ThrowsaRuntimeExceptionifthesourceinterfaceis@bNULL.
@paramrRefaninterfacereference @returnthisreference
*/ inline Reference< interface_type > & operator = ( Reference< interface_type > && rRef ) noexcept; #endif /** Queries given interface reference for type interface_type.
@paramrRefinterfacereference @returninterfacereferenceofdemandedtype(maybenull)
*/
SAL_WARN_UNUSED_RESULT inlinestatic Reference< interface_type > SAL_CALL query( const BaseReference & rRef ); /** Queries given interface for type interface_type.
@parampInterfaceinterfacepointer @returninterfacereferenceofdemandedtype(maybenull)
*/
SAL_WARN_UNUSED_RESULT inlinestatic Reference< interface_type > SAL_CALL query( XInterface * pInterface ); #ifdefined LIBO_INTERNAL_ONLY /** Queries this for the required interface, and returns the requested reference, possibly empty. Asyntacticsugarfor'Reference<other_type>xOther(xThis,UNO_QUERY)'thatavoidssome verbocity.
@returnnewreference
*/ template< class other_type > inline Reference< other_type > query() const; /** Queries this for the required interface, and returns the requested reference, or throws onfailure.Asyntacticsugarfor'Reference<other_type>xOther(xThis,UNO_QUERY_THROW)' thatavoidssomeverbocity.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.