Skip to content

PhysicalName::AncestorName

Returns the physical name of an ancestor repeated capability.

template <typename TAncestor>
const char* AncestorName() const;

Returns the physical name of an ancestor repeated capability.

Physical names for nested repeated capabilities have the following form:

a1:b2:c3

This function can be used to access the a1 and b2 components of the full physical name.

The parent repeated capability (immediate ancestor) can be accessed more succinctly using the ParentName function.

The following example demonstrates use of the AncestorName function.

ViStatus _VI_FUNC acme4321_ConfigureArmCount(ViSession Vi, ViConstString RepCapIdentifier, ViInt32 ArmCount)
{
// Assume the following nested repeated capability definition exists:
//
// Channel -> Trace -> Marker
//
// where the Channel repeated capability is the highest-level parent repeated capability
//
PhysicalName<Marker> marker("C1:T3:M2");
cout << marker.AncestorName<Channel>(); // prints "C1"
cout << marker.AncestorName<Trace>(); // prints "T3"
}