BFLibCPP 0.1
CPP Library
Loading...
Searching...
No Matches
BF::Object Class Reference

#include <object.hpp>

Inheritance diagram for BF::Object:

Public Member Functions

 Object ()
 
 Object (Object &obj)
 
virtual ~Object ()
 

Static Public Member Functions

static void retain (Object *obj)
 
static void release (Object *obj)
 
static int retainCount (Object *obj)
 
static int retainCount (Object &obj)
 

Detailed Description

Base class Object is specifically designed to imitate Apple's Core Foundation memory management. Every class that adopts this object will have a memory retaining counter. Owner of class can choose to manually release memory with delete or to use Object::release().

Constructor & Destructor Documentation

◆ Object() [1/2]

Object::Object ( )

◆ Object() [2/2]

Object::Object ( Object & obj)

if someone is doing a shallow copy of this object, I want to make sure the new copy has their own lock and a retain count that is reset

◆ ~Object()

Object::~Object ( )
virtual

Member Function Documentation

◆ release()

void Object::release ( Object * obj)
static

decrements retain count by 1

if retain count reaches 0, this function will delete obj. Using obj after will incur undefined behavior

◆ retain()

void Object::retain ( Object * obj)
static

increments retain count by 1

◆ retainCount() [1/2]

int Object::retainCount ( Object & obj)
static
Here is the call graph for this function:

◆ retainCount() [2/2]

int Object::retainCount ( Object * obj)
static

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