|
Zen API
|
Represents an instance of a value type as an object.
kBox provides a simple way to represent a single value (e.g. k32s) using a kObject-derived class instance. This approach can sometimes be used to reduce duplicated effort when both reference types and value types must be supported.
kBox supports the kObject_Clone and kObject_Size methods.
kBox supports the kdat5 and kdat6 serialization protocols.

Public Member Functions | |
| kStatus | kBox_Allocate (kBox box, kType itemType) |
| Reallocates the internal box item buffer. More... | |
| kStatus | kBox_Assign (kBox box, kBox source) |
| Copies the value contained within the source box into this box. More... | |
| kStatus | kBox_Construct (kBox *box, kType itemType, kAlloc allocator) |
| Constructs a kBox object. More... | |
| void * | kBox_Data (kBox box) |
| Returns a pointer to the box item buffer. More... | |
| kStatus | kBox_Item (kBox box, void *item) |
| Gets the box value. More... | |
| kSize | kBox_ItemSize (kBox box) |
| Returns the box item size. More... | |
| kType | kBox_ItemType (kBox box) |
| Returns the box item type. More... | |
| kStatus | kBox_SetItem (kBox box, const void *item) |
| Sets the box value. More... | |
| kStatus | kBox_Zero (kBox box) |
| Sets all box element bits to zero. More... | |
Public Member Functions inherited from kObject | |
| kAlloc | kObject_Alloc (kObject object) |
| Gets the memory allocator associated with this object. More... | |
| kStatus | kObject_Clone (kObject *object, kObject source, kAlloc allocator) |
| Constructs a new object by copying an existing object, including any aggregated child elements. More... | |
| kStatus | kObject_Destroy (kObject object) |
| Destroys the object. More... | |
| kStatus | kObject_Dispose (kObject object) |
| Destroys the object and any aggregated child elements. More... | |
| kBool | kObject_Equals (kObject object, kObject other) |
| Determines whether the object is equal to another object. More... | |
| kSize | kObject_HashCode (kObject object) |
| Gets a hash code representing the state of this object. More... | |
| kBool | kObject_Is (kObject object, kType type) |
| Determines whether this object is an instance of the specified type. More... | |
| kBool | kObject_IsShared (kObject object) |
| Reports whether the object is currently shared (reference count greater than one). More... | |
| kStatus | kObject_SetPool (kObject object, kObjectPool pool) |
| Sets the object pool associated with this object. More... | |
| kStatus | kObject_Share (kObject object) |
| Increments the reference count associated with this object. More... | |
| kSize | kObject_Size (kObject object) |
| Estimates the memory consumed by this object, including any aggregated child elements. More... | |
| kType | kObject_Type (kObject object) |
| Returns the type of the object. More... | |
Related | |
| #define | kBox_ItemType_(BOX) kxBox_ItemType_(BOX) |
| Macro version of kBox_ItemType. | |
| #define | kBox_ItemSize_(BOX) kxBox_ItemSize_(BOX) |
| Macro version of kBox_ItemSize. | |
| #define | kBox_Data_(BOX) kxBox_Data_(BOX) |
| Macro version of kBox_Data. | |
| #define | kBox_As_(BOX, TYPE) kxBox_As_(BOX, TYPE) |
| Accesses the box value and casts the value to the specified type. More... | |
Related inherited from kObject | |
| #define | kObject_Type_(OBJ) kxObject_Type_(OBJ) |
| Macro version of kObject_Type. | |
| #define | kObject_Is_(OBJ, TYPE) kxObject_Is_(OBJ, TYPE) |
| Macro version of kObject_Is. | |
| #define | kObject_Alloc_(OBJ) kxObject_Allocator_(OBJ) |
| Macro version of kObject_Alloc. | |