Returns the internal, low-level handle of the DataType object, used for internal engine communication and advanced debugging.
Product:
Class:
Warning
uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.
Returns the internal handle of the DataType object. While typed as a DataType for convenience, it represents an opaque identifier whose numeric value is not guaranteed to be consistent across application runs.
This method retrieves the internal handle of a DataType object. Handles are opaque, pointer-like identifiers used by the uCalc library to manage instances. This is primarily intended for advanced debugging and internal diagnostics.
A handle is a unique, low-level identifier for a specific DataType instance in memory. Its actual numeric value is unpredictable and can change every time the application runs. It should not be stored or used for serialization.
For a stable and predictable identifier, use MemoryIndex instead.
Handle vs. MemoryIndex| Feature | Handle | MemoryIndex |
|---|---|---|
| Stability | Volatile. Changes between application runs. | Stable. Predictable and sequential. |
| Uniqueness | Guaranteed unique for the object's lifetime. | Can be recycled after an object is released. |
| Purpose | Low-level object identification for the C++ core. | High-level diagnostics and tracking object lifetime. |
| Use Case | Advanced debugging. | Identifying specific instances for logging or in diagnostic tools. |
In C# or C++, you might think of a handle as being similar to an IntPtr or a raw pointer (void*). It refers to a specific memory location managed by the uCalc engine. However, unlike raw pointers, the uCalc handle is managed within the uCalc ecosystem. The key takeaway for developers is to use MemoryIndex for any form of stable identification and to treat the Handle as a transient, internal-only value.
This page last modified on: