Documentation Set for Swarm 2.2
Prev | Reference VI. Simtools Library | Next

# ObjectSaver [Deprecated]

## Name

ObjectSaver -- A class to save an object's instance variables to a file.

## Description

Deprecated: Use the Archiver protocol in the defobj library as a replacement for this ad-hoc format

This class is used to write an object's variables to a specified file. If only a subset of the variables should be written out, the set is specified by a template ProbeMap (where the ProbeMap will contain Probes for those variables which should be saved).

## Protocols adopted by ObjectSaver

SwarmObject CREATABLE

## Methods

### Phase: Creating

- + save: anObject toFileNamed: (const char *)aFileName
  The save:toFileNamed: method saves the entire target object to the file aFileName.

- + save: anObject toFileNamed: (const char *)aFileName withTemplate: (id <ProbeMap>)aProbeMap
  The save:toFileNamed:withTemplate: method saves the subset of variables specified in a template from the target object to the file aFileName.

- + save: anObject to: aFileObject
  The save:to: method saves the entire target object without actually returning an instance of ObjectSaver to the user.

- + save: anObject to: aFileObject withTemplate: (id <ProbeMap>)aProbeMap
  The save:to:withTemplate: method saves the subset of target object variables specified in a template from anObject without actually returning an instance of ObjectSaver to the user.

### Phase: Setting

- - setTemplateProbeMap: (id <ProbeMap>)aProbeMap
  The setTemplateProbeMap: method is used to specify which variables of the source object(s) should be saved by the ObjectSaver instance to which this message was sent.

- - setFileObject: aFileObject
  The setFileObject: method sets the target fileObject which the instance of the ObjectSaver class should use.

### Phase: Using

- - saveObject: anObject
  The saveObject: message tells an instance of the ObjectSaver class to save the state of the target object into the requested file.

Prev | Home | Next
ObjectLoader [Deprecated] | Up | OutFile [Deprecated]