Flip Reference

 

ObjectRef Template Class Reference

Namespace

ohm::flip

Inherits from

ohm::flip::Object

Declared in

ohm/flip/ObjectRef.h

Companion Guide

Flip Programming Guide: Writing a Flip Class Part 1

Flip Programming Guide: Using ObjectRefs

Overview

The ObjectRef template class implements a Flip value type holding a reference to another Flip object. The following sections will only document the public API.

Partial Class Diagram

Methods Overview

Assigning

Casting

Differencing

Methods

ctor

Sets the value at post construction stage.

virtual void   ctor (ohm::flip::Args & args);
void           ctor (Ref ref);

The first version sets the value from a cascaded arguments object ohm::flip::Args

operator =

Sets the value with either a pointer to an object or a Flip reference number.

ObjectRef & operator = (const T * ptr);
ObjectRef & operator = (Ref ref);

Returns a reference to this .

reset

Sets the value with a pointer to an object, and reset the reference if the value is omitted.

void           reset (const T * ptr = 0);

operator T *

Returns the value of this as a pointer of type T .

               operator T * () const;

WARNING:it is invalid to call this function when the object is being restored

get_ref

Returns the value of this as a Flip reference number.

bool           get_ref () const;

WARNING:it is invalid to call this function when the object is being restored

get_old_ptr

Returns the old value of this as a pointer of type T .

bool           get_old_value () const;

WARNING:it is invalid to call this function when the object is being inited

get_old_ref

Returns the old value of this as a Flip reference number.

bool           get_old_value () const;

WARNING:it is invalid to call this function when the object is being inited

did_ref_change

Returns true if the old value is different from the current value.

bool           did_ref_change () const;

Note:Outside of an observer document_changed call, this will always return false