12 #ifndef K_API_OBJECT_H
13 #define K_API_OBJECT_H
15 #include <kApi/kObject.x.h>
101 return xkObject_CloneImpl(
object, source, allocator);
169 return xkObject_DestroyImpl(
object,
kFALSE);
197 return xkObject_DestroyImpl(
object,
kTRUE);
239 xkObject_RawVerifyTag(
object) &&
kType_Is(obj->type, type);
256 return xkObject_VTable(
object)->VEquals(
object, other);
271 return xkObject_VTable(
object)->VHashCode(
object);
302 return xkObject_VTable(
object)->VHasForeignData(
object);
318 return xkObject_VTable(
object)->VSize(
object);
366 obj->tag = xkOBJECT_TAG;
536 return xkHashPointer(
object);
555 return (
object == other);
kStatus kObject_VRelease(kObject object)
Protected virtual method that deallocates any resources owned by the object.
Definition: kObject.h:448
kType kObject_Type(kObject object)
Returns the type of the object.
Definition: kObject.h:214
kAlloc kObject_Alloc(kObject object)
Gets the memory allocator associated with this object.
Definition: kObject.h:286
kBool kObject_Equals(kObject object, kObject other)
Determines whether the object is equal to another object.
Definition: kObject.h:254
kSize kObject_HashCode(kObject object)
Gets a hash code representing the state of this object.
Definition: kObject.h:269
#define kIsNull(POINTER)
Tests for equality with null pointer.
Definition: kApiDef.h:339
kBool kObject_Is(kObject object, kType type)
Determines whether this object is an instance of the specified type.
Definition: kObject.h:234
k32s kAtomic32s_Increment(kAtomic32s *atomic)
Increments an atomic variable.
Definition: kAtomic.h:50
kStatus kObject_Init(kObject object, kType type, kAlloc alloc)
Protected method called by derived classes to initialize the kObject base class.
Definition: kObject.h:359
kBool kObject_VHasForeignData(kObject object)
Protected virtual method that reports whether the object, including aggregated child elements...
Definition: kObject.h:498
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kObject_Share(kObject object)
Increments the reference count associated with this object.
Definition: kObject.h:119
kSize kObject_VHashCode(kObject object)
Protected virtual method that calculates a hash code representing the object instance.
Definition: kObject.h:534
kStatus kAlloc_Free(kAlloc alloc, void *mem)
Frees a block of memory.
Definition: kAlloc.h:84
kStatus kObject_FreeMemRef(kObject object, void *mem)
Protected method called by derived classes to free memory (and reset the provided memory pointer to k...
Definition: kObject.h:430
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
kStatus kObject_Clone(kObject *object, kObject source, kAlloc allocator)
Constructs a new object by copying an existing object, including any aggregated child elements...
Definition: kObject.h:97
#define kTRUE
Boolean true.
Definition: kApiDef.h:354
kBool kObject_IsShared(kObject object)
Reports whether the object is currently shared (reference count greater than one).
Definition: kObject.h:337
kStatus kObject_VInitClone(kObject object, kObject source, kAlloc allocator)
Protected virtual method that clones (makes a deep copy of) the specified source object.
Definition: kObject.h:470
#define kObj(TypeName_T, T_object)
Declares a local "obj" (this-pointer) variable and initializes it from a type-checked object handle...
Definition: kApiDef.h:2921
#define kObjR(TypeName_T, T_object)
Declares a local "obj" (this-pointer) variable and initializes it from an object handle, without type-checking.
Definition: kApiDef.h:2933
Supports reclaiming objects upon destruction.
Core Zen type declarations.
kBool kObject_HasForeignData(kObject object)
Reports whether the object, including aggregated child elements, contains any foreign memory referenc...
Definition: kObject.h:300
kStatus kAlloc_FreeRef(kAlloc alloc, void *mem)
Frees a block of memory and sets the memory pointer to kNULL.
Definition: kAlloc.h:97
kStatus kObject_Destroy(kObject object)
Destroys the object.
Definition: kObject.h:165
#define kERROR_UNIMPLEMENTED
Feature not implemented.
Definition: kApiDef.h:492
Represents metadata about a type (class, interface, or value).
kBool kObject_VEquals(kObject object, kObject other)
Protected virtual method that compares two objects for equality.
Definition: kObject.h:553
kStatus kObject_Dispose(kObject object)
Destroys the object and any aggregated child elements.
Definition: kObject.h:193
kStatus kObject_SetPool(kObject object, kObjectPool pool)
Sets the object pool associated with this object.
Definition: kObject.h:140
kSize kType_InnerSize(kType type)
Gets the internal size of a type.
Definition: kType.h:321
kSize kObject_Size(kObject object)
Estimates the memory consumed by this object, including any aggregated child elements.
Definition: kObject.h:316
#define kOK
Operation successful.
Definition: kApiDef.h:513
void kAtomic32s_Init(kAtomic32s *atomic, k32s value)
Initializes an atomic variable with a particular value.
Definition: kAtomic.h:36
Represents an error code.
kStatus kObject_GetMem(kObject object, kSize size, void *mem)
Protected method called by derived classes to allocate memory using the object's allocator.
Definition: kObject.h:384
#define kNULL
Null pointer.
Definition: kApiDef.h:267
kStatus kAlloc_Get(kAlloc alloc, kSize size, void *mem)
Allocates a block of memory.
Definition: kAlloc.h:37
kStatus kObject_GetMemZero(kObject object, kSize size, void *mem)
Protected method called by derived classes to allocate and zero memory using the object's allocator...
Definition: kObject.h:400
kBool kType_Is(kType type, kType other)
Determines whether a type is equivalent to another type.
Definition: kType.h:89
kStatus kObject_VDisposeItems(kObject object)
Protected virtual method that destroys any aggregated child objects associated with a collection...
Definition: kObject.h:486
Represents a boolean value.
#define kFALSE
Boolean false.
Definition: kApiDef.h:353
kStatus kAlloc_GetZero(kAlloc alloc, kSize size, void *mem)
Allocates a block of memory and zero-initializes the block.
Definition: kAlloc.h:51
kStatus kObject_FreeMem(kObject object, void *mem)
Protected method called by derived classes to free memory using the object's allocator.
Definition: kObject.h:415
k32s kAtomic32s_Get(kAtomic32s *atomic)
Gets the current value of an atomic variable.
Definition: kAtomic.h:111
kSize kObject_VSize(kObject object)
Protected virtual method that calculates the total size (in bytes) of the object instance.
Definition: kObject.h:517