ObjectiveLib
1.0.0
|
Transform a binary function object into a unary function object. More...
#import <ObjectiveLib/Functional.h>
Public Member Functions | |
(void) | - encodeWithCoder: |
Encode the function object. | |
(id) | - performUnaryFunctionWithArg: |
Perform the function of this function object. | |
(void) | - writeSelfToStream: |
Initializers and Deallocators | |
(id) | - initWithCoder: |
(id) | - initWithFunction:andRightArg: |
Initialize the function object. | |
(id) | - initWithObjectInStream: |
(void) | - dealloc |
Static Public Member Functions | |
(id) | + functorWithFunction:andRightArg: |
Create and return an instance of OLBinder2nd. | |
Protected Attributes | |
OLStreamableFunctor < OLBinaryFunction > * | fn |
The function to which to bind an argument. | |
id | rght |
The argument to bind. |
Transform a binary function object into a unary function object.
This function object binds a given object to the second argument of a given binary function object, thus producing a unary function object.
- (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:.
encoder | the coder which will save the function object to the archive |
Reimplemented from OLStreamableFunctor.
+ (id) functorWithFunction: | (OLStreamableFunctor< OLBinaryFunction > *) | function | |
andRightArg: | (id) | right | |
Create and return an instance of OLBinder2nd.
function | the binary function object to use |
right | the right or second argument for the binary function object |
- (id) initWithFunction: | (OLStreamableFunctor< OLBinaryFunction > *) | function | |
andRightArg: | (id) | right | |
Initialize the function object.
The binary function object and its second argument are stored for later use. When this function object's performUnaryFunctionWithArg: message is sent the argument to the message becomes the first argument to the underlying binary function object and its result is returned. The second argument to the underlying binary function object will be right.
NSCoding
protocol.function | the binary function object to use |
right | the right or second argument for the binary function object |
- (id) performUnaryFunctionWithArg: | (id) | arg |
Perform the function of this function object.
Specifically, the underlying binary function object passed to initWithFunction:andRightArg: is called with arg as the first argument and the stored object as the second argument. The result of the binary function is then returned.
arg | the argument to the function |
Reimplemented from <OLUnaryFunction>.
- (OLStreamableFunctor<OLBinaryFunction>*) fn [protected] |
The function to which to bind an argument.
- (id) rght [protected] |
The argument to bind.
|