APIDb_​InitCreationOrderTableID

Initializes an internal table for fast access of the next element in creation order.

    GSErrCode ACAPI_Database (
        APIDb_InitCreationOrderTableID,
        API_ElemFilter*     elemFilter
    );

 

Parameters

elemFilter
[in] Optional parameter, can be nullptr. Use this filter to leave out element types from the access table.

 

Return Values

NoError
The function has completed with success.
APIERR_MEMFULL
The internal creation order table cannot be allocated.
APIERR_NESTING
Internal access table initializations cannot be nested, i.e. you should dispose the previously allocated table before initializing a new one.

For other common API errors see the API Errors document.

 

Remarks

This function is used to set up an internal table which allows fast access to the next element in creation order (an ordering more or less equal to the unique ID ordering in previous versions).

 

Example

static void  PrintGuidsInCreationOrder (void)
{
    if (ACAPI_Database (APIDb_InitCreationOrderTableID, nullptr, nullptr) == NoError) {
        API_Guid guid = APINULLGuid;
        while ((ACAPI_Database (APIDb_CreationOrderGetNextID, &guid, nullptr) == NoError) &&
               (guid != GS::NULLGuid))
        {
            ACAPI_WriteReport (APIGuid2GSGuid (guid).ToUniString ().ToCStr (), false);
        }
        ACAPI_Database (APIDb_DisposeCreationOrderTableID, nullptr, nullptr);
    }

    return;
}

 

Requirements

Version: API 11.01 or later
Header: APIdefs_Database.h

 

See Also

ACAPI_Database, APIDb_CreationOrderGetNextID, APIDb_DisposeCreationOrderTableID, API Functions