ICountedObject.hpp File Reference

Go to the source code of this file.

Namespaces

Classes

Defines


Define Documentation

#define EXCHANGE_COUNTED_OBJECTS ( x,
 )     if ((x) != (y)) { if (x) { (x)->dereference(); } (x) = (y); if (x) { (x)->referenced(); } }

Swaps two counted objects, with null pointer check and correct dereferencing of old object

Note:
DO NOT EVER CALL THIS FUNCTION IN THE FOLLOWING FASHION:
ECHANGE_COUNTED_OBJECT(m_memberVariable, SomeClassAccesor::getCountedObject(i));
remember that preprocessors will call this getCountedObject multiple times, which doesnt necessarily give the right results...

Definition at line 96 of file ICountedObject.hpp.

Referenced by Exponent::GUI::Graphics::CImageManager::CImageReference::setImage(), Exponent::GUI::Controls::CMenuItem::setImages(), Exponent::GUI::Controls::CModulatedXYPad::setModulationHandle(), and Exponent::GUI::Controls::CSelectableMenuItem::setUnCheckedImage().

#define FORGET_COUNTED_OBJECT (  )     if(x) { (x)->dereference(); } (x) = NULL;

Dereferences an object and sets it to NULL

Definition at line 102 of file ICountedObject.hpp.


Infinity API - ICountedObject.hpp File Reference generated on 7 Mar 2007