Skip to main content
Open topic with navigation CAPL Functions » ISO11783 » Virtual Terminal Interaction Layer (VT IL) » VTIL_GetChildObjectId

VTIL_GetChildObjectId

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

  • long VTIL_GetChildObjectId(dbNode workingSetMaster, dword objectId, dword index, long & childObjectId); // form 1
  • long VTIL_GetChildObjectId(dword addressWorkingSetMaster, dword objectId, dword index, long & childObjectId); // form 2
  • long VTIL_GetChildObjectId(dbNode vt, dbNode workingSetMaster, dword objectId, dword index, long & childObjectId); // form 3
  • long VTIL_GetChildObjectId(dbNode vt, dword addressWorkingSetMaster, dword objectId, dword index, long & childObjectId); // form 4

Description

Returns the ID of an object which is contained by a parent object. You can obtain the number of child objects with method VTIL_GetNumberOfChildObjects.

Parameters

  • vt: VT simulation node to apply the function.
  • workingSetMaster: Working Set Master which provides the Object Pool.
  • addressWorkingSetMaster: Address of the Working Set Master which provides the Object Pool.
  • objectId: Object ID of the parent object.
  • index: Index of the child object in the object list of the parent object. The first index is 0.
  • childObjectId: Returns the ID of the object at the specified index. If there is no child object for the specified index the value of childObjectId is set to -1.

Return Values

  • 0: Function has been executed successfully
  • < 0: An error has occurred, see IL Error Code

Example

Example form 3, 4
dword index, numberOfChildObjects;
long childObjectId;

// iterate over all children of the object with objectId = 1000
if (VTIL_GetNumberOfChildObjects(VT, Loader, 1000, numberOfChildObjects) == 0)
{
  for (index = 0; index < numberOfChildObjects; ++index)
  {
    if (VTIL_GetChildObjectId(VT, Loader, 1000, index, childObjectId) == 0)
    {
      Write("ID of child object at index %u is %i", index, childObjectId);
    }
  }
}