Mac Developer Library

Developer

DRCoreObject.h Reference

Options
Deployment Target:

On This Page
Language:

DRCoreObject.h Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import DiscRecording

Objective-C

@import DiscRecording;

Base types for Disc Recording Core object references.

These types are for use in polymorphic functions and as general-purpose type identifiers.

Included Headers

  • <CoreServices/CoreServices.h>

  • <AvailabilityMacros.h>

Functions

  • Maps a framework key to a localized string.

    Declaration

    Swift

    func DRCopyLocalizedStringForValue(_ value: CFString!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef DRCopyLocalizedStringForValue ( CFStringRef value );

    Parameters

    value

    The key/string to be localized

    Return Value

    A value of type CFStringRef which contains the localized string.

    Discussion

    If a localized string cannot be found, this function returns the specified value as a string

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.5 and later.

  • Gets the Disc Recording object's reference context value.

    Declaration

    Swift

    func DRGetRefCon(_ ref: DRType!) -> UnsafeMutablePointer<Void>

    Objective-C

    void * DRGetRefCon ( DRTypeRef ref );

    Parameters

    ref

    A generic reference to any Disc Recording object whose refCon value you want to get.

    Return Value

    The value currently stored in the Disc Recording object's reference context.

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

  • Sets the Disc Recording object's reference context value.

    Declaration

    Swift

    func DRSetRefCon(_ ref: DRType!, _ refCon: UnsafeMutablePointer<Void>, _ callbacks: UnsafePointer<DRRefConCallbacks>)

    Objective-C

    void DRSetRefCon ( DRTypeRef ref, void *refCon, const DRRefConCallbacks *callbacks );

    Parameters

    ref

    A generic reference to any Disc Recording object whose reference context you want to set.

    refCon

    The reference context value to set for the Disc Recording object. If the the Disc Recording object's reference context is not NULL when a new value is set, the previous refCon value will be released using the release callback previously set, if any. The new refCon value will be retained by the Disc Recording object using the retain callback previously set, if any.

    You may pass a value of NULL, which results in the Disc Recording object having no value in its reference context.

    callbacks

    A pointer to a DRRefConCallbacks structure initialized with the callbacks for the Disc Recording object to use on its reference context. A copy of the contents of the callbacks structure is made, so that a pointer to a structure on the stack can be passed in, or can be reused for multiple object references.

    If the structure's version field does not contain a known value, this function's behavior is undefined. The retain field may be NULL, in which case the Disc Recording object will not retain the reference context when set. The release field may also be NULL, in which case the Disc Recording object will not release its reference context when the object is destroyed or when a new reference context value is set.

    If this parameter itself is NULL, this function behaves as if a valid structure of version 0 and with all fields NULL had been passed in.

    If any of the callback structure's fields are not valid pointers to functions of the correct type, or if this parameter is not a valid pointer to a DRRefConCallbacks callbacks structure, this function's behavior is undefined.

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

Callbacks

  • A callback used by a Disc Recording object to relinquish ownership of its refCon (reference context) data.

    Declaration

    Swift

    typealias DRRefConReleaseCallback = CFunctionPointer<((UnsafePointer<Void>) -> Void)>

    Objective-C

    typedef void ( *DRRefConReleaseCallback)( const void *refCon);

    Discussion

    If you name your function MyDRRefConReleaseCallback, you would declare it like this:

    • void MyDRRefConReleaseCallback (void *refCon);

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

  • A callback used by a Disc Recording object to obtain ownership of its refCon (reference context) data.

    Declaration

    Swift

    typealias DRRefConRetainCallback = CFunctionPointer<((UnsafePointer<Void>) -> UnsafePointer<Void>)>

    Objective-C

    typedef const void* ( *DRRefConRetainCallback)( const void *refCon);

    Discussion

    If you name your function MyDRRefConRetainCallback, you would declare it like this:

    • void MyDRRefConRetainCallback (void *refCon);

    This callback returns the value to store as the reference context for a Disc Recording object, typically the refCon parameter passed to the callback -- but your callback may return any value as the reference context.

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

Data Types

See the Overview section above for header-level documentation.

  • An untyped, generic reference to any Disc Recording object.

    Declaration

    Swift

    typealias DRTypeRef = DRType

    Objective-C

    typedef CFTypeRef DRTypeRef;

    Discussion

    DRTypeRef is one of the base types defined in Disc Recording, used as a placeholder for parameter and return type in several polymorphic functions. It is a generic object reference that can take a reference to any other Disc Recording object.

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

  • Contains a set of callbacks for use by a Disc Recording object in managing its reference context.

    Declaration

    Objective-C

    struct DRRefConCallbacks { unsigned long version; DRRefConRetainCallback retain; DRRefConReleaseCallback release; };

    Fields

    version

    The version of this structure. The value must be a known version, or zero.

    retain

    An optional callback used by a Disc Recording object to retain its reference context. When NULL, the Disc Recording object will not retain the reference context when set.

    release

    An optional callback used by a Disc Recording object to remove a retain previously added for its reference context. When NULL, the Disc Recording objecting will not release its reference context when the object is destroyed or when a new reference context value is set.

Constants

See the Overview section above for header-level documentation.

  • Declaration

    Swift

    let kDRRefConCFTypeCallbacks: DRRefConCallbacks

    Objective-C

    extern const DRRefConCallbacks kDRRefConCFTypeCallbacks;

    Constants

    • kDRRefConCFTypeCallbacks

      kDRRefConCFTypeCallbacks

      A predefined DRRefConCallbacks structure containing a set of callbacks appropriate for use when the reference context is a CFType object.

      Available in OS X v10.2 and later.