Struct XrPath
The XrPath is an atom that connects an application with a single path, within the context of a single instance. There is a bijective mapping between well-formed path strings and atoms in use. This atom is used — in place of the path name string it corresponds to — to retrieve state and perform other operations.
As an XrPath is only shorthand for a well-formed path string, they have no explicit life cycle.
Lifetime is implicitly managed by the XrInstance.An XrPath must not be used unless it is received at execution time from the runtime in the context of a particular XrInstance. Therefore, with the exception of XR_NULL_PATH, XrPath values must not be specified as constant values in applications: the corresponding path string should be used instead.During the lifetime of a given XrInstance, the XrPath associated with that instance with any given well-formed path must not vary, and similarly the well-formed path string that corresponds to a given XrPath in that instance must not vary.An XrPath that is received from one XrInstance may not be used with another. Such an invalid use may be detected and result in an error being returned, or it may result in undefined behavior.
Well-written applications should typically use a small, bounded set of paths in practice.However, the runtime should support looking up the XrPath for a large number of path strings for maximum compatibility. Runtime implementers should keep in mind that applications supporting diverse systems may look up path strings in a quantity exceeding the number of non-empty entities predicted or provided by any one runtime’s own path tree model, and this is not inherently an error. However, system resources are finite and thus runtimes may signal exhaustion of resources dedicated to these associations under certain conditions.
When discussing the behavior of runtimes at these limits, a new XrPath refers to an XrPath value that, as of some point in time, has neither been received by the application nor tracked internally by the runtime.In this case, since an application has not yet received the value of such an XrPath, the runtime has not yet made any assertions about its association with any path string. In this context, new only refers to the fact that the mapping has not necessarily been made constant for a given value/path string pair for the remaining life of the associated instance by being revealed to the application.It does not necessarily imply creation of the entity, if any, referred to by such a path.Similarly, it does not imply the absence of such an entity prior to that point. Entities in the path tree have varied lifetime that is independent from the duration of the mapping from path string to XrPath.
For flexibility, the runtime may internally track or otherwise make constant, in instance or larger scope, any mapping of a path string to an XrPath value even before an application would otherwise receive that value, thus making it no longer new by the above definition.
When the runtime’s resources to track the path string-XrPath mapping are exhausted, and the application makes an API call that would have otherwise retrieved a new XrPath as defined above, the runtime must return XR_ERROR_PATH_COUNT_EXCEEDED.This includes both explicit calls to xrStringToPath as well as other calls that retrieve an XrPath in any other way.
Assembly: VIVE.OpenXR.dll
Syntax
public struct XrPath : IEquatable<ulong>
Constructors
XrPath(ulong)
Declaration
Parameters
Type |
Name |
Description |
ulong |
u |
|
Methods
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
Equals(ulong)
Declaration
public bool Equals(ulong other)
Parameters
Type |
Name |
Description |
ulong |
other |
|
Returns
Equals(XrPath)
Declaration
public bool Equals(XrPath other)
Parameters
Type |
Name |
Description |
XrPath |
other |
|
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator +(XrPath, XrPath)
Declaration
public static XrPath operator +(XrPath a, XrPath b)
Parameters
Returns
operator /(XrPath, XrPath)
Declaration
public static XrPath operator /(XrPath a, XrPath b)
Parameters
Returns
operator ==(XrPath, XrPath)
Declaration
public static bool operator ==(XrPath a, XrPath b)
Parameters
Returns
operator >(XrPath, XrPath)
Declaration
public static bool operator >(XrPath a, XrPath b)
Parameters
Returns
operator >=(XrPath, XrPath)
Declaration
public static bool operator >=(XrPath a, XrPath b)
Parameters
Returns
implicit operator XrPath(ulong)
Declaration
public static implicit operator XrPath(ulong u)
Parameters
Type |
Name |
Description |
ulong |
u |
|
Returns
implicit operator ulong(XrPath)
Declaration
public static implicit operator ulong(XrPath equatable)
Parameters
Type |
Name |
Description |
XrPath |
equatable |
|
Returns
operator !=(XrPath, XrPath)
Declaration
public static bool operator !=(XrPath a, XrPath b)
Parameters
Returns
operator <(XrPath, XrPath)
Declaration
public static bool operator <(XrPath a, XrPath b)
Parameters
Returns
operator <=(XrPath, XrPath)
Declaration
public static bool operator <=(XrPath a, XrPath b)
Parameters
Returns
operator *(XrPath, XrPath)
Declaration
public static XrPath operator *(XrPath a, XrPath b)
Parameters
Returns
operator -(XrPath, XrPath)
Declaration
public static XrPath operator -(XrPath a, XrPath b)
Parameters
Returns
Implements