Oolite 1.91.0.7658-250404-b1488af
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
OOWeakRefObject Class Reference

#include <OOWeakReference.h>

+ Inheritance diagram for OOWeakRefObject:
+ Collaboration diagram for OOWeakRefObject:

Instance Methods

(id) - weakSelf
 
(id) - weakRetain [implementation]
 
(void) - weakRefDied: [implementation]
 
(void) - dealloc [implementation]
 
- Instance Methods inherited from <OOWeakReferenceSupport>
(id) - OO_RETURNS_RETAINED
 

Protected Attributes

OOWeakReferenceweakSelf
 

Detailed Description

Definition at line 137 of file OOWeakReference.h.

Method Documentation

◆ dealloc

- (void) dealloc
implementation

Reimplemented in AI, DockEntity, DustEntity, Entity, OOConcreteTexture, OODebugMonitor, OOEntityWithDrawable, OOExplosionCloudEntity, OOFlasherEntity, OOJavaScriptConsoleController, OOJSGuiScreenKeyDefinition, OOJSInterfaceDefinition, OOJSPopulatorDefinition, OOLaserShotEntity, OOShipGroup, OOSunEntity, OOTexture, OOVisualEffectEntity, OOWaypointEntity, PlanetEntity, PlayerEntity, ShipEntity, SkyEntity, StationEntity, Universe, and WormholeEntity.

Definition at line 165 of file OOWeakReference.m.

166{
167 [weakSelf weakRefDrop]; // Very important!
168 [super dealloc];
169}

References dealloc, and OOWeakReference::weakRefDrop.

Referenced by AI::dealloc, Entity::dealloc, OODebugMonitor::dealloc, OOJavaScriptConsoleController::dealloc, OOJSGuiScreenKeyDefinition::dealloc, OOJSInterfaceDefinition::dealloc, OOJSPopulatorDefinition::dealloc, OOShipGroup::dealloc, OOTexture::dealloc, dealloc, and Universe::dealloc.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ weakRefDied:

- (void) weakRefDied: (OOWeakReference *) weakRef
implementation

Reimplemented from <OOWeakReferenceSupport>.

Definition at line 159 of file OOWeakReference.m.

159 :(OOWeakReference *)weakRef
160{
161 if (weakRef == weakSelf) weakSelf = nil;
162}
return nil
OOWeakReference * weakSelf

References nil, and weakSelf.

◆ weakRetain

- (id) weakRetain
implementation

Definition at line 152 of file OOWeakReference.m.

153{
155 return [weakSelf retain]; // Each caller releases this, as -weakRetain must be balanced with -release.
156}
id weakRefWithObject:(id< OOWeakReferenceSupport > object)

References nil, OOWeakReference::weakRefWithObject:, weakRetain, and weakSelf.

Referenced by OOShipGroup::addShip:, ShipEntity::addTarget:, ShipEntity::checkCloseCollisionWith:, DockEntity::dockingInstructionsForShip:, OOECMBlastEntity::initFromShip:, StationEntity::OOMakeDockingInstructions, PlayerEntity::setCompassTarget:, PlayerEntity::setDockedStation:, PlayerEntity::setFoundTarget:, ShipEntity::setFoundTarget:, ShipEntity::setLastEscortTarget:, OOShipGroup::setLeader:, AI::setOwner:, Entity::setOwner:, ShipEntity::setPrimaryAggressor:, ShipEntity::setProximityAlert:, ShipEntity::setRememberedShip:, ShipEntity(Private)::setShipHitByLaser:, ShipEntity::setSubEntityTakingDamage:, ShipEntity::setTargetStation:, ShipEntity::setThankedShip:, OOShipGroupDebugInspectorModule::update, ShipEntity::update:, and weakRetain.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ weakSelf

- (id) weakSelf

Definition at line 172 of file OOWeakReference.m.

173{
174 return [[self weakRetain] autorelease];
175}

Member Data Documentation

◆ weakSelf

- (OOWeakReference*) weakSelf
protected

Definition at line 172 of file OOWeakReference.m.

173{
174 return [[self weakRetain] autorelease];
175}

Referenced by PlayerEntity::addTarget:, ShipEntity::dealloc, weakRefDied:, and weakRetain.


The documentation for this class was generated from the following files: