| XMP Toolkit SDK 6.0.0

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
AdobeXMPCommon::IConfigurable Class Referenceabstract

Interface that allows to attach various key-value parameters to the underlying object. More...

`#include <IConfigurable.h>`

Inheritance diagram for AdobeXMPCommon::IConfigurable:

## Classes
union | CombinedDataValue
| A union data type to store all kind of values. More...

## Public Types
enum | eDataType { kDTNone = 0, kDTBool = 1 << 0, kDTUint64 = 1 << 1, kDTInt64 = 1 << 2, kDTChar = 1 << 3, kDTDouble = 1 << 4, kDTConstCharBuffer = 1 << 5, kDTConstVoidPtr = 1 << 6, kDTAll = 0xFFFFFFFF }
| Indicates various types of parameter values. More...

## Public Member Functions
virtual bool APICALL | RemoveParameter (const uint64 &key)=0
| Removes a particular parameter if present. More...
virtual std::vector< uint64 > APICALL | GetAllParameters () const =0
| Get all the keys of the parameters associated with the object. More...
virtual sizet APICALL | Size () const __NOTHROW__=0
| Get the number of parameters associated with the object. More...
virtual eDataType APICALL | GetDataType (const uint64 &key) const =0
| Get the value type of a particular parameter. More...
virtual void APICALL | SetParameter (const uint64 &key, bool value)=0
| Add/Change a value of a parameter. More...
virtual void APICALL | SetParameter (const uint64 &key, uint64 value)=0
virtual void APICALL | SetParameter (const uint64 &key, int64 value)=0
virtual void APICALL | SetParameter (const uint64 &key, double value)=0
virtual void APICALL | SetParameter (const uint64 &key, char value)=0
virtual void APICALL | SetParameter (const uint64 &key, const char *value)=0
virtual void APICALL | SetParameter (const uint64 &key, const void *value)=0
virtual bool APICALL | GetParameter (const uint64 &key, bool &value) const =0
| Get the value of a parameter if present. More...
virtual bool APICALL | GetParameter (const uint64 &key, uint64 &value) const =0
virtual bool APICALL | GetParameter (const uint64 &key, int64 &value) const =0
virtual bool APICALL | GetParameter (const uint64 &key, double &value) const =0
virtual bool APICALL | GetParameter (const uint64 &key, char &value) const =0
virtual bool APICALL | GetParameter (const uint64 &key, const char *&value) const =0
virtual bool APICALL | GetParameter (const uint64 &key, const void *&value) const =0

## Static Public Member Functions
static uint64 | ConvertCharBufferToUint64 (const char *key)
| Utility function to convert character buffer ( maximum of 8 characters ) to uint64 representation. More...

## Protected Member Functions
virtual | ~IConfigurable () __NOTHROW__
| REQ_FRIEND_CLASS_DECLARATION ()

## Friends
class | IConfigurableProxy

## Detailed Description

Interface that allows to attach various key-value parameters to the underlying object.

Key is an unsigned 64-bit integer value which can be a char buffer of eight characters also.

Note
  For all value types except user data ( const void * ) or char buffer ( const char * ) a copy is made and is stored, so the scope is maintained internally. But for user data ( const void * ) or char buffer ( const char * ) its clients responsibility to make sure these pointers remain valid through out the life span of the object or objects derived from it.

Definition at line 32 of file IConfigurable.h.

## Member Enumeration Documentation

## ◆ eDataType

enum AdobeXMPCommon::IConfigurable::eDataType

Indicates various types of parameter values.

Enumerator
kDTNone | Data type is none. Data type is boolean.
kDTBool | Data type is unsigned 64 bit integer.
kDTUint64 | Data type is signed 64 bit integer.
kDTInt64 | Data type is character.
kDTChar | Data type is double.
kDTDouble | Data type is char buffer.
kDTConstCharBuffer | Data type is user data ( pointer to const void ).
kDTConstVoidPtr | Maximum value this enum can hold.
kDTAll |

Definition at line 39 of file IConfigurable.h.

39 {
41 kDTNone = 0,
43 kDTBool = 1 << 0,
45 kDTUint64 = 1 << 1,
47 kDTInt64 = 1 << 2,
49 kDTChar = 1 << 3,
51 kDTDouble = 1 << 4,
53 kDTConstCharBuffer = 1 << 5,
55 kDTConstVoidPtr = 1 << 6,
56
58 kDTAll = 0xFFFFFFFF
59 } eDataType;

## Constructor & Destructor Documentation

## ◆ ~IConfigurable()

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

protected Virtual Destructor

Definition at line 173 of file IConfigurable.h.

173 {};

## Member Function Documentation

## ◆ ConvertCharBufferToUint64()

static uint64 AdobeXMPCommon::IConfigurable::ConvertCharBufferToUint64 | ( | const char * | key | ) |
| inline static

Utility function to convert character buffer ( maximum of 8 characters ) to uint64 representation.

Parameters

  [in] | key | A pointer to const char buffer, maximum characters used are 8 provided there is no null character present in the buffer between 1st to 8 characters, otherwise characters upto NULL character (excluding NULL) are read.

Returns
  A 64-bit unsigned integer representing the first 8 characters of the character buffer.

Note
  Return 0 in case key is NULL.

Definition at line 134 of file IConfigurable.h.

134 {
135 uint64 keyAsuint64 = 0;
136 if ( key ) {
137 for ( int i = 0; i < 8 && key[ i ] != '\0'; i++ ) {
138 keyAsuint64 = keyAsuint64 << 8;
139 keyAsuint64 += ( unsigned char ) key[ i ];
140 }
141 }
142 return keyAsuint64;
143 }

## ◆ GetAllParameters()

virtual std::vector< uint64 > APICALL AdobeXMPCommon::IConfigurable::GetAllParameters | ( |  | ) | const
| pure virtual

Get all the keys of the parameters associated with the object.

Provide a std::vector containing the keys of all the parameters associated with the object.

Returns
  A std::vector of unsigned 64 bit integers.

## ◆ GetDataType()

virtual eDataType APICALL AdobeXMPCommon::IConfigurable::GetDataType | ( | const uint64 & | key | ) | const
| pure virtual

Get the value type of a particular parameter.

Parameters

  [in] | key | An unsigned 64 bit integer value indicating the key.

Returns
  A value of type eDataType indicating the type of value the parameter is supposed to hold.

Note
  return kDTNone in case no such key is associated with the object.

## ◆ GetParameter() [1/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | bool & | value
| ) |  | const
| pure virtual

Get the value of a parameter if present.

Parameters

  [in] | key | An unsigned 64 bit integer value indicating the key.
  [out] | value | The value of the parameter.

Returns
  false if no such parameter is present, otherwise true.

Attention
  Error is thrown in case the type of the parameter is not the one client is asking for.

## ◆ GetParameter() [2/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | char & | value
| ) |  | const
| pure virtual

## ◆ GetParameter() [3/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | const char *& | value
| ) |  | const
| pure virtual

## ◆ GetParameter() [4/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | const void *& | value
| ) |  | const
| pure virtual

## ◆ GetParameter() [5/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | double & | value
| ) |  | const
| pure virtual

## ◆ GetParameter() [6/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | int64 & | value
| ) |  | const
| pure virtual

## ◆ GetParameter() [7/7]

virtual bool APICALL AdobeXMPCommon::IConfigurable::GetParameter | ( | const uint64 & | key,
|  | uint64 & | value
| ) |  | const
| pure virtual

## ◆ RemoveParameter()

virtual bool APICALL AdobeXMPCommon::IConfigurable::RemoveParameter | ( | const uint64 & | key | ) |
| pure virtual

Removes a particular parameter if present.

Parameters

  [in] | key | An unsigned 64 bit integer value indicating the key.

Returns
  True in case key was present and is deleted.

Attention
  Error is thrown in case
  - key is a must have for the underlying object.

## ◆ REQ_FRIEND_CLASS_DECLARATION()

AdobeXMPCommon::IConfigurable::REQ_FRIEND_CLASS_DECLARATION | ( |  | ) |
| protected

## ◆ SetParameter() [1/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | bool | value
| ) |  |
| pure virtual

Add/Change a value of a parameter.

Parameters

  [in] | key | An unsigned 64 bit integer value indicating the key.
  [in] | value | New value of the parameter.

Attention
  Error is thrown in case
  - the previous type of value associated with key is of different type.
  - the type of value associated with key is not as expected.

## ◆ SetParameter() [2/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | char | value
| ) |  |
| pure virtual

## ◆ SetParameter() [3/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | const char * | value
| ) |  |
| pure virtual

## ◆ SetParameter() [4/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | const void * | value
| ) |  |
| pure virtual

## ◆ SetParameter() [5/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | double | value
| ) |  |
| pure virtual

## ◆ SetParameter() [6/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | int64 | value
| ) |  |
| pure virtual

## ◆ SetParameter() [7/7]

virtual void APICALL AdobeXMPCommon::IConfigurable::SetParameter | ( | const uint64 & | key,
|  | uint64 | value
| ) |  |
| pure virtual

## ◆ Size()

virtual sizet APICALL AdobeXMPCommon::IConfigurable::Size | ( |  | ) | const
| pure virtual

Get the number of parameters associated with the object.

## Friends And Related Function Documentation

## ◆ IConfigurableProxy

friend class IConfigurableProxy
| friend

Definition at line 173 of file IConfigurable.h.

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

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

AdobeXMPCommon::IConfigurable::kDTConstCharBuffer
@ kDTConstCharBuffer
Data type is user data ( pointer to const void ).
Definition: IConfigurable.h:53
AdobeXMPCommon::IConfigurable::kDTChar
@ kDTChar
Data type is double.
Definition: IConfigurable.h:49
AdobeXMPCommon::IConfigurable::kDTUint64
@ kDTUint64
Data type is signed 64 bit integer.
Definition: IConfigurable.h:45
AdobeXMPCommon::IConfigurable::kDTBool
@ kDTBool
Data type is unsigned 64 bit integer.
Definition: IConfigurable.h:43
AdobeXMPCommon::IConfigurable::kDTInt64
@ kDTInt64
Data type is character.
Definition: IConfigurable.h:47
AdobeXMPCommon::IConfigurable::kDTNone
@ kDTNone
Data type is none.
Definition: IConfigurable.h:41
AdobeXMPCommon::IConfigurable::kDTDouble
@ kDTDouble
Data type is char buffer.
Definition: IConfigurable.h:51
AdobeXMPCommon::IConfigurable::kDTAll
@ kDTAll
Definition: IConfigurable.h:58
AdobeXMPCommon::IConfigurable::eDataType
eDataType
Indicates various types of parameter values.
Definition: IConfigurable.h:39
AdobeXMPCommon::IConfigurable::kDTConstVoidPtr
@ kDTConstVoidPtr
Maximum value this enum can hold.
Definition: IConfigurable.h:55
AdobeXMPCommon::uint64
XMP_Uns64 uint64
Definition: XMPCommonDefines.h:172