AAFA Developer Support

Public Member Functions
IAAFTypeDefEnum Interface Reference

This interface is used to define enumerated types used in AAF persistent objects. More...

List of all members.

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.

Detailed Description

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:

Definition at line 28826 of file AAF.idl.


Member Function Documentation

HRESULT IAAFTypeDefEnum::CountElements ( [out] aafUInt32 *  pCount)

Returns number of enumeration elements contained.

Succeeds if:

  • Initialize() has already been called on this object.
  • pCount is a valid pointer.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • pCount arg is NULL.
Parameters:
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:

  • the Name pointer is valid.
  • the ppPropVal pointer is valid.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • ppPropVal arg is NULL.

AAFRESULT_INVALID_PARAM

  • the Name specified is not in the list of legal Enumerations.
Parameters:
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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • pOutValue arg is NULL.

AAFRESULT_BADINDEX

AAFRESULT_SMALLBUF

  • bufSize indicates the buffer is too small to hold the string.
Parameters:
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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NULL_PARAM

  • pLen arg is NULL.

AAFRESULT_BADINDEX

Parameters:
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:

  • Initialize() has already been called on this object.
  • The ppTypeDef pointer is valid.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • ppTypeDef arg is NULL.
Parameters:
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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • pOutValue arg is NULL.

AAFRESULT_BADINDEX

Parameters:
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:

  • The pPropValIn pointer is valid.
  • The pValueOut pointer is valid.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • Either pPropValIn or ppPropValOut arg is NULL.
Parameters:
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:

  • the pLen pointer is valid.
  • the value is associated with an element of this enumerated type.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NULL_PARAM

  • pLen arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • the given value is not associated with an element of this type.
Parameters:
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:

  • the pValue pointer is valid.
  • the pLen pointer is valid.
  • the value is associated with an element of this enumerated type.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NULL_PARAM

  • either pValue or pLen arg is NULL.

AAFRESULT_BAD_PARAM

  • the given value is not associated with an element of this type.
Parameters:
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:

  • the pName pointer is valid.
  • bufSize indicates the buffer is large enough to hold the name.
  • the integer value is associated with an element of this enumerated type.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NULL_PARAM

  • pName arg is NULL.

AAFRESULT_SMALLBUF

  • bufSize indicates the buffer is too small to hold the string.

AAFRESULT_ILLEGAL_VALUE

  • the given value is not associated with an element of this type.
Parameters:
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:

  • the pValue pointer is valid.
  • the pName pointer is valid.
  • bufSize indicates the buffer is large enough to hold the name.
  • the integer value is associated with an element of this enumerated type.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NULL_PARAM

  • either pValue or pName arg is NULL.

AAFRESULT_SMALLBUF

  • bufSize indicates the buffer is too small to hold the string.

AAFRESULT_BAD_PARAM

  • the given value is not associated with an element of this type.
Parameters:
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:

  • Initialize() has not yet been called on this object.
  • pID is a valid pointer.
  • pType is a valid pointer.
  • pElementValues is a valid pointer.
  • pElementNames is a valid pointer.
  • pTypeName is a valid pointer.
  • base type is integral type.
  • no duplicate names or values are found.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_ALREADY_INITIALIZED

AAFRESULT_NULL_PARAM

  • any pointer argument arg is NULL.

AAFRESULT_DUPLICATE

  • duplicate name or value is found.

AAFRESULT_BAD_TYPE

  • base type is not integral type.
Parameters:
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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

Parameters:
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:

  • The pPropValToSet pointer is valid.
  • valueIn is a correct value for this enumerated type.

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

  • succeeded. (This is the only code indicating success.)

AAFRESULT_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • pPropValToSet arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • valueIn is not a correct value for this enumerated type.
  • pPropValIn's type doesn't match GetElementType()
Parameters:
pPropValToSet[in] property value to set
valueIn[in] new value of the enum represented by the given property value

Generated on Wed Jul 4 2012 22:13:31 for AAF COM API by doxygen 1.7.4