Flip Reference

Ref Class Reference

Declared in

flip/Ref.h

class Ref;

flip::Ref is a type that represents the unique reference number of a flip object.

It is essentialy 3 64-bit numbers.

When constructing a Document it is given a user_id as a parameter. This number shall be unique and represents a unique user number when using collaboration. Typically this can be an OpenId user identifier or a Facebook user number.

In the case where the user is working offline and never connected to your service and therefore doesn't have yet a unique identifier, the special identifier Ref::User::Offline may be used.

When constructing a Document it is given a manufacturer_id and a component_id which combines into a actor_id. This represents the actor as seen from the controller side and shall be unique. This is only relevant when using multiple Document with a Hub when documents are in separate threads or processes.

Finally, each time an object is created, a unique object identifier is created, so that the combinaison of those 3 64-numbers make a unique number in the whole document.

Since every Ref are unique in a document, one can extract an Object using a Ref and a Document. See Document for more details.

Member Functions Synopsys

Constructor

Constructs the Ref

Destructor

Destructs the Ref

operator =

Assigns value

Decomposition

user

Returns the user unique id associated to this reference number

actor

Returns the actor unique id associated to this reference number

obj

Returns the object unique id associated to this reference number

Static Members

Member Variables Synopsys

null

Represents the null reference number

root

Represents the root object reference number of any document model

Member Functions

Constructor

Ref ();                    (1)
Ref (const Ref & other);   (2)
Ref (Ref && other);        (3)
  1. Default constructor, constructs the null reference number.
  2. Copy constructor. Constructs the object with the value of other.
  3. Constructor. Constructs the object by moving other.

Destructor

~Ref ();

Destructor.


operator =

Ref & operator = (const Ref & other);  (1)
Ref & operator = (Ref && other);  (1)
  1. Copy assignment operator.
  2. Assignment operator. Assigns the object by moving other.

user

uint64_t user () const;

Returns the user unique id associated to this reference number. User id from 0 to 3 are reserved.


actor

uint64_t actor () const;

Returns the actor unique id associated to this reference number.


obj

uint64_t obj () const;

Returns the object unique id associated to this reference number.

Member Variables

null

static const Ref null;

Represents the null reference number. Dereferencing this number will always returns nullptr.


root

static const Ref root;

Represents the root object reference number of any document model.