// // HOMObjectWrapper.h // HigherOrderMessaging // // Created by Ofri Wolfus on 18/10/05. // Copyright 2005 Ofri Wolfus. All rights reserved. // #import /*! * @header HOMObjCValue * HOMObjectWrapper simply forwards one message to its target. * @copyright Created by Ofri Wolfus on 18/10/05. Copyright 2004-2005 Ofri Wolfus. All rights reserved. * @updated 2005-10-18 * @version 0.1 */ /*! * @class HOMObjectWrapper * @abstract HOMObjectWrapper forwards any message it can't respond to, to its target. * @discussion HOMObjectWrapper instances are recycled by default. If you don't want them to be recycled, call * [HOMObjectWrapper setRecyclingEnabled:NO forClass:HOMObjectWrapper]. */ @interface HOMObjectWrapper : NSProxy { id target; BOOL oneShot; } /*! * @method wrapperWithTarget:oneShot: * @abstract Returns a new initialized autoreleased HOMObjectWrapper instance and sets its target. * @param value If value is YES, the receiver will release itself after one message has been forwarded. * @result An initialized HOMObjectWrapper instance. */ + (id)wrapperWithTarget:(id )aTarget oneShot:(BOOL)value; /*! * @method initWithTarget:oneShot: * @abstract Returns a new initialized HOMObjectWrapper instance and sets its target. * @param value If value is YES, the receiver will release itself after one message has been forwarded. * @result An initialized HOMObjectWrapper instance. */ - (id)initWithTarget:(id )aTarget oneShot:(BOOL)value; /*! * @method target * @abstract Returns the target of the receiver. */ - (id )target; /*! * @method isObjectWrapper * @abstract Indicates that the receiver is an object wrapper. */ - (BOOL)isObjectWrapper; @end