|
Zen API
|
Root of all value types in the kType system.
Value types represent structures, enumerations, and primitive values. The kValue base type defines methods that can be called on any value instance.
Inherited by k16s, k16u, k32f, k32s, k32u, k64f, k64s, k64u, k8s, k8u, kArgb, kBool, kByte, kCallback, kCfa, kChar, kComparison, kDebugAllocation, kFileMode, kHttpStatus, kIpAddress, kIpEndPoint, kIpEntry, kIpVersion, kPixelFormat, kPoint16s, kPoint16s, kPoint16s, kPoint16s, kPoint16s, kPoint3d16s, kPoint3d32f, kPoint3d64f, kPointer, kRect16s, kRect32f, kRect32s, kRect64f, kRgb, kRotatedRect32f, kRotatedRect32s, kSeekOrigin, kSize, kSocketType, kSSize, kStatus, kText128, kText16, kText256, kText32, kText64, kTypeFlag, and kVersion.
Public Member Functions | |
| kBool | kValue_Equals (kType type, const void *value, const void *other) |
| Determines whether a value is equal to another value. More... | |
| kSize | kValue_HashCode (kType type, const void *value) |
| Gets a hash code representing the state of this value. More... | |
| void | kValue_Import (kType type, void *value, const void *source) |
| Imports the content of another value into this value. More... | |
Determines whether a value is equal to another value.
The default implementation of this method uses type reflection to compare the values field by field. This approach is not efficient, and in some cases may not produce the desired result. Value types should override this method if it is likely that equality comparisons will be required.
| type | Value type. |
| value | Pointer to value. |
| other | Pointer to other value. |
Gets a hash code representing the state of this value.
The default implementation of this method uses type reflection to generate a hash code that combines the hash codes from individual fields. This approach is not efficient, and may not produce an optimal hash code. Value types should override this method if it is likely that hash codes will be required.
| type | Value type. |
| value | Pointer to value. |
| void kValue_Import | ( | kType | type, |
| void * | value, | ||
| const void * | source | ||
| ) |
Imports the content of another value into this value.
This method supports importing content from an external source, which may have a different size. In particular, "array value" types such as kText32 can import from a null-terminated source array of a differnt length.
| type | Value type. |
| value | Pointer to value. |
| source | Source for import. |