Storage manager for computer system5857207Abstract A data structure and associated data management methods for highly flexible storage of data for a wide variety of application programs. Data is stored as a plurality of Blops, each of which has a list of Properties associated with it. Each Property contains zero or more elements. Elements are Values, each of which has a Basic Type and consists of a variable length sequence of bytes. The Basic Type defines the format of the Value, as well as meta-information such as compression and encryption. Elements can also be Compound Types, which nestably refer to another list of Properties. Blops are stored in Containers, which map to the physical medium on which the data is stored. Containers associate respective Container Handlers which are specific to the Container's physical medium. Related Blops in a Container are organized into Pools of Blops. Each Container contains one or more Pools, each Pool having a unique name within the Container. A Pool contains multiple versions of a Blop. Versions of different Blops are grouped together in Layers in a Pool and each Layer contains at most one version of a Blop. Layers are related to each other as an acyclic digraph, where each Layer is above one or more Base Layers and has zero or more Layers above it. Each Layer presents a "view" to a user of the Blops in a pool, and thereby provides a mechanism to manipulate which versions of which Blops are to be used at any given time. Claims We claim: Description A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by any one of the patent document or the patent disclosure as it appears in the Patent & Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
______________________________________
.COPYRGT. 1992 Apple Computer
Constants
#define SMUndefined 0L; /* ignore parameter value */
#define SMUIPFileContHandler "fch";/* provided container handler */
#define SMDefaultReconcileHandler "drh"; /* provided default
reconcile handler */
#define SMBpvAccessorIteratorHandler "bpva"; /* provided iterator
handler */
#define SMStructuredNameIteratorHandler "snit"; /* provided
iterator handler */
#define SMBlopIdIteratorHandler "bidi"; /* provided iterator
handler */
Data Types
typedef void *SMBPVAccessor; /* blop, property and value context
pointer */
typedef char *SMStructuredName; /* structured name */
typedef Size SMSize; /* generic size of data typedef */
typedef void *SMCPLAccessor; /* container, pool and layer context
pointer */
typedef SMCount SMValueIndex; /* index of a value in a property */
typedef SMStructureName SMPoolName; /* recuired for a pool */
typedef SMStructureName SMLayerName; /* optional for a layer */
typedef unsigned long SMBlopId; /* persistent reference */
typedef unsigned long SMCount; /* generic count typedef */
typedef void *SMStream; /* stream value pointer */
typedef long SMStreamPos; /* value stream position */
typedef void *SMContSpec; /* fully defines a container */
typedef void *SMIterator; /* no guarantee of how stored */
typedef char *SMHandler; /* storage manager handler names */
typedef SMHandler SMContHandler; /* name of container handler */
typedef SMHandler SMReconcileHandler; /* reconcile handler name
typedef SMHandler SMIteratorHandler; /* iterator handler name */
typedef void *SMIterItemPtr; /* pointer to an individual item */
typedef const enum {
/* access mode: */
ksMAReadonly = 0x001; /* no update allowed */
kSMAReadWrite
= 0x002; /* changes allowed */
/* special cpl access mode: */
kSMATransient
= 0x003; /* no intemal access allowed */
} SMAccessorKind;
typedef const enum {
kSMMIType = 0x01; /* type meta-information */
kSMMIProperty
= 0x02; /* property meta-information */
} SMMetaInfoKind;
typedef const enum {
/* error returns: */
kSMMRContNotFound
= (-6); /* container was not found */
kSMMRPoolNotFound
= (-5); /* pool was not found */
ksMMRLayerNotFound
= (-4); /* layer was not found */
kSMMRBlopNotFound
= (-3); /* blop was not found */
kSMMRPropNotFound
= (-2); /* property was not found */
kSMMRValueNotFound
= (-1); /* value was not found */
kSMMRNoMovement
= 0x00; /* no movement necessary */
/* success returns: */
kSMMRChild = 0x01; /* a child was positioned to */
kSMMRParent = 0x02; /* a parent was positioned to */
ksMMRSibling = 0x04; /* a sibling was positioned to */
kSMMRDisjoint
= 0x08; /* disjoint positioning occurred */
/* return modifiers: */
kSMMRwrap = 0x100; /* a wrap occurred */
} SMPositionResult;
typedef const enum {
kSMPUndefined
= 0x00; /* set to undefined */
kSMPSame = 0x01; /* leave where it is */
kSMPFirstSib = 0x02; /* first of the given kind */
kSMPLastSib = 0x03; /* last of the given kind */
kSMPNextSib = 0x04; /* next of the given kind */
kSMPPrevSib = 0x05; /* previous of the given kind */
kSMPFirstBelow
= 0x06; /* first below of current kind */
kSMPLastBelow
= 0x07; /* last below of current kind */
kSMPFirstAbove
= 0x08; /* first above of the given kind */
kSMPLastAbove
= 0x09; /* last above of the given kind */
/* modifiers */
kSMPMWrap = 0x10; /* allow wrapping */
kSMMNoTypes = 0x20; /* skip type meta info blops */
kSMMNoProperties
= 0x40; /* skip property meta info blops */
kSMMNoBlops = 0x80; /* skip normal blops */
} SMPositionCode;
typedef const enum {
kSMBFalse =(0); /* false boolean */
kSMBTrue = (-1); /* true boolean */
} SMBoolean; /* generic boolean typedef */
typedef const enum {
kSMCIgnore = 0x01; /* ignore cycle */
kSMCSkip = 0x02; /* skip duplicate blop */
kSMCError = 0x03; /* raise cycle exception */
} SMSearchOption;
typedef const enum {
kSMRLBlockSwappable
= (-5); /* most likely to be purged */
kSMRLBlockNormal
= 0; /* average chance - default */
kSMRLBlockRetain
= 5; /* will not be purged */
} SMRetentionLevel;
typedef const enum {
kSMSSeekSet
= 0x00; /* seek from beginning of value */
kSMSSeekCur
= 0x01; /* seek from current position in value */
kSMSSeekEnd
= 0x02; /* seek from end of value */
} SMStreamSeekCode;
typedef const enum {
kSMCDisposeInconsistent
= 0x01; /* disposes of inconsistent
layers */
kSMCCollapseLayers
= 0x02; /* collapses all layers
possible */
kSMCGarbageCollectPool
= 0x04; /* garbage collects pool */
kSMCCompactContainer
= 0x08; /* compact container */
} SMCleanupCode;
typedef const enum {
ksMRConflictingChange
= 0x01; /* blops different */
kSMRBaseLayerNameMoved
= 0x02; /* name moved/gone */
kSMRNewBlopInBase
= 0x04; /* new blop in base */
kSMRDisposeOBloplnBase
= 0x08; /* blop gone in base */
kSMRNewNameInSeparable
= 0x10; /* new name in sep */
kSMRNewBlopInSeparable
= 0x20; /* new blop in sep */
kSMRDisposeOBlopInseparable
= 0x40; /* blop gone in sep */
kSMRLayerNameCleanup
= 0x80; /* same layer name */
kSMRMAll = 0xFF; /* all operators */
} SMReconcileOperator;
typedef const enum {
kSMBoBigEndian = 0x00; /* big endian byte order */
kSMBoLittieEndian
= 0x01; /* little endian byte order */
} SMByteOrder;
typedef struct {
FSSpec fsSpec;
/* hfs file specification */
char permission;
/* open permission to file */
OSType creator;
/* creator of file-used on create */
OSType fileType;
/* file type of file-used on create */
ScriptCode scriptTag;
/* document name script-used on
create */
SMBoolean dataFork;
/* store data in data or resource fork */
} SMFileSpec;
typedef struct {
SMIteratorHandler iterHandler;
long reserved; /* reserved for future use */
union {
Ptr pointer;
SMCount index;
Size offset;
} current; /* how current is accessed */
void *storage; /* storage area for iterator */
SMSize itemSize; /* size of current item */
SMCount itemCount; /* count of current items */
} SMIter, *SMIterptr;
typedef const enum {
/* operator:
parameters: */
kSMIterCreate;
/* SMIterptr */
kSMIterAdd; /* SMIterptr, const SMIterItemptr Boolean */
kSMIterRemove;
/* SMIterptr, const SMIterItemptr */
kSMIterFirst;
/* SMIterPtr, SMIterItemPtr */
kSMIterLast;
/* SMIterptr, SMIterItemPtr */
kSMIterNext;
/* SMIterptr, SMIterItemPtr */
kSMIterPrev;
/* SMIterptr, SMIterItemPtr */
kSMIterCount;
/* SMIterptr, SMCount * */
kSMIterGetIndex;
/* SMIterptr, SMCount, SMIterItemPtr */
kSMIterSetIndex;
/* SMIterptr, SMCount, const SMIterItemPtr*/
kSMIterRemoveIndex;
/* SMIterptr, SMCount */
kSMIterGetSize;
/* SMIterPtr */
kSMIterDelete;
/* SMIterPtr */
kSMIterAdjust;
/* SMIterPtr */
} SMIteratorOperator;
typedef struct {
SMSize *freeSpace;
/* free space in accessor's heap */
} SMWSReadOnlyInfo;
typedef struct {
THz *theHeap; /* heap to allocate from */
SMSize *maxMemory;
/* maximum memory to use */
SMCount *BlopCacheCount;
/* number of blops to cache */
} SMWSReadWriteInfo;
typedef struct {
SMAccessorKind *aKind;
/* kind of bpv accessor */
SMAccessorKind owningCPLAKind;
/* owning kind to create */
SMCPLAccessor *owningContext;
/* owning cpl accessor */
SMMetaInfoKind *mKind;
/* kind if meta-info blop */
SMSize maxPropertyNameSize;
/* max size for prop name
SMStructureOName propertyName;
/* name of property */
SMSize maxTypeNameSize;
/* max size for type name */
SMStructureName typeName;
/* name of type */
SMValueIndex *valueIndex;
/* current value index */
SMBoolean *embeddedIds;
/* are there embedded ids? */
SMByteOrder *byteOrder;
/* byte order of value */
} SMBPVReadOnlyInfo;
typedef struct {
SMBoolean *persistent;
/* whether persistent */
SMRetentionLevel *retention;
Also before describing the individual routines, it will be useful to understand certain runtime concepts which the routines use. In particular, two kinds of Accessors are used to move about the hierarchies which the Storage Manager manages. BPV Accessors are used to designate the context of a Blop. A BPV Accessor defines a current Blop, Property and Value. CPL Accessors designate the context of a Container. A CPL Accessor defines a current Container, Pool and Layer. BPV Accessors are inherently owned by a CPL Accessor which defines the Layer being used to access the designated Blop. Both of these Accessors share some common functionality. They can be used to iterate through all of their corresponding contexts. For example, a BPV Accessor can iterate over all Properties within a Blop, and all Values within a Property. BPV and CPL Accessors can also be re-targeted to different Blops and Containers. This allows for all Blops within a Layer to be reached. Accessors are not persistently stored. They are used by an application to dynamically access the storage space maintained by the Storage Manager. For example, when attempting to access a particular Value of a Blop a BPV Accessor is given as the parameter that defines the Value. The BPV Accessor defines the context of the Value that is to be manipulated. CPL Accessors define an in-memory Workspace. This defines the heap, cache sizes, etc. where the Storage Manager allocates BPV Accessors and any other CPL Accessor memory allocations necessary for its routines. There is a default Workspace that can be set at initialization that will be used by a CPL Accessor if a specific Workspace is not defined for it. In addition to the above, it will be helpful to note that there are some routines within the Storage Manager that require a set of elements to be passed. For this reason the Storage Manager provides a robust Iterator mechanism that allows for the definition of sets of elements. The Iterator mechanism is generic and allows for the application program to define sets. Iterators returned by Storage Manager routines are snapshots of the current state, and cannot be used to indirectly change the state. For example, SMOwnedBPVAccessors returns an Iterator that contains all of the BPV Accessors that belong to a given CPL Accessor. Removing items from the Iterator has no effect on the BPV Accessors owned by the CPL Accessor, only the Iterator is changed. The Storage Manager includes the following application program interface calls. A. Initialization void SMInit(SMWSReadWriteInfo *rwInfo); Initializes the Storage Manager environment and sets the default Workspace info for CPL Accessors. B. Blop Identification void SMBindBlopName(SMBPVAccessor blop, const SMstructuredName theName); Binds the given name to the Blop designated by the given Accessor. Binding a name to a Blop that already has a name bound to it, or to a Meta Information Blop, is not allowed. void SMUnBindBlopName(SMCPLAccessor layer, const SMStructuredName theName); Removes any name associated with the Blop within the context of the given Layer. This routine is not valid for Meta Information Blops.
______________________________________
SMSize SMGetBlopName (SMBPVAccessor blop,
SMSize maxSize,
SMStructureName theName);
______________________________________
Returns the name associated with the Blop designated by the given Accessor, if one exists. The size returned is the number of bytes copied into the name parameter. A size of zero indicates that no name is associated. Passing kSMUndefined for the name causes the return of the actual length of any associated name.
______________________________________
SMBPVAccessor SMBPVAccessorFromName (SMCPLAccessor layer,
const SMStructuredName theName,
SMAccessorKind aKind);
______________________________________
Returns the Accessor that designates the Blop that the given name is bound to in the Layer as designated by the given Accessor. A new BPV Accessor is created, of the given kind, that designates the Blop and then is returned. The Blop may be either a normal Blop or a Meta Information Blop. SMBlopId SMGetBlopId(SMCPLAccessor layer, SMBPVAccessor blop); Given a Blop within a given Layer the persistent Blop identifier (Blop Id) is returned. This Id can safely be embedded within another Blops' Value data to create a persistent link. A Blop Id requires a Layer context to be useful, but with a given Pool a Blop will maintain its Id indefinitely, which means that within any Layer in the Pool the Blop will have the same Id. C. BPV Accessors
______________________________________
SMBPVAccessor SMNewBPVAccessor (SMAccessorKind aKind,
SMCPLAccessor layer,
const SMStructuredName blopName,
SMBlopId blopId,
const SMStructuredName propertyName,
SMValueIndex valueIndex,
const SMStructuredName typeName);
______________________________________
Allocates an Accessor to Blop data. Whether or not changes may be made to the data designated by this kind of Accessor is based on the BPV Accessor Kind created. All of the parameters other than BPV Accessor Kind are optional, and are used to set the initial Accessor location. To define the initial Blop that the Accessor is designating, Layer and blopName, or Layer and blopId must be specified. Names always take precedence. To define the initial Property of the initial Blop the propertyName must be specified. The initial Value of the initial Property can be specified either by the valueIndex or by the Type of the Value. If specified by Type, then the first Value Index with the given Type will be designated. If any of the parameters are invalid, e.g. an invalid Blop name, an exception is raised. Every BPV Accessor is created within the context of a CPL Accessor. In other words, a CPL Accessor owns all the BPV Accessors created using it. BPV Accessors cannot be shared even among different CPL Accessors of the same process. void SMDisposeBPVAccessor (SMBPVAccessor accessor, SMBoolean commit); Dispose of the indicated BPV Accessor. Any changes made with a ReadWrite BPV Accessor to Blop data are committed if commit is kSMBTrue. If commit is kSMBFalse any changes made to the Blop data are aborted. commit is ignored for ReadOnly BPV Accessors.
______________________________________
void SMTransformBPVAccessor (SMBPVAccessor accessor,
SMAccessorKind aKind,
SMBoolean commit);
______________________________________
Transforms a BPV Accessor from one kind to another. If transforming from ReadOnly to ReadWrite the BPV Accessor must be the only Accessor designating the Blop. When transforming from ReadWrite to ReadOnly any changes are committed if commit is kSMBTrue. If commit is kSMBFalse any changes made to the Blop data are aborted. commit is ignored for ReadOnly transformation to ReadWrite.
______________________________________
SMBPVAccessor SMRetargetBPVAccessor (SMBPVAccessor accessor,
SMAccessorKind aKind,
SMBoolean commit,
SMPositionCode blopPosition,
SMBoolean samePropertyName,
SMBoolean sameValueIndex,
SMBoolean sameTypeName,
SMCycleCode cycleCode);
______________________________________
Re-targets a given BPV Accessor, to a potentially different Blop, based on the given Blop position code. The given Accessor is re-targeted, if the given Accessor Kind is SMUndefined, or a new BPV Accessor is created, of the given kind, and is set to designate the Blop targeted. When re-targeting from a child Blop to a parent with a ReadWrite BPV Accessor the changes made are committed or aborted based on the given commit parameter. The cyclecode determines the result of targeting a Blop that has already been previously reached with the given BPV Accessor. If samePropertyName, sameValueIndex, or sameTypeName are kSMBTrue then the Accessor returned will attempt to designate the same Property as the original, by name, the same Value as the original, by Index or by name. If the attempt to keep the same designated Property or Type fails the corresponding portion of the returned BPV Accessor will be undefined. Embedded Blop Ids within a Value are considered the current children of a Blop. When positioning to kSMPFirstBelow the first Embedded Blop Id within the current Value is the Blop that is targeted. The Blop Id is resolved within the same Layer as the current Blop, or within the same Layer as the Remote Blop if it is an Indirect Blop. Re-targeting to kSMPFirstAbove or kSMPLastAbove with such an Accessor would resolve back to the Value that was used to find the child. When performing a retargeting to kSMPNextSib the next Embedded Blop Id of the parent is used. If the Blop has no parent, i.e. was positioned to by name, kSMPNextSib positions to the next Blop owned by the Layer. The valid position codes are as follows:
______________________________________
Parameter: blopPosition
Valid Position Code
Meaning
______________________________________
kSMPundefined set Blop to undefined
kSMPSame stay on same Blop
kSMPFirstSib goto first Blop on same level
kSMPLastSib goto last Blop on same level
kSMPNextSib goto next Blop on same level
kSMPPrevSib goto prev Blop on same level
kSMPFirstBelow goto first child of Blop
kSMPLastBelow goto last child of Blop
kSMPFirstAbove goto parent Blop (same as
kSMPLastAbove)
kSMPLastAbove goto parent Blop (same as
kSMPFirstAbove)
kSMPMWrap allow wrapping
kSMPMNoTypes skip Type Meta Information Blops
kSMPMNoProperties
skip Property Meta Information
Blops
kSMPMNoBlops skip normal Blops
______________________________________
SMPositionResult SMPositionBPVAccessor (SMBPVAccessor accessor,
const SMStructureName propertyName,
SMPositionCode propPosition,
SMValueIndex targetIndex,
SMPositionCode indexPosition,
SMBoolean sameType);
______________________________________
Repositions a given BPV Accessor within a Blop returning the status of the positioning. The return Value, if positive, indicates how the new location of the Accessor is related to the previous location; and if negative, it indicates how far SMPositionBPVAccessor was able to proceed with this process before an error was detected. On failure, the Accessor is left pointing at the closest Property and Value it could find to the ones requested that still satisfies the given parameters. All of the parameters other than the first Accessor are optional, and are used to reset the Accessor location. If a Property name is given the corresponding position code is ignored. If a Value Index is given the corresponding position code is ignored. The routine positions Property first, either by name or by relative to current Property. The Value is next positioned, by either the given Index or relative to the current Index. The given sameType flag attempts to impose a filter on the Indexes that will be designated. If sameType is kSMBTrue then for example, positioning to the kSMPNextSib Index will attempt to position to the next Value Index with the same Type as the current Index. If the Property is changed, and the Index position code given is relative to current, the Value Index positioned to will be the current Index plus the position code. For example, we are positioned to Value Index four of a Property. The Property is changed by kSMPNextSib and the Value Index is changed by kSMPNextSib. The Property is positioned to the next Property of the Blop. The Index positioned to will be Value Index five, if such an Index exists within the next Property. If it does not, the Value Index will be the highest Index available since that would be the closest that could be found. The valid position codes for each position code argument are as follows:
______________________________________
Parameter: propPosition
Valid Position Code
Meaning
______________________________________
kSMPundefined set Property to undefined
kSMPSame stay on same Property
kSMPFirstSib goto first Property
kSMPLastSib goto last Property
kSMPNextSib goto next Property
kSMPPrevSib goto previous Property
kSMPMWrap allow wrapping
______________________________________
Parameter: indexPosition
Valid Position Code
Meaning
______________________________________
kSMPUndefined set Index to undefined
kSMPSame stay on same Index
kSMPFirstSib goto first Index
kSMPLastSib goto last Index
kSMPNextSib goto next Index
kSMPPrevSib goto previous Index
kSMPMWrap allow wrapping
______________________________________
SMCount SMCountBPVAccessor (SMBPVAccessor accessor,
SMPositionCode propertyPosition,
SMPositionCode indexPosition,
SMBoolean sameType);
______________________________________
Returns the number of times that the given Accessor could be moved according to the parameters before stopping. The wrap position code modifier is not allowed for any given position code. The parameters are interpreted the same as in the SMPositionBPVAccessor routine. With this routine it is easy to determine the number of Properties in a Blop, the number of Values in a Property, the number of Values of a given Type within a Property, etc. void SMSetPreferredPosition(SMBPVAccessor accessor); Sets the preferred position for the given Blop as indicated by the given Accessor. Whenever a SMBPVAccessor is created for this Blop with undefined parameters, it is automatically positioned at this location. SMBPVAccessor SMCloneBPVAccessor(SMBPVAccessor accessor); Creates a duplicate of the given BPV Accessor. Only ReadOnly Accessors can be cloned since two ReadWrite Accessors are not allowed to be targeting the same Blop.
______________________________________
void SMGetBPVAccessorInfo (SMBPVAccessor accessor,
SMBPvReadOnlyInfo *roInfo,
SMBPVReadWriteInfo *rwInfo);
______________________________________
Returns the details of what the given BPV Accessor designates. kSMUndefined may be passed as arguments to parameters that are not wanted. kSMUndefined will be returned for elements that are undefined. void SMSetBPVAccessorInfo(SMBPVAccessor accessor, SMBPVReadWriteInfo *rwInfo); Sets the details of the Blop designated by the given BPV Accessor. The default for persistent in SMBPVReadWriteInfo is kSMBTrue. D. Blop Creation and Removal SMBPVAccessor SMcreateBlop(SMCPLAccessor layer, SMAccessorKind aKind); Creates a new Blop. The Blop is instantiated in the Container, Pool and Layer designated by the given CPL Accessor. A new BPV Accessor, of the given kind, is created that designates the new Blop and then is returned.
______________________________________
SMBPVAccessor SMCreateMetaInfoBlop (SMCPLAccessor layer,
const SMStructureName theName,
SMMetaInfoKind mKind,
SMAccessorKind aKind);
______________________________________
Creates a new Meta Information Blop. The Meta Information Blop, of the given Meta Information kind, is instantiated with the given name in the Container, Pool and Layer designated by the given CPL Accessor. A new BPV Accessor, of the given kind, is created that designates the new Meta Information Blop and then is returned.
______________________________________
void SMIndirectBlop (SMBPVAccessor localBlop,
SMBPVAccessor remoteBlop,
SMCPLAccessor remoteLayer,
const SMStructuredName remoteBlopName);
______________________________________
Changes an existing Blop into an Indirect Blop which resolves into the Blop indicated by either a remoteBlop or a remoteLayer/remoteBlopName combination. If only remoteBlop is provided, then the Indirection Blop resolves itself by Id. If remoteLayer and remoteBlopName are provided then the Blop is resolved by Name. This routine is valid for Meta Information Blops as well as normal Blops. Any existing Properties are removed from the localBlop. This routine is only valid with a ReadWrite BPV Accessor. SMBPVAccessor SMGetIndirectBlopInfo (SMBPVAccessor localBPVAccessor, SMBPVAccessor remoteValue); Gets information about which Blop a particular, presumably Indirect, Blop resolves into. localBPVAccessor identifies the possible Indirect Blop. remoteValue is repositioned to refer to the target Blop before being returned. This is an optional parameter and if not given the localBPVAccessor is retargeted to the target Blop. If localBPVAccessor does not refer to an Indirect Blop, then remoteValue is positioned to the same Blop. This routine is only valid with a ReadOnly BPV Accessor.
______________________________________
SMBPVAccessor SMCloneBlop (SMCPLAccessor destCPLAccessor,
const SMStructuredName destName,
SMBPVAccessor sourceBPVAccessor;
SMAccessorKind aKind);
______________________________________
Creates a copy of the Blop indicated by sourceBPVAccessor in the Layer indicated by destCPLAccessor and returns a new BPV Accessor, of the given kind, that refers to the copy. If the Blop being cloned currently has a bound name it will have the same name in the destCPLAccessor. A new name may be set by passing destName. The resulting new Blop is an exact copy of the original Blop, except for any Embedded Blop Ids it may contain in its Values. Embedded Blop Ids from the original may need to be changed if the source and destination Layers are in different Pools, and the routine may need to create Indirect Blops in the destination Layer which resolve into the Blops referred to by the Embedded Blop Ids in the original. If the destination Layer is the same as the original Blop, which can be designated by passing kSMUndefined for destCPLAccessor, and the original Blop is named its clone will have no name unless one is given for it. This routine is valid for Meta Information Blops as well as normal Blops. void SMRemoveBlop(SMBPVAccessor blop); Removes a Blop designated by the given Accessor. The BPV Accessor is left in an undefined state. No other BPV Accessors can be targeted at the given Blop. E. Value Manipulation
______________________________________
SMBPVAccessor SMCreateValue (SMBPVAccessor blop,
const SMStructuredName propertyName,
SMValueIndex valueIndex,
const SMStructuredName typeName,
SMAccessorKind aKind);
______________________________________
Creates a new Value for the designated Blop, of the given Type in the given Property at the given Value Index. propertyName, valueIndex, and typeName are optional; if any of them is kSMUndefined the corresponding attribute of the Value will be derived from the corresponding attribute of the BPV Accessor. In this case the appropriate elements must be defined on the BPV Accessor. If propertyName is not kSMUndefined, then a new Property (if necessary) with the given name is added that contains no Values. The new Value is specified by Index and will be of the given Type. Indexes are not sparse, so the Value Index, if passed, must be between one and one more than the current last Index. New Value entries never overwrite existing entries, they are inserted before the Value at the given Index and all other entries are pushed up one entry. If kSMUndefined is given for the Accessor Kind, the given Accessor is repositioned to designate the new Value and returned. Otherwise a new BPV Accessor is created, of the given kind, and then is returned. The Value at this point has no associated data. The Value data is set with SMWriteValueData, SMInsertValueData, or implicitly by SMIndirectValue or SMCreateContainer (to create an embedded Container). The Type Meta Information Blop that typeName refers to must exist prior to calling this routine. The Property Meta Information Blop that propertyName refers to does not need to exist prior to calling this routine. If the Property Meta Information Blop does not exist one will automatically be created. In this case the propertyName given must be unique within the Pool. SMSize SMGetValueSize(SMBPVAccessor value); The size of the Value data designated by the given BPV Accessor is returned. void *SMGetReadOnlyValuePtr(SMBPVAccessor value, SMSize *length); A pointer to the Value data designated by the given BPV Accessor is returned. If the length parameter is not kSMUndefined the size of the Value data is returned. The pointer which is returned by this routine is valid until either the given Accessor (or its clone) is removed or repositioned from the current Blop. Every attempt will be made to return a pointer to the actual data to minimize copying of data. This routine is only valid with a ReadOnly BPV Accessor.
______________________________________
SHSize SMReadValueData (SMBPVAccessor value,
void *buffer,
SMSize offset,
SMSize maxSize);
______________________________________
The Value data designated by the given BPV Accessor and offset is copied into the buffer given up to maxSize bytes. The length of the Value data that was actually copied is returned.
______________________________________
void SMWriteValueData (SMBPVAccessor value,
void *buffer,
SMSize offset,
SMSize length);
______________________________________
The Value data designated by the given BPV Accessor is changed to the data from the given buffer beginning at offset from the beginning of the Value. The Size of the buffer is passed. If the buffer passed is kSMUndefined then the Value data is set to zeroes from offset to offset plus length. This routine is only valid with a ReadWrite BPV Accessor.
______________________________________
void SMInsertValueData (SMBPVAccessor value,
void *buffer,
SMSize offset,
SMSize length);
______________________________________
The data from the given buffer is inserted into the Value designated by the given BPV Accessor at offset from the beginning of the Value. The Size of the buffer is passed. If the buffer passed is kSMUndefined then the Value data is set to zeroes from offset to offset plus length. The resulting Value data will be length bytes longer. This routine is only valid with a ReadWrite BPV Accessor.
______________________________________
void SMRemoveValueData (SMBPVAccessor value,
SMSize offset,
SMSize length);
______________________________________
The Value data, designated by the given BPV Accessor, starting at the given offset for length bytes is removed from the Value. The resulting Value data is length bytes shorter. This routine is only valid with a ReadWrite BPV Accessor. void SMRemoveValue(SMBPVAccessor value); The Value designated by the given Accessor is removed from the enclosing Property. The Value attribute of the BPV Accessor is left undefined. Only the last Index can be disposed of since sparse multiple Values are not allowed. If the BPV Accessor is positioned at the third Index of a Property with five defined Indexes and this routine is made an exception will be raised. This routine is only valid with a ReadWrite BPV Accessor. void SMRemoveProperty(SMBPVAccessor property); The Property, and all of its Values, designated by the given Accessor are removed. The Property and Value attributes of the BPV Accessor are left undefined. This routine is only valid with a ReadWrite BPV Accessor. void SMCloneProperty(SMBPVAccessor destBlop, SMBPVAccessor sourceProperty); Make a copy of the Property indicated by sourceProperty (including all of its Values) at the location indicated by destBlop. The resulting new Property is an exact copy of the original Property, except for any Embedded Blop Ids it may contain in its Values. Embedded Blop Ids from the original may need to be changed if the source and destination Layers are in different Pools, and the routine may need to create Indirect Blops in the destination Layer which resolve into the Blops referred to by the Embedded Blop Ids in the original. Any needed Meta Information Blops are cloned to the destination as well. This routine is only valid with a ReadWrite destination BPV Accessor.
______________________________________
void SMMarkEmbeddedBlopIds (SMBFVAccessor value,
SMSize offset,
SMCount count,
SMBoolean setMark);
______________________________________
In most Values, the location of Embedded Blop Ids in the data are defined by the Type of the Value. However, some uses of the Storage Manager require the structure of a Value to be variable, and therefore the location of Embedded Blop Ids are not well defined. In these cases this routine needs to be used to inform the Storage Manager of where Embedded Blop Ids are and are not stored. If setMark is kSMBTrue, this routine notes that the count longwords in the Value referred to by the BPV Accessor starting at offset contain Embedded Blop Ids. Likewise, if setMark is kSMBFalse, it notes that the indicated longwords do not contain Embedded Blop Ids. This routine is only valid with a ReadWrite BPV Accessor. F. Value Indirection
______________________________________
void SMIndirectValue (SMBPVAccessor localValue,
SMBPVAccessor remoteValue,
SMSize remoteOffset,
SMSize remoteLength);
______________________________________
Changes an existing Value, indicated by localValue, into an Indirect Value which resolves into (at least part of) the Value indicated by remoteValue. If remoteOffset is not kSMUndefined, then only that part of the remote Value starting at the indicated offset is indirected to. If remoteLength is not kSMUndefined, then only that number of bytes of the remote Value are used. Any existing Value data is removed from the local Value. remoteOffset and remoteLength are automatically pegged to the end of the remote Value. This routine is only valid with a ReadWrite BPV Accessor.
______________________________________
void SMGetIndirectValueInfo (SMBPVAccessor localValue,
SMBPVAccessor remoteValue,
SMSize *remoteOffset,
SMSize *remoteLength);
______________________________________
Gets information about which Value a particular, presumably Indirect, Value resolves into. localValue indicates the possibly indirect Value. remoteValue (if not kSMUndefined) is repositioned to refer to the Value localValue resolves into, and remoteOffset and remoteLength (if not kSMUndefined) are filled in with the appropriate offset and length. If localValue does not refer to an Indirect Value, then remoteValue is repositioned to refer to the same Value as localValue and *remoteOffset and *remoteLength are set to kSMUndefined.
______________________________________
void SMChangeIndirectValue (SMBPVAccessor localValue,
SMSize remoteOffsetChange,
SMSize remoteLengthChange);
______________________________________
An existing Indirect Value indicated by localValue is changed to resolve into a different area of its Remote Value. remoteOffsetChange and remoteLengthChange are added to the current offset and length of the Indirect Value. The window on the Remote Value is automatically kept within the data of the Remote Value, i.e. the offset will be kept above zero and the offset plus the length won't extend past the end of the Value. This routine is only valid with a ReadWrite BPV Accessor. G. Value Stream I/O SMStream SMStreamOpen(SMBPVAccessor value); Use SMStreamOpen to open the Value whose location is specified by the given BPV Accessor and associate a stream with it. The stream is opened with in ReadOnly or ReadWrite mode based on how the Accessor was acquired. If the Value is successfully opened, SMStreamOpen returns a pointer to a stream data structure that controls the stream. int SMStreamClose(SMStream stream); Use SMStreamClose to close the stream specified by stream. If the stream was open for writing, the content of the buffer associated with the stream is written to the Value ("flushed") before the Value is closed. If it was open for reading, unread data in the buffer are discarded.
______________________________________
SMSize SMStreamRead (void *ptr,
SMSize size,
SMSize count,
SMStream stream);
______________________________________
Use SMStreamRead to read the number of data items specified by count, each of a size given by the argument size, from the current position in stream. The current position of stream is updated after the read. The SMStreamRead routine returns the number of items it successfully read.
______________________________________
SMSize SMStreamWrite (const void *ptr,
SMSize size,
SMSize count,
SMStream stream);
______________________________________
Use SMStreamWrite to write the number of data items specified by count, each of a size given by size, from buffer to the current position in stream. The current position of stream is updated after the write. The SMStreamWrite routine returns the number of items it actually wrote.
______________________________________
int SMStreamSeek (SMStream stream,
SMSize offset,
SMStreamSeekCode origin);
______________________________________
Use the SMStreamSeek routine to reposition stream to the location specified by offset with respect to the argument origin. The SMStreamSeek routine returns a non zero value only if it fails to position the stream. int SMStreamGetPos(SMStream stream, SMStreamPos pos); Use SMStreamGetPos to get and save the current position indicator of the stream specified by the argument stream in the SMStreamPos data object pos. This Value is used by the companion routine SMStreamSetPos to reposition the stream at the time of the call to SMStreamGetPos. If successful, SMStreamGetPos returns zero. In case of error, it returns a non zero Value. int SMStreamSetPos(SMStream stream, const SMStreamPos pos); Use SMStreamSetPos to set the position where reading or writing will take place in stream. The new position is specified in an SMStreamPos data object pos. For Value position, use the Value obtained by an earlier call to SMStreamGetPos. If successful, SMStreamSetPos returns a zero. Otherwise, the return Value is non zero. SMSize SMStreamTell(SMStream stream); Use SMStreamTell to obtain the current position of stream. The position is expressed as a byte offset from the beginning of the file. If successful, SMStreamTell returns a SMSize containing the number of bytes that the current position of stream is offset from the beginning of the Value. In case of error, SMStreamTell returns -1. H. CPL Accessors
______________________________________
SMCPLAccessor SMNewCPLAccessor (SMAccessorKind aKind,
SMContSpec contSpec,
SMPoolName poolName,
SMLayerName layerName);
______________________________________
Creates and returns a CPL Accessor, of the given kind, that defines the Container, Pool and Layer context. All parameters other than Accessor kind are optional. The CPL Accessor kind parameter specifies whether or not the Accessor is a ReadWrite, ReadWrite, or Transient, Accessor to the contents of the Layer. A Transient Accessor cannot perform any Container, Pool or Layer manipulation, but can be repositioned to other Pools and Layers from the currently designated position. The Container is implicitly opened if necessary during this call. Each Layer can have many Reader-Processes but it can only have one Process modifying a Layer at a time. Therefore, a Process cannot acquire write-permission to the Layer if there is another Process reading or modifying a Layer. Each CPL Accessor maintains its current permission to the Layer. The permission is called the Layer Mode. There are three Layer Modes--Read/Write, Read-Only and None. Read/Write Mode gives the Process which owns the CPL Accessor exclusive right to modify the Layer. Read-Only Mode allows a Process to read from the Layer and at the same time blocking out any attempt from another Process to acquire a Read/Write Mode. None Mode is used for transient repositioning of the Layer Access. For example, the user may want to move a CPL Accessor within a Layer hierarchy with no intention to look at any Blops until the desired Layer is found. CPL Accessors of the same Process can share the same Layer Mode. For example, a clone of a CPL Accessor has the same Layer Mode as the original. If the original CPL Accessor has Read/Write Mode on a Layer, the clone will have Read- and Write-permission to the Layer too. void SMDisposeCPLAccessor(SMCPLAccessor accessor); Disposes of the specified CPL Accessor. If any BPV Accessors are outstanding an error occurs. If this is the last Accessor designating the Container it is implicitly closed. void SMTransformCPLAccessor(SMCPLAccessor accessor, SMAccessorKind aKind); Transforms a CPL Accessor from one kind to another. If transforming from ReadOnly to ReadWrite the CPL Accessor must be the only Accessor designating the Layer. An exception is raised if attempting to reposition a CPL Accessor that has outstanding BPV Accessors.
______________________________________
void SMRetargetCPLAccessor (SMCPLAccessor accessor,
SMContspec contSpec,
SMBoolean samePoolName,
SMBoolean sameLayerName);
______________________________________
Re-targets the given CPL Accessor, to a potentially different Container, based on the given Container Specification. The given Accessor is retargeted. An exception is raised if attempting to reposition a CPL Accessor that has outstanding BPV Accessors. Since a CPL Accessor provides the context for the BPV Accessor, a CPL Accessor cannot be repositioned if there is a BPV Accessor outstanding. All the BPV Accessors must be `released` first. If samePoolName or sameLayerName are kSMBTrue then the Accessor returned will attempt to designate the same Pool as the original and the same Layer as the original, both by name.
______________________________________
SMPositionResult SMPositionCPLAccessor (SMCPLAccessor accessor,
SMPoolName poolName,
SMPositionCode poolPosition,
SMLayerName layerName,
SMPositionCode layerPosition);
______________________________________
Repositions a given CPL Accessor within a Container returning the status of the positioning. The return Value, if positive, indicates how the new location of the Accessor is related to the previous location; and if negative, it indicates how far SMPositionCPLAccessor was able to proceed with this process before an error was detected. On failure, the Accessor is left pointing at the closest Pool and Layer it could find to the ones requested that still satisfies the given parameters. Therefore, if the specified LayerName does not exist, the CPL Accessor is positioned to the specified Pool (not to a Layer in the specified Pool). An exception is raised if attempting to reposition a CPL Accessor that has outstanding BPV Accessors. Pools are implicitly opened and closed as necessary during the repositioning. Layers and Pools are considered upside down graphs. Delta Pools are considered children of their Base Pool. The bottom Layer is the topmost Parent in a Layer hierarchy. From an undefined state positioning the Pool to kSMPFirstSib positions to the first Pool in the Container. Positioning a Layer to kSMPFirstAbove or kSMPFirstBelow from an undefined state positions to the bottom Layer of the Pool.
______________________________________
Parameter: poolPosition
Valid Position Code
Meaning
______________________________________
kSMPUndefined set Pool to undefined
kSMPSame stay on same Pool
kSMPFirstSib goto first Pool in same Container
kSMPLastSib goto last Pool in same Container
kSMPNextSib goto next Pool in same Container
kSMPPrevSib goto previous Pool in same Container
kSMPFirstBelow goto Base Pool (same as
kSMPLastBelow)
kSMPLastBelow goto Base Pool (same as
kSMPFirstBelow)
kSMPFirstAbove goto first connected Delta Pool
kSMPLastAbove goto last cbnnected Delta Pool
kSMPMWrap allow wrapping within a level
______________________________________
Parameter: layerPosition
Valid Position Code
Meaning
______________________________________
kSMPUndefined set Layer to undef ined
kSMPSame stay on same Layer
kSMPFirstSib goto first Layer at same level
kSMPLastSib goto iast Layer at same level
kSMPNextSib goto next Layer at same level
kSMPPrevSib goto previous Layer at same level
kSMPFirstBelow goto first Base Layer
kSMPLastBelow goto last Base Layer
kSMPFirstAbove goto first Derived Layer
kSMPLastAbove goto last Derived Layer
kSMPMWrap allow wrapping within a level
______________________________________
SMCount SMCountCPLAccessor (SMCPLAccessor accessor,
SMPositionCode poolPosition,
SMPositionCode layerPosition);
______________________________________
Returns the number of times that the given CPL Accessor could be repositioned according to the parameters before stopping. The wrap position code modifier is not allowed for any given position code. The parameters are interpreted the same as in the SMPositionCPLAccessor routine. With this routine it is easy to determine the number of Pools in a Container, the number of Layers in a hierarchy, etc. SMCPLAccessor SMCloneCPLAccessor(SMCPLAccessor original); Duplicates the specified CPL Accessor and returns the duplicate. Only ReadOnly and Transient Accessors can be cloned since two ReadWrite Accessors are not allowed to be targeting the same Layer. If the Layer is currently undefined by the Accessor a ReadWrite Accessor can be cloned.
______________________________________
void SMGetCPLAccessorInfo (SMCPLAccessor accessor,
SMCPLReadOnlyInfo *roInfo,
SMCPLReadWriteInfo *rwInfo);
______________________________________
Returns the details of what the given CPL Accessor designates. kSMUndefined may be passed as arguments to parameters that are not wanted. kSMUndefined will be returned for elements that are undefined. theFile parameter is only defined when the Container is a File Container, for all other Containers kSMUndefined will always be returned. Passing kSMUndefined for poolName while still passing maxPoolNameSize will set the parameter to the length of the Pool Name. The basePool parameter will be filled in with a newly created Accessor, of basePoolAKind, if not kSMUndefined and the Pool currently designated is a Separable or Delta Pool. The max info size parameters will return the current size of the corresponding info if kSMUndefined is given for the info parameter. The Layer names Iterator is a snapshot of all of the names currently set for the designated Layer. Changing items within the Iterator has no effect on the Layer. void SMSetCPLAccessorInfo (SMCPLAccessor accessor, SMCPLReadWriteInfo *rwInfo); Sets the details of what the given CPL Accessor designates. kSMUndefined may be passed for poolName if the name is not to be changed. In rwInfo, `consistent` designates the Layer specified by the given Accessor to be consistent or not. Every Layer has a flag associated with it which indicates if the Layer contains a consistent view of the Blops in the Pool. Since the Storage Manager has no knowledge of the interpretation of data it manages, it assumes that all operations it is asked to do leave the Layers in a consistent state. However, SMSetCPLAccessorInfo allows the application to specify that a Layer is in a consistent or inconsistent State. In addition, since the SMMoveChangesDown routine frequently makes a Layer inconsistent (by copying down a subset of related changes), it has an argument which the caller can supply to indicate whether the resulting Layer is consistent. The main use of this feature is to limit the types of operations which can be performed on a Layer. It is an error for an application to create a Layer which is derived from an inconsistent Layer (although existing Layers which are above it are still OK); and it is an error for an application to SMMoveAllChangesDown from an inconsistent Layer. Thus if an application creates an inconsistent Layer in a shared disk file, then no other application will be able to build a Layer above it (and see its contents) until it is marked as consistent. SMIterator SMOwnedBPVAccessors(SMCPLAccessor accessor); Returns an Iterator that contains all outstanding BPV Accessors for the given CPL Accessor. The BPV Accessor Iterator is a snapshot of all of the BPV Accessors currently owned by the given CPL Accessor. Changing items within the Iterator has no effect on the actual Accessors. void SMCleanup(SMCPLAccessor accessor, SMCleanupCode cleanupCode); Cleans up the Layer, Pool and Container structures referred to by accessor according to cleanupCode. The CPL Accessor is then positioned according to the cleanup operation. Workspace Maintenance
______________________________________
void SMGetWorkspaceInfo (SMCPLAccessor accessor,
SMWSReadOnlyInfo *roInfo,
SMWSReadWriteInfo *rwInfo);
______________________________________
Returns the current Workspace info for the given CPL Accessor. void SMSetWorkspaceInfo(SMCPLAccessor accessor, SMWSReadWriteInfo *rwInfo); Sets the Workspace info for the given CPL Accessor. void SMFlushWorkspaceInfo(SMCPLAccessor accessor); Flushes the Workspace caches for the given CPL Accessor. J. Generating Container Specifications SMContSpec SMMakeFileContSpec(const SMFileSpec *theFile); Creates a Container Specification for the given file. SMContSpec SMMakeROMContSpec(void); Creates a Container Specification for the ROM. SMCreateContainer and SMRemoveContainer are not valid for a ROM Container Specification. SMContSpec SMMakeScrapContSpec(void); Creates a Container Specification for the clipboard. SMContSpec SMMakeMemoryContSpec(void); Creates a Container Specification for an area of memory. void SMUnMakeContSpec(SMContSpec contSpec); Removes the Container specification. It is not necessary to unmake a ContSpec if the specification is used in the SMCreateContainer, SMNewCPLAccessor, or SMRetargetCPLAccessor routines. K. Container Maintenance
______________________________________
SMCPLAccessor SMCreateContainer (SMContSpec contSpec,
SMContHandler handler,
SMAccessorKind aKind);
______________________________________
Creates a new Container located as defined by the Container Spec. The given handler is set as the Container Handler for all access to the given Container. This routine creates a new file or allocates a new heap zone. If the file or heap zone already exists an error occurs. After initializing the Container to be a Storage Manager Container it is accessible. A new CPL Accessor is created, of the given kind, to refer to the Container and then is returned. The standard Container Handler provided by the Storage Manager is referred to herein as SMUIPFileContHandler. void SMRemoveContainer(SMCPLAccessor container); Removes the designated Container. If Container is a file the file is removed. The given Accessor is left in an undefined position. No BPV Accessors can be outstanding for the given CPL Accessor. L. Pool Maintenance
______________________________________
SMCPLAccessor SMCreatePool (SMCPLAccessor container,
SMPoolName poolName,
SMAccessorKind aKind);
______________________________________
Creates a new Pool in the Container specified by Container. A single bottom Layer is created when a new Pool is created. If kSMUndefined is passed for the Accessor Kind the given CPL Accessor is positioned to designate the new Pool and returned. If a valid Accessor Kind is given a new CPL Accessor of the given kind is created and returned. void SMRemovePool(SMCPLAccessor pool); Removes the Pool referred to by Pool. The Pool designated, by the given Accessor, after this routine is kSMUndefined.
______________________________________
SMCPLAccessor SMCreateDeltaPool, (SMCPLAccessor deltaContainer,
SMPoolName deltaPoolName,
SMCPLAccessor baseLayer,
SMAccessorKind aKind);
______________________________________
Creates a Delta Pool based on the Layer referred to by baseLayer. The new Pool is created in the Container specified by deltaContainer and has the name deltaPoolName. If kSMUndefined is passed for the Accessor Kind the given deltaContainer is positioned to designate the new bottom Layer of the new Pool and returned. If a valid Accessor Kind is given a new CPL Accessor of the given kind is created and returned.
______________________________________
SMCPLAccessor SMCreateSeparablePool(SMCPLAccessor sepContainer,
SMPoolName sepPoolName,
SMCPLAccessor baseLayer,
SMAccessorKind aKind);
______________________________________
Creates a Separable Pool based on the Layer referred to by baseLayer. The Separable Pool is created in the Container specified by sepContainer and has the name sepPoolName. If kSMUndefined is passed for the Accessor Kind the given sepContainer is positioned to designate the new bottom Layer of the new Pool and returned. If a valid Accessor Kind is given a new CPL Accessor of the given kind is created and returned.
______________________________________
void SMReconnectPool (SMCPLAccessor deltaPool,
SMCPLAccessor basePool,
SMReconcileOperator reconcileMask,
SMReconcileHandler reconcileHandler);
______________________________________
Reconnects a Delta Pool referred to by deltaPool to the Base Pool referred to by basePool. The given Reconciliation handler is used at 2 levels (Layers and Blops). reconcileMask indicates which operations will trigger handler functions. A standard Reconciliation Handler is provided by the Storage Manager and is referred to herein as SMDefaultReconcileHandler. A Reconcile Handler performs a function given each Reconciliation Operator. This is the function used by the Storage Manager to perform the. Reconnect routine. The function called for each Layer reconciliation operation are defined as:
______________________________________
myReconcileLayerFunc (SMLayerName layerName,
SMReconcileOperator operator,
SMCPLAccessor deltaLayer,
SMCPLAccessor baseLayer);
______________________________________
The functions called for each Blop reconciliation operation are defined as:
______________________________________
myReconcileBlopFunc (SMBPVAccessor theBlop,
SMReccncileOperator operator,
SMCPLAccessor deltaLayer,
SMCPLAccessor baseLayer);.
void SMIntegratePool (SMCPLAccessor sepPool,
SMCPLAccessor origPool,
SMReconcileOperator reconcileMask,
SMReconcileHandler reconcileHandler);
______________________________________
Integrate a Separable Pool referred to by sepPool to the Base Pool referred to by origPool. The given Reconciliation handler is used at 2 levels (Layers and Blops). reconcileMask indicates which operations will trigger handler functions. A standard Reconciliation Handler is provided by the Storage Manager, referred to herein as SMDefaultReconcileHandler. A Reconcile Handler performs a function given each Reconciliation Operator. This is the function used by the Storage Manager to perform the Integrate routine. The function called for each Layer reconciliation operation are defined as:
______________________________________
myIntegrateLayerFunc (SMLayerName layerName,
SMReconcileOperator operator,
SMCPLAccessor sepLayer,
SMCPLAccessor origLayer);
______________________________________
The routines called for each Blop reconciliation operation are defined as:
______________________________________
myIntegrateBlopFunc (SMBPVAccessor theBlop,
SMReconcileOperator operator,
SMCPLAccessor sepLayer,
SMCPLAccessor origLayer);.
SMCPLAccessor SMIntegrateLayers (SMCPLAccessor layer1,
SMCPLAccessor layer2,
SMReconcileOperator reconcileMask,
SMReconcileHandler reconcileHandler,
SMAccessorKind aKind);
______________________________________
Creates a new Layer which acts as an integration Layer between the two Layers referred to by Layer1 and Layer2. The new Layer is created in the same Pool indicated by Layer1 when Layer1 and Layer2 refer to different Pools. Layer1 and Layer2 must have a common base Layer to be integrated. reconcileMask indicates which operations will trigger handler functions. The CPL Accessor returned is a new Accessor, of the given kind, that designates the new Layer. A standard Reconciliation Handler is provided by the Storage Manager and is referred to herein as SMDefaultReconcileHandler. A Reconcile Handler performs a function given each Reconciliation Operator. This is the function used by the Storage Manager to perform the Integrate routine. The function called for each Blop reconciliation operation are defined as:
______________________________________
myIntegrateBlopFunc (SMBPVAccessor theBlop,
SMReconcileOperator operator,
SMCPLAccessor layer1,
SMCPLAccessor layer2);
SMCPLAccessor SMGetLatestCommonLayer (SMCPLAccessor layer1,
SMCPLAccessor layer2,
SMAccessorKind aKind);
______________________________________
Finds the latest common Layer of the Layers referred to by Layer1 and Layer2 and creates a new CPL Accessor, of the given kind, that refers to this common Layer and then is returned. SMCPLAccessor SMGetBottomLayer(SMCPLAccessor pool, SMAccessorKind aKind); Returns the bottom Layer of the Pool designated by the given CPL Accessor. If kSMUndefined is passed for the Accessor Kind Pool is repositioned to the bottom Layer. If a valid Accessor Kind is given a new CPL Accessor, of the given kind, is created and returned. M. Layer Maintenance
______________________________________
SMCPLAccessor SMCreateLayer (SMCPLAccessor aboveLayer,
SMCPLAccessor belowLayer1,
SMCPLAccessor belowLayer2,
SMBoolean above,
SMAccessorKind aKind);
______________________________________
Creates a Layer between the Layers specified by aboveLayer and the two below CPL Accessors (belowLayer1 and belowLayer2). If kSMUndefined is passed for the Accessor Kind belowLayer1 is positioned to designate the new Pool and returned. If a valid Accessor Kind is given a new CPL Accessor, of the given kind, is created and returned. The above flag determines whether the new Layer is created in the Pool as designated by the aboveLayer or the belowLayers. Attempting to create a Layer in a ReadOnly Pool produces an error. New Layers are created in a consistent state. void SMRemoveLayer(SMCPLAccessor layer); Removes the Layer referred to by Layer. All Blops instantiated within the given Layer are also removed. A Layer cannot be removed if there are Layers derived from it. The CPL Accessor left designating a kSMUndefined Layer. The bottom Layer of a Pool cannot be removed.
______________________________________
SMBoolean SMSetLayerName (SMLayerName name,
SMCPLAccessor oldLayer,
| ||||||
