Copyright ©1995 by NeXT Computer, Inc. All Rights Reserved.
IXStoreDirectory |
Inherits From: | Object | |
Conforms To: | IXBlockAndStoreAccess IXNameAndFileAccess | |
Declared In: | btree/IXStoreDirectory.h |
Class Description |
An IXStoreDirectory provides access to store clients by name instead of by block handle. You can use this facility for more convenient access to objects within a single IXStore. It's particularly useful in implementing the IXNameAndFileAccess protocol, which is used to support a conventional store file organization. See the IXNameAndFileAccess protocol specification for more information on the conventional store file organization. This class specification also assumes that you know about store clients, which are described in the IXBlockAndStoreAccess protocol specification. |
Instance Variables |
None declared in this class. |
Adopted Protocols |
IXBlockAndStoreAccess | ![]() |
![]() ![]() + freeFromBlock:inStore: ![]() |
IXNameAndFileAccess | ![]() |
![]() ![]() + freeFromName:andFile: ![]() |
Method Types |
Adding entries or objects | ![]() |
![]() ![]() |
Removing entries | ![]() |
![]() ![]() ![]() |
Getting entries | ![]() |
![]() ![]() ![]() ![]() |
Instance Methods |
addEntryNamed:forObject: |
![]() |
Associates anObject with aName. anObject must conform to the IXBlockAndStoreAccess protocol, and must be a client of the same IXStore as the IXStoreDirectory. Returns the newly created instance, or nil if an entry already exists with the specified name.
Use this method to associate a name with an existing and instantiated store client. If you want to associate a name with a store client that has already been created, but isn't currently instantiated (that is, its data exists in the IXStore, but there's no run-time object accessing it), use addEntryNamed:ofClass:atBlock:. If you want to immediately create a new store client and associate a name with it, use addEntryNamed:ofClass:. If aName is NULL or empty, anObject doesn't respond to getBlock:andStore:, or anObject isn't a client of the same IXStore as the IXStoreDirectory, IX_ArgumentError is raised. See also: |
addEntryNamed:ofClass: |
![]() |
Creates an instance of class aClass, initializes it by sending initInStore: (an IXBlockAndStoreAccess protocol method), and associates it with aName. Returns the newly created instance.
If an entry already exists for aName, IX_DuplicateError is raised. If aName is NULL or empty, or if instances of aClass don't respond to initInStore:, IX_ArgumentError is raised. See also: |
addEntryNamed:ofClass:atBlock: |
![]() |
ofClass:aClass atBlock:(IXBlockHandle)aHandle |
Creates an instance of class aClass, reconstitutes it from the block at aHandle by sending initFromBlock:inStore: (an IXBlockAndStoreAccess protocol method), and associates it with aName. If aHandle is 0, this method is equivalent to addEntryNamed:ofClass:, and creates a new instance of aClass. Returns the reconstituted or created instance.
Use this method to associate a name with the data for a previously created store client. The stored data should have been created by a previous instance of aClass. If an entry already exists for aName, IX_DuplicateError is raised. If aName is NULL or empty, or if instances of aClass don't respond to initFromBlock:inStore:, IX_ArgumentError is raised. See also: |
empty |
![]() |
Removes all entries from the directory, instantiating the store clients, and freeing them from the store. Returns self.
See also: |
entries |
![]() |
Creates and returns a NULL-terminated list of the names of all currently defined entries. The sender of this message responsible for freeing the list, but not the strings in the list, which are NXAtoms.
If space for the array of entries can't be allocated, IX_MemoryError is raised. |
freeEntryNamed: |
![]() |
Removes the named entry from the directory by sending freeFromBlock:inStore to the named entry's class object. Returns self.
See also: |
getClass:ofEntryNamed: |
![]() |
Returns by reference the class object for the entry named aName, or nil if there is no such entry. Returns self. |
hasEntryNamed: |
![]() |
Returns YES if there is an entry named aName, NO otherwise. |
openEntryNamed: |
![]() |
Creates and initializes (with initFromBlock:inStore:) an instance of the object previously entered as aName, or nil if there is no such entry. It's possible to create multiple instances from the same entry; your code should avoid doing this, as the separate objects may corrupt the data they share in the IXStore if they try to change it.
See also: |
removeName: |
![]() |
Removes aName as an entry in the IXStoreDirectory, but doesn't remove the store client. That is, the client can still be recovered by handle. Returns self.
See also: |
reset |
![]() |
Removes all entries in the IXStoreDirectory, but doesn't remove the store clients. That is, the clients can still be recovered by handle. Returns self.
See also: |