This interface is used to define enumerated types used in AAF persistent objects. More...
Public Member Functions | |
HRESULT | Initialize ([in, ref] aafUID_constref id,[in] IAAFTypeDef *pType,[in, size_is(numElems)] aafInt64 *pElementValues,[in, size_is(numElems)] aafString_t *pElementNames,[in] aafUInt32 numElems,[in] aafCharacter_constptr pTypeName) |
Initializes this type def to be identified by the given guid, to be implemented as the given data type, and to contain the given elements (names and values). | |
HRESULT | CreateValueFromName ([in] aafCharacter_constptr Name,[out] IAAFPropertyValue **ppPropVal) |
Creates a property value which contains an Enum type. | |
HRESULT | GetElementType ([out] IAAFTypeDef **ppTypeDef) |
Returns the type definition of the values which are found in this enumeration. | |
HRESULT | GetElementValue ([in] aafUInt32 index,[out] aafInt64 *pOutValue) |
Gets the indexed element in this enumerated type. | |
HRESULT | GetElementName ([in] aafUInt32 index,[out, size_is(bufSize)] aafCharacter *pOutValue,[in] aafUInt32 bufSize) |
Gets the indexed element in this enumerated type. | |
HRESULT | GetElementNameBufLen ([in] aafUInt32 index,[out] aafUInt32 *pLen) |
Returns the length of buffer required for the GetElementName() method, in bytes. | |
HRESULT | CountElements ([out] aafUInt32 *pCount) |
Returns number of enumeration elements contained. | |
HRESULT | GetNameFromValue ([in] IAAFPropertyValue *pValue,[out, size_is(bufSize), string] aafCharacter *pName,[in] aafUInt32 bufSize) |
Writes the human-legible tag associated with the given value in this enumerated type. | |
HRESULT | GetNameBufLenFromValue ([in] IAAFPropertyValue *pValue,[out] aafUInt32 *pLen) |
Returns the length of buffer required for the GetNameFromValue() method, in bytes. | |
HRESULT | GetNameFromInteger ([in] aafInt64 value,[out, size_is(bufSize), string] aafCharacter *pName,[in] aafUInt32 bufSize) |
Writes the human-legible tag associated with the given value in this enumerated type. | |
HRESULT | GetNameBufLenFromInteger ([in] aafInt64 value,[out] aafUInt32 *pLen) |
Returns the length of buffer required for the GetNameFromInteger() method, in bytes. | |
HRESULT | GetIntegerValue ([in] IAAFPropertyValue *pPropValIn,[out] aafInt64 *pValueOut) |
Gets the value from the given property value and writes it as an integer into *pValueOut. | |
HRESULT | SetIntegerValue ([in] IAAFPropertyValue *pPropValToSet,[in] aafInt64 valueIn) |
Sets the given property to the value given in pValueIn. | |
HRESULT | RegisterSize ([in] aafUInt32 enumSize) |
Allows client to register to the reference implementation a runtime C enum to represent objects of this TypeDef. |
This interface is used to define enumerated types used in AAF persistent objects.
Enumerated types are assumed to be based on integers of no larger than 64 bits.
In addition to the specific error results listed for each method, all methods in this interface may also return one of the following values:
AAFRESULT_NOMEMORY
Objects that implement IAAFTypeDefEnum also implement the following interfaces:
HRESULT IAAFTypeDefEnum::CountElements | ( | [out] aafUInt32 * | pCount | ) |
Returns number of enumeration elements contained.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
pCount | [out] count of elements within this enumeration |
HRESULT IAAFTypeDefEnum::CreateValueFromName | ( | [in] aafCharacter_constptr | Name, |
[out] IAAFPropertyValue ** | ppPropVal | ||
) |
Creates a property value which contains an Enum type.
A lookup on the Name is done to find a match in the list of legal enumerations for this type. If the Name specified is not found to exist then an INVALID_PARAM error code is returned. If it succeeds then a newly-created property value in ppPropVal is returned.
Succeeds if all of the following are true:
If this method fails nothing will be written to *ppPropVal.
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
AAFRESULT_INVALID_PARAM
Name | [in] the Name of a valid Enum symbol |
ppPropVal | [out] newly created property value |
HRESULT IAAFTypeDefEnum::GetElementName | ( | [in] aafUInt32 | index, |
[out, size_is(bufSize)] aafCharacter * | pOutValue, | ||
[in] aafUInt32 | bufSize | ||
) |
Gets the indexed element in this enumerated type.
The Name is written into the client-allocated *pOutValue. The bufSize argument should be large enough to hold the pOutValue. Index must be less than the value returned by CountElements().
Caller may call GetElementNameBufLen() to determine the required buffer size.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
AAFRESULT_BADINDEX
AAFRESULT_SMALLBUF
index | [in] index of element to retrieve |
pOutValue | [out, size_is(bufSize)] requested value |
bufSize | [in] The size of the pOutValue buffer in bytes |
HRESULT IAAFTypeDefEnum::GetElementNameBufLen | ( | [in] aafUInt32 | index, |
[out] aafUInt32 * | pLen | ||
) |
Returns the length of buffer required for the GetElementName() method, in bytes.
The value is placed into the location specified by pLen. The value will include space required for the trailing null character.
Succeeds if the following is true:
If this method fails nothing will be written to *pLen.
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_BADINDEX
index | [in] index of element to retrieve |
pLen | [out] required buffer length, in bytes |
HRESULT IAAFTypeDefEnum::GetElementType | ( | [out] IAAFTypeDef ** | ppTypeDef | ) |
Returns the type definition of the values which are found in this enumeration.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
ppTypeDef | [out] type definition of values of this enumeration |
HRESULT IAAFTypeDefEnum::GetElementValue | ( | [in] aafUInt32 | index, |
[out] aafInt64 * | pOutValue | ||
) |
Gets the indexed element in this enumerated type.
The value is written into the client-allocated *pOutValue. Index must be less than the value returned by CountElements().
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
AAFRESULT_BADINDEX
index | [in] index of element to retrieve |
pOutValue | [out] requested value |
HRESULT IAAFTypeDefEnum::GetIntegerValue | ( | [in] IAAFPropertyValue * | pPropValIn, |
[out] aafInt64 * | pValueOut | ||
) |
Gets the value from the given property value and writes it as an integer into *pValueOut.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
pPropValIn | [in] property value to read |
pValueOut | [out] value of the enum represented by the given input property value |
HRESULT IAAFTypeDefEnum::GetNameBufLenFromInteger | ( | [in] aafInt64 | value, |
[out] aafUInt32 * | pLen | ||
) |
Returns the length of buffer required for the GetNameFromInteger() method, in bytes.
The value is placed into the location specified by pLen. The value will include space required for the trailing null character.
Succeeds if all of the following are true:
If this method fails nothing will be written to *pLen.
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_ILLEGAL_VALUE
value | [in] value of element to get |
pLen | [out] required buffer length, in bytes |
HRESULT IAAFTypeDefEnum::GetNameBufLenFromValue | ( | [in] IAAFPropertyValue * | pValue, |
[out] aafUInt32 * | pLen | ||
) |
Returns the length of buffer required for the GetNameFromValue() method, in bytes.
The value is placed into the location specified by pLen. The value will include space required for the trailing null character.
Succeeds if all of the following are true:
If this method fails nothing will be written to *pLen.
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_BAD_PARAM
pValue | [in] value of element to get |
pLen | [out] required buffer length, in bytes |
HRESULT IAAFTypeDefEnum::GetNameFromInteger | ( | [in] aafInt64 | value, |
[out, size_is(bufSize), string] aafCharacter * | pName, | ||
[in] aafUInt32 | bufSize | ||
) |
Writes the human-legible tag associated with the given value in this enumerated type.
The name is written, with a trailing null character, into the pName buffer. The buffer is allocated by the caller. The size of the buffer is given by bufSize.
Caller may call GetNameBufLenFromInteger() to determine the required buffer size.
Succeeds if all of the following are true:
If this method fails nothing will be written to pName.
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_SMALLBUF
AAFRESULT_ILLEGAL_VALUE
value | [in] value of element to get |
pName | [out, size_is(bufSize), string] buffer into which the element name is written |
bufSize | [in] The size of the pName buffer, in bytes |
HRESULT IAAFTypeDefEnum::GetNameFromValue | ( | [in] IAAFPropertyValue * | pValue, |
[out, size_is(bufSize), string] aafCharacter * | pName, | ||
[in] aafUInt32 | bufSize | ||
) |
Writes the human-legible tag associated with the given value in this enumerated type.
The name is written, with a trailing null character, into the pName buffer. The buffer is allocated by the caller. The size of the buffer is given by bufSize.
Caller may call GetNameBufLenFromValue() to determine the required buffer size.
Succeeds if all of the following are true:
If this method fails nothing will be written to pName.
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_SMALLBUF
AAFRESULT_BAD_PARAM
pValue | [in] value of element to get |
pName | [out, size_is(bufSize), string] buffer into which the element name is written |
bufSize | [in] The size of the pName buffer, in bytes |
HRESULT IAAFTypeDefEnum::Initialize | ( | [in, ref] aafUID_constref | id, |
[in] IAAFTypeDef * | pType, | ||
[in, size_is(numElems)] aafInt64 * | pElementValues, | ||
[in, size_is(numElems)] aafString_t * | pElementNames, | ||
[in] aafUInt32 | numElems, | ||
[in] aafCharacter_constptr | pTypeName | ||
) |
Initializes this type def to be identified by the given guid, to be implemented as the given data type, and to contain the given elements (names and values).
The given data type must be an integral type. It is considered an error if multiple elements have the same name or the same value. The values and names are given in parallel arrays, each of which has numElements elements.
This method must be called after allocation, and before any other method can be called.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_ALREADY_INITIALIZED
AAFRESULT_NULL_PARAM
AAFRESULT_DUPLICATE
AAFRESULT_BAD_TYPE
id | [in, ref] auid to be used to identify this type |
pType | [in] Type of values in this enumeration. Has to be of type Int |
pElementValues | [in, size_is(numElems)] array of element values to be represented in this enumerated type |
pElementNames | [in, size_is(numElems)] array of element names to be represented in this enumerated type |
numElems | [in] number of members in pElementValues and pElementNames arrays |
pTypeName | [in] friendly name of this type definition |
HRESULT IAAFTypeDefEnum::RegisterSize | ( | [in] aafUInt32 | enumSize | ) |
Allows client to register to the reference implementation a runtime C enum to represent objects of this TypeDef.
The size of the enum to be represented should be passed as the enumSize argument. This allows the reference implementation to write property values into compile-time-defined C enums intelligible by the local machine and compiler.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
enumSize | [in] size of this enum |
HRESULT IAAFTypeDefEnum::SetIntegerValue | ( | [in] IAAFPropertyValue * | pPropValToSet, |
[in] aafInt64 | valueIn | ||
) |
Sets the given property to the value given in pValueIn.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NOT_INITIALIZED
AAFRESULT_NULL_PARAM
AAFRESULT_ILLEGAL_VALUE
pPropValToSet | [in] property value to set |
valueIn | [in] new value of the enum represented by the given property value |