OLUnaryNegate Class Reference
[Function Objects]

A unary function object that negates the action of another unary function object. More...

#import <ObjectiveLib/Functional.h>

Inheritance diagram for OLUnaryNegate:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(void) - encodeWithCoder:
 Encode the function object.
(BOOL) - performUnaryFunctionWithArg:
 Perform the underlying function and return the opposite of its result.
(void) - writeSelfToStream:
 Write the object to a stream.
Initializers and Deallocators
(void) - dealloc
 Finalize the function object and deallocate any allocated memory.
(id) - initWithCoder:
 Initialize the function object.
(id) - initWithObjectInStream:
 Initialize the object.
(id) - initWithUnaryFunction:
 Initialize the function object with the function that should be negated.

Static Public Member Functions

(id) + functorWithUnaryFunction:
 Create and return an instance of OLUnaryNegate.

Protected Attributes

OLStreamableFunctor< OLBoolUnaryFunction > * fn
 The underyling unary function that will be negated.

Detailed Description

A unary function object that negates the action of another unary function object.

The action message of this object simple returns the opposite of the target function object.


Member Function Documentation

- (void) dealloc  

Finalize the function object and deallocate any allocated memory.

- (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 from OLStreamableFunctor.

+ (id) functorWithUnaryFunction: (OLStreamableFunctor< OLBoolUnaryFunction > *)  function  

Create and return an instance of OLUnaryNegate.

Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
function the function that OLUnaryNegate will negate
Returns:
a new functor

- (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 from OLStreamableFunctor.

- (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 OLStreamableFunctor.

- (id) initWithUnaryFunction: (OLStreamableFunctor< OLBoolUnaryFunction > *)  function  

Initialize the function object with the function that should be negated.

Parameters:
function the target function that will be negated
Returns:
a reference to this function object

- (BOOL) performUnaryFunctionWithArg: (id)  arg  

Perform the underlying function and return the opposite of its result.

Parameters:
arg the argument to pass to the target function
Returns:
the opposite of the target function's result

Reimplemented from < OLBoolUnaryFunction >.

- (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 OLStreamableFunctor.


Member Data Documentation

- (OLStreamableFunctor<OLBoolUnaryFunction>*) fn [protected]

The underyling unary function that will be negated.


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