50#ifndef MOBJECT_MOBJECT_REF_H
51#define MOBJECT_MOBJECT_REF_H
84 template<
class MO =MObject>
89 typedef PlacementMO::Id<MO>
_Id;
103 throw error::State(
"Lifecycle error: MObject ref not activated"
104 ,
LERR_(BOTTOM_MOBJECTREF));
107 return smPtr_.operator-> ();
115 ,
LERR_(BOTTOM_MOBJECTREF));
134 operator _Id const&()
const
147 return pRef_.resolve().time;
161 throw error::State(
"Attempt to attach a child to an inactive MObject ref"
162 ,
LERR_(BOTTOM_MOBJECTREF));
164 PlacementMO::ID thisScope =
pRef_;
197 ASSERT (placement.isValid());
199 placement.extendOwnershipTo(
smPtr_);
213 template<
typename REF>
237 template<
typename MOX>
251 template<
typename MOX>
280 and (*pRef_).template isCompatible<MOX>();
283 operator string() const
299 and oRef == this->
pRef_;
307 or oRef != this->
pRef_;
315 and oRef.
pRef_ == pRef;
323 or oRef.
pRef_ != pRef;
331 and pRef == oRef.
pRef_;
339 or pRef != oRef.
pRef_;
346 and PlacementMO::ID (
pRef_) == pID;
353 or PlacementMO::ID (
pRef_) != pID;
368 template<
class MOX,
class MOY>
377 template<
class MOX,
class MOY>
Generic opaque reference counting handle, for accessing a service and managing its lifecycle.
Lumiera's internal time value datatype.
An active (smart-ptr like) external reference to a specifically placed MObject "instance" within the ...
MORef & activate(Placement< MO > const &placement)
activate an MObject reference, based on an existing placement, which needs to be contained (added to)...
MORef & activate(MORef< MOX > const &oRef)
MORef & activate(MORef const &oRef)
build and activate an MObject reference based on an existing reference of the same pointee type
lib::time::Time getStartTime()
resolves the referred placement to an ExplicitPlacement and returns the found start time
PlacementRef< MO > const & getRef() const
allow to use a MObjectRef like a (bare) PlacementRef
Placement< MO > & getPlacement() const
friend bool operator==(MORef const &oRef, PlacementRef< MOX > const &pRef)
void purge()
detach this object instance from model, including all child elements.
friend bool operator!=(MORef const &oRef, PlacementRef< MOX > const &pRef)
MORef< MOX > attach(Placement< MOX > const &newPlacement)
attach a child element to the model
lib::Handle< MO > _Handle
bool isCompatible() const
MORef & operator=(MORef< MOX > const &oRef)
cross assignment.
MORef & activate(REF const &pRefID)
build and activate an MObject reference, based on anything which might be assigned to an PlarementRef...
PlacementMO::Id< MO > _Id
Reference tag denoting a placement attached to the session.
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
static bool detach_and_clear(PID)
detach the denoted element from the model including all children.
static PID attach_toModel(PMO, PID)
attach an object by placement onto the session.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
A generic opaque handle to an implementation entity, including lifecycle management.
LumieraError< LERR_(STATE)> State
Lumiera public interface.
bool isSharedPointee(MORef< MOX > const &ref1, MORef< MOY > const &ref2)
check if the two references actually share ownership on the same underlying MObject (as opposed to re...
MORef< MObject > MObjectRef
bool isSameDef(PlacementMO const &pl1, PlacementMO const &pl2)
compare the properties of placement
bool isEquivalentPlacement(MORef< MOX > const &ref1, MORef< MOY > const &ref2)
check if the two references actually denote an equivalent placement
Steam-Layer implementation namespace root.
A generic reference mechanism for Placements, as added to the current session.
Core abstraction: placement of a media object into session context.
Implementation level session API: add or remove Session contents.
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.