AAFA Developer Support

Public Member Functions
IAAFTypeDefRecord Interface Reference

This interface is used to define C-like structured types used in AAF persistent objects. More...

List of all members.

Public Member Functions

HRESULT Initialize ([in, ref] aafUID_constref id,[in, size_is(numMembers)] IAAFTypeDef **ppMemberTypes,[in, size_is(numMembers)] aafString_t *pMemberNames,[in] aafUInt32 numMembers,[in] aafCharacter_constptr pTypeName)
 Initializes this type def to be identified by the given guid, and to contain the given members (types and names).
HRESULT GetMemberType ([in] aafUInt32 index,[out] IAAFTypeDef **ppTypeDef)
 Returns the type definition of the indexed member in this record type.
HRESULT GetMemberName ([in] aafUInt32 index,[out, size_is(bufSize), string] aafCharacter *pName,[in] aafUInt32 bufSize)
 Writes the human-legible tag associated with the indexed member in this record type.
HRESULT GetMemberNameBufLen ([in] aafUInt32 index,[out] aafUInt32 *pLen)
 Returns the length of buffer required for the GetMemberName() method.
HRESULT CreateValueFromValues ([in, size_is(numMembers)] IAAFPropertyValue **pMemberValues,[in] aafUInt32 numMembers,[out] IAAFPropertyValue **ppPropVal)
 Creates a property value which contains a record type.
HRESULT CreateValueFromStruct ([in, size_is(initDataSize)] aafMemPtr_t pInitData,[in] aafUInt32 initDataSize,[out] IAAFPropertyValue **ppPropVal)
 Creates a property value which contains a record type.
HRESULT GetValue ([in] IAAFPropertyValue *pInPropVal,[in] aafUInt32 index,[out] IAAFPropertyValue **ppOutPropVal)
 Gets a single property value corresponding to the indicated record member.
HRESULT GetStruct ([in] IAAFPropertyValue *pPropVal,[out, size_is(dataSize)] aafMemPtr_t pData,[in] aafUInt32 dataSize)
 Copies all the member data contained in the given property value, interpreted as a record of this type, into the struct pointed to by pData.
HRESULT SetValue ([in] IAAFPropertyValue *pPropVal,[in] aafUInt32 index,[in] IAAFPropertyValue *pMemberPropVal)
 Sets the value of the single, indicated record member of the record contained in pPropVal, to the value contained in pMemberPropVal.
HRESULT SetStruct ([in] IAAFPropertyValue *pPropVal,[in, size_is(dataSize)] aafMemPtr_t pData,[in] aafUInt32 dataSize)
 Copies all the member data contained in the struct pointed to by pData into the given property value, interpreting the data as a record of this type.
HRESULT GetCount ([out] aafUInt32 *pCount)
 Returns number of members in this record type.
HRESULT RegisterMembers ([in] aafUInt32 *pOffsets,[in] aafUInt32 numMembers,[in] aafUInt32 structSize)
 Allows client to register to the reference implementation a runtime C struct to represent objects of this TypeDef.

Detailed Description

This interface is used to define C-like structured types used in AAF persistent objects.

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 IAAFTypeDefRecord also implement the following interfaces:

Definition at line 31364 of file AAF.idl.


Member Function Documentation

HRESULT IAAFTypeDefRecord::CreateValueFromStruct ( [in, size_is(initDataSize)] aafMemPtr_t  pInitData,
[in] aafUInt32  initDataSize,
[out] IAAFPropertyValue **  ppPropVal 
)

Creates a property value which contains a record type.

The record members in the property value are initialized from data in a struct which is pointed to by pInitData. Requires that the structure pointed to by pInitData has had its offsets registered with this type. Returns the newly-created property value in ppPropVal.

Succeeds if all of the following are true:

  • the pInitData pointer is valid.
  • the ppPropVal pointer is valid.
  • initDataSize indicates pInitData is the correct size.
  • compile-time struct has had its member offests registered.

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

  • either pInitData or ppPropVal arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • initDataSize indicates pInitData is of the wrong size.

AAFRESULT_NOT_REGISTERED

  • struct offsets have not yet been registered for this typedef.
Parameters:
pInitData[in, size_is(initDataSize)] pointer to compile-time struct containing data to use
initDataSize[in] size of data in pInitData
ppPropVal[out] newly created property value
HRESULT IAAFTypeDefRecord::CreateValueFromValues ( [in, size_is(numMembers)] IAAFPropertyValue **  pMemberValues,
[in] aafUInt32  numMembers,
[out] IAAFPropertyValue **  ppPropVal 
)

Creates a property value which contains a record type.

The record members in the property value are initialized to contain the given values, passed in the pMemberValues array. numMembers, which indicates the size of the pMemberValues array, must match the value returned by GetCount(). Returns the newly-created property value in ppPropVal.

Succeeds if all of the following are true:

  • the pMemberValues pointer is valid.
  • the ppPropVal pointer is valid.
  • numMembers matches the number of members in this record.

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

  • either pMemberValues or ppPropVal arg is NULL.

AAFRESULT_ILLEGAL_VALUE

Parameters:
pMemberValues[in, size_is(numMembers)] array of property values for members of record value which is to be created.
numMembers[in] size of pMemberValues array.
ppPropVal[out] newly-created property value
HRESULT IAAFTypeDefRecord::GetCount ( [out] aafUInt32 *  pCount)

Returns number of members in this record type.

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 members in this record type
HRESULT IAAFTypeDefRecord::GetMemberName ( [in] aafUInt32  index,
[out, size_is(bufSize), string] aafCharacter *  pName,
[in] aafUInt32  bufSize 
)

Writes the human-legible tag associated with the indexed member in this record type.

Index is zero-based, and must be less than the value returned by GetCount(). 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 GetMemberNameBufLen() 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.

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_NOT_INITIALIZED

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 integer value is not associated with a member of this type.
Parameters:
index[in] zero-based index into members in this record type
pName[out, size_is(bufSize), string] buffer into which the member name is written
bufSize[in] The size of the pName buffer, in bytes
HRESULT IAAFTypeDefRecord::GetMemberNameBufLen ( [in] aafUInt32  index,
[out] aafUInt32 *  pLen 
)

Returns the length of buffer required for the GetMemberName() method.

Index is zero-based, and must be less than the value returned by GetCount(). 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 integer value is associated with a member 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_NOT_INITIALIZED

AAFRESULT_NULL_PARAM

  • pLen arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • the given integer value is not associated with a member of this type.
Parameters:
index[in] zero-based index into members in this record type
pLen[out] required buffer length, in bytes
HRESULT IAAFTypeDefRecord::GetMemberType ( [in] aafUInt32  index,
[out] IAAFTypeDef **  ppTypeDef 
)

Returns the type definition of the indexed member in this record type.

Index is zero-based, and must be less than the value returned by GetCount().

Succeeds if:

  • Initialize() has already been called on this object.
  • the index exists in this record type def.
  • 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.

AAFRESULT_ILLEGAL_VALUE

  • The given index is out of range for this record type def.
Parameters:
index[in] zero-based index into members in this record type
ppTypeDef[out] type definition of indexed member
HRESULT IAAFTypeDefRecord::GetStruct ( [in] IAAFPropertyValue pPropVal,
[out, size_is(dataSize)] aafMemPtr_t  pData,
[in] aafUInt32  dataSize 
)

Copies all the member data contained in the given property value, interpreted as a record of this type, into the struct pointed to by pData.

Requires that the struct pointed to by pData has had its offsets registered with this type.

Succeeds if all of the following are true:

  • the pPropVal pointer is valid.
  • the pData pointer is valid.
  • dataSize indicates pData is large enough to hold the data.
  • compile-time struct has had its member offests registered.

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

  • either pPropVal or pData arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • dataSize indicates pData is too small.

AAFRESULT_NOT_REGISTERED

  • struct offsets have not yet been registered for this typedef.
Parameters:
pPropVal[in] property value to read
pData[out, size_is(dataSize)] buffer into which struct data should be written
dataSize[in] size of pData buffer in bytes
HRESULT IAAFTypeDefRecord::GetValue ( [in] IAAFPropertyValue pInPropVal,
[in] aafUInt32  index,
[out] IAAFPropertyValue **  ppOutPropVal 
)

Gets a single property value corresponding to the indicated record member.

Places a property value representing the record member identified by the index into ppOutPropval. Index is zero-based, and must be less than the value returned by GetCount().

Succeeds if:

  • Initialize() has already been called on this object.
  • the index exists in this record type def.
  • The pInPropVal pointer is valid.
  • The ppOutPropVal 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 pInPropVal or ppOutPropVal arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • The given index is out of range for this record type def.
Parameters:
pInPropVal[in] property value to read
index[in] zero-based index into members in this record type
ppOutPropVal[out] value that is read
HRESULT IAAFTypeDefRecord::Initialize ( [in, ref] aafUID_constref  id,
[in, size_is(numMembers)] IAAFTypeDef **  ppMemberTypes,
[in, size_is(numMembers)] aafString_t *  pMemberNames,
[in] aafUInt32  numMembers,
[in] aafCharacter_constptr  pTypeName 
)

Initializes this type def to be identified by the given guid, and to contain the given members (types and names).

It is considered an error if multiple members have the same name. Note that it is only possible to use certain types as member types. Those permissible types include:

  • AAFTypeDefInt
  • AAFTypeDefRecord
  • AAFTypeDefEnum
  • AAFTypeDefExtEnum
  • AAFTypeDefFixedArray

Succeeds if:

  • Initialize() has not yet been called on this object.
  • pID is a valid pointer.
  • pMemberTypes is a valid pointer.
  • pMemberNames is a valid pointer.
  • pTypeName is a valid pointer.
  • all specified member types are permissible for use in a Record.
  • all member names are unique.

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

  • pMemberTypes, pMemberNames, or pTypeName arg is NULL.

AAFRESULT_BAD_TYPE

  • an illegal member type was given.

AAFRESULT_DUPLICATE

  • a duplicate member name was given.
Parameters:
id[in, ref] auid to be used to identify this type
ppMemberTypes[in, size_is(numMembers)] array of member types to be represented in this record type
pMemberNames[in, size_is(numMembers)] array of member names to be represented in this enumerated type
numMembers[in] number of members in pMemberInfo array
pTypeName[in] friendly name of this type definition
HRESULT IAAFTypeDefRecord::RegisterMembers ( [in] aafUInt32 *  pOffsets,
[in] aafUInt32  numMembers,
[in] aafUInt32  structSize 
)

Allows client to register to the reference implementation a runtime C struct to represent objects of this TypeDef.

Offsets for each member in the struct are passed in as an array of integers; size indicates the number of members in the array. The offset is given in bytes from the start address of the struct. This allows the reference implementation to write property values into compile-time-defined C structs intelligible by the local machine and compiler.

Succeeds if:

  • Initialize() has already been called on this object.
  • pOffsets is a valid pointer.
  • numMembers matches the number of members defined for this record type.
  • all types of the fields in this record already have their offsets registered.

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

  • pOffsets arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • numMembers does not match number of members in this record type.

AAFRESULT_NOT_REGISTERED

  • The type of any field in this record has not yet had its offsets registered.

AAFRESULT_DEFAULT_ALREADY_USED

  • The default registration for this type has already been used to persist or unpersist a property containing this type.
Parameters:
pOffsets[in] array containing offset for each record member
numMembers[in] number of members in pOffsets
structSize[in] size of this struct
HRESULT IAAFTypeDefRecord::SetStruct ( [in] IAAFPropertyValue pPropVal,
[in, size_is(dataSize)] aafMemPtr_t  pData,
[in] aafUInt32  dataSize 
)

Copies all the member data contained in the struct pointed to by pData into the given property value, interpreting the data as a record of this type.

Requires that the struct pointed to by pData has had its offsets registered with this type.

Succeeds if all of the following are true:

  • the pPropVal pointer is valid.
  • the pData pointer is valid.
  • dataSize indicates pData contains the correct amount of data.
  • compile-time struct has had its member offests registered.

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

  • either pPropVal or pData arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • dataSize indicates pData is not the correct size.

AAFRESULT_NOT_REGISTERED

  • struct offsets have not yet been registered for this typedef.
Parameters:
pPropVal[in] property value to write
pData[in, size_is(dataSize)] buffer from which struct data should be read
dataSize[in] size of pData buffer in bytes
HRESULT IAAFTypeDefRecord::SetValue ( [in] IAAFPropertyValue pPropVal,
[in] aafUInt32  index,
[in] IAAFPropertyValue pMemberPropVal 
)

Sets the value of the single, indicated record member of the record contained in pPropVal, to the value contained in pMemberPropVal.

Index is zero-based, and must be less than the value returned by GetCount().

Succeeds if:

  • Initialize() has already been called on this object.
  • the index exists in this record type def.
  • The pInPropVal pointer is valid.
  • The ppOutPropVal 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 pInPropVal or ppOutPropVal arg is NULL.

AAFRESULT_ILLEGAL_VALUE

  • The given index is out of range for this record type def.
Parameters:
pPropVal[in] property value to write
index[in] zero-based index into members in this record type
pMemberPropVal[in] value to be placed into this record

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