OLStreamableFunctor Class Reference
[Function Objects]

A function object that can be encoded to and decoded from an archive. More...

#import <ObjectiveLib/Functional.h>

Inheritance diagram for OLStreamableFunctor:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(void) - encodeWithCoder:
 Encode the function object.
(id) - initWithCoder:
 Initialize the function object.
(id) - initWithObjectInStream:
 Initialize the object.
(void) - writeSelfToStream:
 Write the object to a stream.

Detailed Description

A function object that can be encoded to and decoded from an archive.

This class merely provides the default implementation of the NSCoding protocol for all function objects. Since most function objects don't have any instance variables the encode and decode methods of this class do all the work for the vast majority of function object classes. All function objects inherit from OLCodableFunctor.


Member Function Documentation

- (void) encodeWithCoder: (NSCoder *)  encoder  

Encode the function object.

The function object is saved to an archive using encoder. The function object will be retrieved from the archive using the initializer initWithCoder:.

Parameters:
encoder the coder which will save the function object to the archive

Reimplemented in OLBinaryNegate, OLBinder1st, OLBinder2nd, OLBoolBinder1st, OLBoolBinder2nd, OLMemFun, OLMemFun1, and OLUnaryNegate.

- (id) initWithCoder: (NSCoder *)  decoder  

Initialize the function object.

This initializer creates a new function object from an archive and returns it.

Postcondition:
The function object returned will be identical to the function object saved to the archive using the encodeWithCoder: message.
Parameters:
decoder the coder which will decode the archived function object
Returns:
a reference to this function object

Reimplemented in OLBinaryNegate, OLBinder1st, OLBinder2nd, OLBoolBinder1st, OLBoolBinder2nd, OLMemFun, OLMemFun1, and OLUnaryNegate.

- (id) initWithObjectInStream: (OLObjectInStream *)  stream  

Initialize the object.

Each instance variable is read from stream and all other initialization is performed.

Parameters:
stream the stream from which to read
Returns:
a reference to this object

Reimplemented from < OLStreamable >.

Reimplemented in OLBinaryNegate, OLBinder1st, OLBinder2nd, OLBoolBinder1st, OLBoolBinder2nd, OLMemFun, OLMemFun1, and OLUnaryNegate.

- (void) writeSelfToStream: (OLObjectOutStream *)  stream  

Write the object to a stream.

All instance variables are written to stream.

Parameters:
stream the stream to which to write.

Reimplemented from < OLStreamable >.

Reimplemented in OLBinaryNegate, OLBinder1st, OLBinder2nd, OLBoolBinder1st, OLBoolBinder2nd, OLMemFun, OLMemFun1, and OLUnaryNegate.


The documentation for this class was generated from the following file:
ObjectiveLibGenerated Sun Apr 22 15:13:52 2007, © 2004-2007 Will Mason
SourceForge.net Logo