| XMP Toolkit SDK 6.0.0

Public Member Functions | Protected Member Functions | List of all members
AdobeXMPCommon::IVersionable Class Reference

Interface that serves as the base interface for all the externally exposed interfaces which needs to provide evolving versions of the interface. More...

`#include <IVersionable.h>`

Inheritance diagram for AdobeXMPCommon::IVersionable:

## Public Member Functions
template<typename requestedInterface >
XMP_PRIVATE requestedInterface * | GetInterfacePointer ()
| Get the raw pointer to an interface object implementing the requested version. More...
template<typename requestedInterface >
const XMP_PRIVATE requestedInterface * | GetInterfacePointer () const
| Get the raw pointer to a const interface object implementing the requested version. More...

## Protected Member Functions
virtual | ~IVersionable ()
| REQ_FRIEND_CLASS_DECLARATION ()

## Detailed Description

Interface that serves as the base interface for all the externally exposed interfaces which needs to provide evolving versions of the interface.

Provide pointer to interface requested by client. Requirements on the class type

1. Need to implement a function GetInterfaceID() returning a unique id for the interface. Only required to be implemented in first version of the interface.
2. Need to implement a function GetVersionNumber() returning the version of the interface. Required to implemented by each version of the interface.

Definition at line 30 of file IVersionable.h.

## Constructor & Destructor Documentation

## ◆ ~IVersionable()

virtual AdobeXMPCommon::IVersionable::~IVersionable | ( |  | ) |
| inline protected virtual

Definition at line 58 of file IVersionable.h.

58 {}

## Member Function Documentation

## ◆ GetInterfacePointer() [1/2]

template<typename requestedInterface >

XMP_PRIVATE requestedInterface* AdobeXMPCommon::IVersionable::GetInterfacePointer | ( |  | ) |
| inline

Get the raw pointer to an interface object implementing the requested version.

Returns
  a raw pointer to an interface object implementing the requested version.

Attention
  In case a particular version number is not supported than an error is thrown.

Definition at line 40 of file IVersionable.h.

40 {
41 pvoid ptr = GetInterfacePointer( requestedInterface::GetInterfaceID(),
42 requestedInterface::GetInterfaceVersion() );
43 return static_cast< requestedInterface * >( ptr );
44 }

Referenced by AdobeXMPCommon::IObjectFactory_v1::MakeObjectFactory().

## ◆ GetInterfacePointer() [2/2]

template<typename requestedInterface >

const XMP_PRIVATE requestedInterface* AdobeXMPCommon::IVersionable::GetInterfacePointer | ( |  | ) | const
| inline

Get the raw pointer to a const interface object implementing the requested version.

Returns
  a raw pointer to a const interface object implementing the requested version.

Attention
  In case a particular version number is not supported than an error is thrown.

Definition at line 53 of file IVersionable.h.

53 {
54 return const_cast< IVersionable * >( this )->GetInterfacePointer< requestedInterface >();
55 }

## ◆ REQ_FRIEND_CLASS_DECLARATION()

AdobeXMPCommon::IVersionable::REQ_FRIEND_CLASS_DECLARATION | ( |  | ) |
| protected

The documentation for this class was generated from the following file:

- public/include/XMPCommon/Interfaces/BaseInterfaces/IVersionable.h

AdobeXMPCommon::pvoid
void * pvoid
Definition: XMPCommonFwdDeclarations.h:46
AdobeXMPCommon::IVersionable::GetInterfacePointer
XMP_PRIVATE requestedInterface * GetInterfacePointer()
Get the raw pointer to an interface object implementing the requested version.
Definition: IVersionable.h:40