![]() |
Scene Fusion 2 API Reference
|
#include <sfObject.h>
Public Types | |
enum | ObjectFlags : uint8_t { NoFlags = 0 , OptionalChildren = 1 << 1 , Transient = 1 << 2 } |
typedef std::shared_ptr< sfObject > | SPtr |
![]() | |
typedef std::function< bool(std::shared_ptr< sfObject >)> | ForEachCallback |
Public Member Functions | |
virtual | ~sfObject () |
virtual std::string | ToString ()=0 |
virtual const uint32_t & | Id () const =0 |
virtual const sfName & | Type () const =0 |
virtual const ObjectFlags | Flags () const =0 |
virtual sfProperty::SPtr | Property ()=0 |
virtual void | SetProperty (sfProperty::SPtr propertyPtr)=0 |
virtual std::shared_ptr< sfSession > | Session ()=0 |
virtual bool | IsSyncing ()=0 |
virtual bool | IsCreated ()=0 |
virtual bool | IsCreatePending ()=0 |
virtual bool | IsUnsubscriptionPending ()=0 |
virtual bool | IsDeletePending ()=0 |
virtual sfUser::SPtr | LockOwner ()=0 |
virtual bool | CanEdit ()=0 |
virtual bool | CanEditChildren ()=0 |
virtual bool | IsLocked ()=0 |
virtual bool | IsLockPending ()=0 |
virtual bool | IsFullyLocked ()=0 |
virtual bool | IsPartiallyLocked ()=0 |
virtual bool | IsLockedDirectly ()=0 |
virtual void | RequestLock ()=0 |
virtual void | ReleaseLock ()=0 |
virtual bool | SetChildIndex (int index)=0 |
![]() | |
ksHierarchyObject () | |
virtual | ~ksHierarchyObject () |
std::shared_ptr< sfObject > | Parent () |
const std::list< std::shared_ptr< sfObject > > & | Children () |
std::shared_ptr< sfObject > | Child (size_t index) |
int | IndexOfChild (std::shared_ptr< sfObject > childPtr) |
void | Detach () |
bool | IsDescendantOf (std::shared_ptr< sfObject > objPtr) |
virtual bool | AddChild (std::shared_ptr< sfObject > childPtr) |
virtual bool | InsertChild (int index, std::shared_ptr< sfObject > childPtr) |
virtual bool | RemoveChild (std::shared_ptr< sfObject > childPtr) |
void | ForEachDescendant (ForEachCallback callback) |
void | ForSelfAndDescendants (ForEachCallback callback) |
AncestorIter< std::shared_ptr< sfObject > > | SelfAndAncestors () |
AncestorIter< std::shared_ptr< sfObject > > | Ancestors () |
DescendantIter< std::shared_ptr< sfObject > > | SelfAndDescendants () |
DescendantIter< std::shared_ptr< sfObject > > | Descendants () |
Static Public Member Functions | |
static SPtr | Create (const sfName &type, sfProperty::SPtr propertyPtr=nullptr, ObjectFlags flags=NoFlags) |
Additional Inherited Members | |
![]() | |
virtual bool | MoveChild (std::shared_ptr< sfObject > childPtr, int newIndex) |
virtual bool | PerformAddChild (std::shared_ptr< sfObject > childPtr) |
virtual bool | PerformInsertChild (int index, std::shared_ptr< sfObject > childPtr) |
virtual bool | PerformRemoveChild (std::shared_ptr< sfObject > childPtr) |
void | PerformDetach () |
![]() | |
std::weak_ptr< sfObject > | m_parentPtr |
std::list< std::shared_ptr< sfObject > > | m_children |
Objects are synced between server and clients. Objects have an id, a user-defined string type, and a property which may be a collection of properties. Objects are arranged in a hierarchy and can be locked by users. When objects are constructed they are not automatically synced. To begin syncing an object, call sfSession.Create(sfObject::SPtr).
enum KS::SceneFusion2::sfObject::ObjectFlags : uint8_t |
Object flags.
OptionalChildren: Clients will not receive children for this object unless they subscribe to it using sfSession::SubscribeToChildren Transient: The object will be deleted when the user who created it leaves the session.
|
inlinevirtual |
Destructor.
|
pure virtual |
Can we edit the object? Objects cannot be edited if they are locked by another user, if they are deleted locally and we're waiting for the server to resolve the delete request, or while applying changes from the server.
|
pure virtual |
Can we edit the children of this object? Objects cannot have their children edited if they are fully locked by another user (meaning that user directly locked the object or one of its ancestors), if they are deleted locally and we're waiting for the server to resolve the delete request, or while applying changes from the server.
|
static |
Shared pointer constructor.
const | sfName& - type of object. |
sfProperty::SPtr | - property for the object. |
ObjectFlags | - flags. |
|
pure virtual |
Object flags.
|
pure virtual |
Object id.
|
pure virtual |
Is the object created on the server? This differs slightly from IsSyncing. When we send a create request, IsSyncing becomes true, but IsCreated becomes true when the server acknowledges the creation. Similarly when we send a delete request, IsSyncing becomes false but IsCreated becomes false when the server acknowledges the deletion.
|
pure virtual |
Are we waiting for the server to create this object?
|
pure virtual |
Are we waiting for the server to delete this object?
|
pure virtual |
Is the object fully locked? Locked objects are either fully locked or partially locked. Partially locked objects can have their children edited and full locked objects cannot. An object is fully locked if it or one of its ancestors is locked directly. Otherwise if a descendant is locked directly, the object is partially locked.
|
pure virtual |
Is the object locked directly or indirectly by another user?
|
pure virtual |
Is this object locked directly? An object is locked directly if another user called RequestLock() on the object.
|
pure virtual |
Are we waiting to acquire a lock on this object?
|
pure virtual |
Is the object partially locked? Locked objects are either fully locked or partially locked. Partially locked objects can have their children edited and fully locked objects cannot. An object is fully locked if it or one of its ancestors is locked directly. Otherwise if a descendant is locked directly, the object is partially locked.
|
pure virtual |
Are changes to the object being synced? To begin syncing an object, call sfSession.Create(sfObject).
|
pure virtual |
Are we waiting for the server to unsubscribe the local player from this object's children?
|
pure virtual |
The user who owns the lock on this object, either directly or indirectly. A user will indirectly own a lock if they directly lock an ancestor of the object. Null if no user owns a lock on this object. The object may still be indirectly locked without a lock owner if one or more users own locks on descendants of the object.
|
pure virtual |
Object property.
|
pure virtual |
Releases the lock on this object, or stops trying to acquire the lock if we do not own the lock on this object.
|
pure virtual |
Requests a lock on this object. If the object is locked by another user, tries to acquire the lock when it becomes unlocked. If the object is not syncing, call this before calling sfSession.Create to create the object with a lock.
|
pure virtual |
The session the object belongs to.
|
pure virtual |
Sets the child index, changing the object's placement in its parent's child list. Does nothing if the object has no parent, the object is locked, the index is out of bounds, or the child is already at the given index.
int | - index to move child to. |
|
pure virtual |
Set the property used by this object.
sfProperty::SPtr | - property |
|
pure virtual |
String representation of this object.
|
pure virtual |
User-defined object type.