GNUstep CoreBase Library 0.2
Data Structures | Macros | Enumerations | Functions
Runtime Utilities

Detailed Description

Examples:
Creating a CF opaque type (EXUInt32)
Warning
The CFRuntime functions are not thread-safe.

Data Structures

struct  CFRuntimeClass
 
struct  CFRuntimeBase
 
struct  __CFRuntimeBase._flags
 

Macros

#define INIT_CFRUNTIME_BASE(...)   { 0, 0, { 1, 0, 0 } }
 
#define CF_HAS_INIT_STATIC_INSTANCE   1
 

Enumerations

enum  { _kCFRuntimeNotATypeID = 0 }
 
enum  { _kCFRuntimeScannedObject = (1UL<<0) , _kCFRuntimeResourcefulObject = (1UL<<2) , _kCFRuntimeCustomRefCount = (1UL<<3) }
 

Functions

CFTypeID _CFRuntimeRegisterClass (const CFRuntimeClass *const cls)
 
const CFRuntimeClass * _CFRuntimeGetClassWithTypeID (CFTypeID typeID)
 
void _CFRuntimeUnregisterClassWithTypeID (CFTypeID typeID)
 
CFTypeRef _CFRuntimeCreateInstance (CFAllocatorRef allocator, CFTypeID typeID, CFIndex extraBytes, unsigned char *category)
 
void _CFRuntimeSetInstanceTypeID (CFTypeRef cf, CFTypeID typeID)
 
void _CFRuntimeInitStaticInstance (void *memory, CFTypeID typeID)
 

Garbage Collection

Garbage Collection is not supported. All macros and functions relating to GC return false or NULL, but are provided for compatibility.

Boolean kCFUseCollectableAllocator
 
Boolean(* __CFObjCIsCollectable )(void *)
 
#define CF_USING_COLLECTABLE_MEMORY   (kCFUseCollectableAllocator)
 
#define CF_IS_COLLECTABLE_ALLOCATOR(allocator)   0
 
#define CF_IS_COLLECTABLE(obj)   0
 

Data Structure Documentation

◆ __CFRuntimeBase

struct __CFRuntimeBase
Data Fields
void * _isa

The Objective-C class for this object. Used for the Objective-C bridge. For internal use only.

SInt16 _typeID
struct __CFRuntimeBase._flags _flags

◆ __CFRuntimeBase._flags

struct __CFRuntimeBase._flags
Data Fields
SInt16 ro: 1
SInt16 reserved: 7
SInt16 info: 8

Function Documentation

◆ _CFRuntimeRegisterClass()

CFTypeID _CFRuntimeRegisterClass ( const CFRuntimeClass *const  cls)

Registers a new CF class with the runtime. This function locks the class table and so is thread-safe.

Parameters
clsA constant CFRuntimeClass.
Returns
The next available CFTypeID or _kCFRuntimeNotATypeID if none are available.
See also
_CFRuntimeUnregisterClassWithTypeID()
Examples
EXUInt32.c.

◆ _CFRuntimeGetClassWithTypeID()

const CFRuntimeClass * _CFRuntimeGetClassWithTypeID ( CFTypeID  typeID)

Gets the class structure associated with the typeID.

Parameters
typeIDA CFTypeID to look up.
Returns
The CFRuntimeClass for the typeID

◆ _CFRuntimeUnregisterClassWithTypeID()

void _CFRuntimeUnregisterClassWithTypeID ( CFTypeID  typeID)

Unregisters a class.

Parameters
typeIDThe CFTypeID to unregister.
See also
_CFRuntimeRegisterClass()
Warning
This function is not thread-safe.

◆ _CFRuntimeCreateInstance()

CFTypeRef _CFRuntimeCreateInstance ( CFAllocatorRef  allocator,
CFTypeID  typeID,
CFIndex  extraBytes,
unsigned char *  category 
)

Creates a new CF type instance.

Parameters
allocatorThe CFAllocatorRef to use or NULL for the default allocator.
typeIDThe CFTypeID of the class.
extraBytesThe amount of extra bytes over a CFRuntimeBase type needed by this instance.
categoryCurrently unused, use NULL.
Returns
A newly allocated object.
See also
CFRetain()
CFRelease()
Examples
EXUInt32.c.

◆ _CFRuntimeSetInstanceTypeID()

void _CFRuntimeSetInstanceTypeID ( CFTypeRef  cf,
CFTypeID  typeID 
)

Set the CFTypeID for an instance.

Parameters
cfThe object instance to set the type ID.
typeIDThe new CFTypeID.

◆ _CFRuntimeInitStaticInstance()

void _CFRuntimeInitStaticInstance ( void *  memory,
CFTypeID  typeID 
)

Initializes a static CF object instance.

Parameters
memoryA pointer to a static CF object instance.
typeIDThe CFTypeID of the instance.