![]() | DriverSession::VirtualNameMappings |
Returns a map of virtual names to physical names for all virtual names loaded from the IVI Configuration Store when the driver was initialized.
virtual const VirtualNameMap& VirtualNameMappings() const; const VirtualNameMap& VirtualNameMappings(ViSession Vi);
[in] ViSession handle for the driver session.
Returns a map of virtual names to physical names for all virtual names loaded from the IVI Configuration Store when the driver was initialized.
If the ResourceName parameter passed to the init or InitWithOptions function does not map to a logcal name or driver session in the IVI Configuration Store, then this map will be empty.
The VirtualNameMap class returned here is simply an alias for a standard std::map with case-insensitive name lookup.
This function allows access to all of the virtual-to-physical name mappings at once. It is more common to need to translate individual virtual names to physical names and to translate individual physical names to virtual names. This functionality is provided by the TranslateVirtualName and TranslatePhysicalName functions. See the documentation for those functions for further information.
The following code demonstrates how to use the GetDriverSetupOption function:
ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency) { auto mappings = VirtualNameMappings(Vi); auto it = mappings.find("MyVirtualName"); if (it != std::end(mappings)) { printf(it->second.c_str()); // prints the physical name mapped to "MyVirtualName" in the config store } // ... }