About Storage Objects
A storage object is a type of QuickDraw 3D object that you can use to represent a physical piece of storage in a computer. The piece of storage can be any data that is accessible in a linear, stream-based manner. QuickDraw 3D currently supports three basic types of data storage formats: data stored in memory, data stored in the data fork of a Macintosh file, and data stored in files accessed through the C programming language standard I/O library. QuickDraw 3D represents these data storage devices as storage objects.To read data from (or write data to) a data storage device, you first need to create a storage object of the appropriate type. For example, to read data from a Macintosh file, you can create a Macintosh storage object. You also need to create a file object (of type
TQ3FileObject
) and attach the file object to the storage object. Once you've created a storage object and a file object and attached them to one another, you can then read data from the file object by using file object reading calls. See the chapter "File Objects" for information on creating file objects, attaching them to storage objects, and reading or writing data using those file objects.QuickDraw 3D distinguishes between storage objects and file objects primarily so that you can read and write stored data using a single set of functions. QuickDraw 3D supports only one class of file object, instances of which can be attached to any of the types of storage objects that it supports.
A storage object is of type
TQ3StorageObject
, which is a type of shared object. QuickDraw 3D provides three subclasses of theTQ3StorageObject
type:
- A memory storage object (of type
kQ3StorageTypeMemory
) represents a dynamically allocated block of RAM. You can allocate the block of memory yourself, or you can have QuickDraw 3D allocate a block of memory on your behalf. Memory storage objects are available on all computer systems. QuickDraw 3D supports one subclass of thekQ3StorageTypeMemory
storage object type:
- A handle storage object (of type
kQ3MemoryStorageTypeHandle
) represents a handle to a block of dynamically allocated RAM. On the Macintosh Operating System, QuickDraw 3D uses theSetHandleSize
function when it needs to change the size of the memory block. On operating systems that do not support handles, QuickDraw 3D allocates and maintains the memory blocks internally.
- A Macintosh storage object (of type
kQ3StorageTypeMacintosh
) represents the data fork of a Macintosh file using a file reference number. Macintosh storage objects are available only on the Macintosh Operating System. QuickDraw 3D supports one subclass of thekQ3StorageTypeMacintosh
storage object type:
- A UNIX
¬ storage object (of typekQ3StorageTypeUnix
) represents a file using a structure of typeFILE
. This structure is accessed using the standard I/O library, a collection of functions that provide character I/O and file-manipulation services for C programs on any operating system. The represented object can be a pipe, the standard input file, the standard output file, or any otherFILE
abstraction. QuickDraw 3D supports one subclass of thekQ3StorageTypeUnix
storage object type:
For a description of pointers and handles, see the book Inside Macintosh: Memory. For a description of the Macintosh file-specification methods (that
- IMPORTANT
- UNIX storage objects and UNIX path name storage objects can be used to represent any object accessible through the standard I/O library on any operating system. The names, which can therefore be confusing, derive from the origin of the standard I/O library on the UNIX operating system.
![]()
is, file reference numbers and file system specification structures), see the
book Inside Macintosh: Files. For a description of the standard I/O library,
see the documentation for any UNIX-based computer (for example,
A/UX Essentials from Apple Computer, Inc., or The UNIX Programming Environment by Kernighan and Pike), or any book devoted specifically to C language programming (for example, The C Programming Language by Kernighan and Ritchie).
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help