ETSerializerBackend documentation

Authors

David Chisnall

Software documentation for the ETSerializerBackend protocol

ETSerializerBackend

Declared in:
ETSerializerBackend.h
Conforms to:
NSObject
The ETSerializerBackend protocol is a formal protocol defining the interface for serializer backends. The backend is responsible for storing the data passed to it representing instance variables of objects in a way that can be read by a corresponding deserializer backend. For each serializer backend class, a mirror class that implements ETDeserializerBackend protocol has to be implemented.
Method summary

deserializerBackendClass 

+ (Class) deserializerBackendClass;
Returns the deserializer backend class which is the mirror of this serializer backend.

serializerBackendWithStore: 

+ (id) serializerBackendWithStore: (id<ETSerialObjectStore>)aStore;
Create a new instance of the back end writing to the specified store.

beginArrayNamed: withLength: 

- (void) beginArrayNamed: (char*)aName withLength: (unsigned int)aLength;
Begin an array of the specified length.

beginObjectWithID: withName: withClass: 

- (void) beginObjectWithID: (CORef)aReference withName: (char*)aName withClass: (Class)aClass;
Begin a new object of the specified class. All subsequent messages until the corresponding -endObject message should be treated as belonging to this object. Note that unlike structures and arrays, objects will not be nested.

beginStruct: withName: 

- (void) beginStruct: (char*)aStructName withName: (char*)aName;
Begin storing a structure. Subsequent messages will correspond to fields in this structure until a corresponding -endStruct message is received. The aStructName stores the name of the structure type. This is used by the deserializer to identify a custom structure deserializer to use.

deserializerBackend 

- (id) deserializerBackend;
Returns a deserializer backend instance initialised with the same data source (URL or data) as this serializer backend.

endArray 

- (void) endArray;
Mark the end of an array.

endObject 

- (void) endObject;
Sent when an object has been completely serialized.

endStruct 

- (void) endStruct;
Mark the end of a structure.

flush 

- (void) flush;
Ensures data has been written.

incrementReferenceCountForObject: 

- (void) incrementReferenceCountForObject: (CORef)anObjectID;
Increment the reference count for the object with the specified reference.

initWithStore: 

- (id) initWithStore: (id<ETSerialObjectStore>)aStore;
This is a designated initialiser for the class.
Initialise a new instance with the specified store. Raises an NSInvalidArgumentException if the store is not valid e.g. nil.

setClassVersion: 

- (void) setClassVersion: (int)aVersion;
Store the class version to be associated with the next set of instance variables.

startVersion: 

- (void) startVersion: (int)aVersion;
Perform any initialisation required on the new version.

storeCString: withName: 

- (void) storeCString: (const char*)aCString withName: (char*)aName;
Store the value aCString for the instance variable aName. The backend should ensure it copies the string, rather than simply retaining a reference to it.

storeChar: withName: 

- (void) storeChar: (char)aChar withName: (char*)aName;
Store the value aChar for the instance variable aName.

storeClass: withName: 

- (void) storeClass: (Class)aClass withName: (char*)aName;
Store the value aClass for the instance variable aName.

storeData: ofSize: withName: 

- (void) storeData: (void*)aBlob ofSize: (size_t)aSize withName: (char*)aName;
Store the value aBlob for the instance variable aName. The data should be copied by the backend.

storeDouble: withName: 

- (void) storeDouble: (double)aDouble withName: (char*)aName;
Store the value aDouble for the instance variable aName.

storeFloat: withName: 

- (void) storeFloat: (float)aFloat withName: (char*)aName;
Store the value aFloat for the instance variable aName.

storeInt: withName: 

- (void) storeInt: (int)aInt withName: (char*)aName;
Store the value aInt for the instance variable aName.

storeLong: withName: 

- (void) storeLong: (long)aLong withName: (char*)aName;
Store the value aLong for the instance variable aName.

storeLongLong: withName: 

- (void) storeLongLong: (long long)aLongLong withName: (char*)aName;
Store the value aLongLong for the instance variable aName.

storeObjectReference: withName: 

- (void) storeObjectReference: (CORef)aReference withName: (char*)aName;
Store a reference to an Objective-C object in the named instance variable. This is equivalent to an id, but is not guaranteed to correspond to an actual memory address either before or after serialization.

storeSelector: withName: 

- (void) storeSelector: (SEL)aSelector withName: (char*)aName;
Store the value aChar for the instance variable aName.

storeShort: withName: 

- (void) storeShort: (short)aShort withName: (char*)aName;
Store the value aShort for the instance variable aName.

storeUUID: withName: 

- (void) storeUUID: (unsigned char*)aUUID withName: (char*)aName;
Stores an UUID reference for the instance variable aName.

storeUnsignedChar: withName: 

- (void) storeUnsignedChar: (unsigned char)aChar withName: (char*)aName;
Store the value aChar for the instance variable aName.

storeUnsignedInt: withName: 

- (void) storeUnsignedInt: (unsigned int)aInt withName: (char*)aName;
Store the value aInt for the instance variable aName.

storeUnsignedLong: withName: 

- (void) storeUnsignedLong: (unsigned long)aLong withName: (char*)aName;
Store the value aLong for the instance variable aName.

storeUnsignedLongLong: withName: 

- (void) storeUnsignedLongLong: (unsigned long long)aLongLong withName: (char*)aName;
Store the value aLongLong for the instance variable aName.

storeUnsignedShort: withName: 

- (void) storeUnsignedShort: (unsigned short)aShort withName: (char*)aName;
Store the value aShort for the instance variable aName.