Ref Class Reference
Declared in |
|
class Ref; |
flip::Ref
is a type that represents the unique reference number of a flip object.
It is essentialy 3 64-bit numbers.
- The user represents a unique user identifier (see below)
- The actor represents a unique controller identifier (see below)
- The obj represents a unique object identifier for this user and actor (see below)
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
Constructs the | |
Destructs the | |
Assigns value |
Decomposition
Returns the user unique id associated to this reference number | |
Returns the actor unique id associated to this reference number | |
Returns the object unique id associated to this reference number |
Static Members
Member Variables Synopsys
Represents the | |
Represents the root object reference number of any document model |
Member Functions
Constructor
Ref (); (1) |
Ref (const Ref & other); (2) |
Ref (Ref && other); (3) |
- Default constructor, constructs the
null
reference number. - Copy constructor. Constructs the object with the value of
other
. - Constructor. Constructs the object by moving
other
.
Destructor
~Ref (); |
Destructor.
operator =
Ref & operator = (const Ref & other); (1) |
Ref & operator = (Ref && other); (1) |
- Copy assignment operator.
- 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.