Click or drag to resize

PhysicalName Constructor

Constructs a new instance of a PhysicalName object from a full name specification.

PhysicalName(const char* szFullName);
PhysicalName(std::string strFullName = std::string());
Parameters
szFullName, strFullName

[in] The full physical name of the desired repeated capability instance.

Remarks

For a nested repeated capability, the name used to create the PhysicalName instance must include the full name of the parent instance. The name must not include any qualified repeated capability names (i.e. Channel!!C1).

If the name supplied does not have the same number of levels of hierarchy as the repeated capability with which the PhysicalName is associated, then this constructor will assert at runtime in debug builds and yield unpredictable results in release builds.

For example, for a repeated capability with no parents, the name supplied here would simply be something such as the following:

C1

By constrast, for a repeated capability that is nested two levels deep (it has a parent and a "grandparent" repeated capability), the name supplied must be of the following form:

C1:T1:M1

It would be an error to construct an instance of such a repeated capability using only M1 or T1:M1.

Example

The following example demonstrates how to properly construct a PhysicalName object.

C++
ViStatus _VI_FUNC acme4321_ConfigureArmCount(ViSession Vi, ViConstString RepCapIdentifier, ViInt32 ArmCount)
{
    // For the following to work, the Channel repeated capability must be non-nested
    // 
    PhysicalName<Channel> channel("C1");

    // Assume the Trace repeated capabilty is defined as a child of the Channel repeated capability
    // 
    PhysicalName<Trace> trace1("T1");     // WRONG!! WRONG!! -- runtime assert because "T1" can exist within multiple parent
                                          // Channel instances, so the desired parent channel must be specified.

    PhysicalName<Trace> trace2("C1:T1");  // Correctly constructs a "T1" instance of the Trace repeated capability
}

Download a complete CHM version of this documentation here.