56#ifndef MOBJECT_PLACEMENT_REF_H
57#define MOBJECT_PLACEMENT_REF_H
89 template<
class MX =MObject>
126 REQUIRE (!
isValid(),
"hash-ID clash with existing ID");
179 operator string()
const {
return access(
id_).operator string(); }
184 operator _Id const&()
const {
return id_; }
199 operator bool()
const
243 return static_cast<_Id const&
> (someID);
250 return reinterpret_cast<_Id const&
> (*luid);
257 return recast (&invalidLUID);
264 throw error::Logic{
"Attempt to access a NIL PlacementRef"
265 ,
LERR_(BOTTOM_PLACEMENTREF)};
268 REQUIRE (genericPlacement.isValid());
270 if (!(genericPlacement.template isCompatible<MX>()))
271 throw error::Invalid{
"actual type of the resolved placement is incompatible"
272 ,
LERR_(INVALID_PLACEMENTREF)};
276 return static_cast<PlacementMX&
> (genericPlacement);
Derived specific exceptions within Lumiera's exception hierarchy.
Special kind of Placement, where the location of the MObject has been nailed down to a fixed position...
virtual ExplicitPlacement resolve() const
no need to resolve any further, as this ExplicitPlacement already is the result of a resolve()-call.
Reference tag denoting a placement attached to the session.
static _Id const & bottomID()
LumieraUid getLUID() const
Placement< MObject >::Id< MX > _Id
bool checkValidity() const
PlacementRef()
Default is an NIL Placement ref.
static void validate(_Id const &rId)
PlacementMX & operator->() const
provide access to pointee API by smart-ptr chaining
ExplicitPlacement resolve() const
static _Id const & recast(const LumieraUid luid)
PlacementRef(Y const &refID)
Creating a PlacementRef from a compatible reference source.
Placement< MX > PlacementMX
bool operator==(PlacementRef< O > const &o) const
PlacementRef & operator=(PlacementRef const &r)
bool operator!=(PlacementRef< O > const &o) const
PlacementRef(PlacementRef const &r)
PlacementMX & operator*() const
dereferencing fetches referred Placement from Index
Placement< MObject >::ID _ID
PlacementRef(PlacementRef< X > const &r)
static PlacementMX & access(_Id const &placementID)
static _Id const & recast(_ID const &someID)
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
static bool isRegisteredID(PlacementMO::ID const &)
verify the given placement-ID (hash) is valid, by checking if it refers to a Placement instance curre...
static PlacementMO & resolveID(PlacementMO::ID const &)
actually retrieve a Placement tracked by the index.
static bool isAccessible()
is the element-fetch service usable? Effectively this means: is the session up?
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Lumiera error handling (C++ interface).
Core abstraction: completely resolved placement of an MObject Within the session model,...
unsigned char lumiera_uid[16]
storage for a Lumiera unique ID, based on a 128bit random number
LumieraError< LERR_(LOGIC)> Logic
Lumiera public interface.
PlacementRef< MObject > RefPlacement
frequently-used shorthand
Steam-Layer implementation namespace root.
Core abstraction: placement of a media object into session context.
Implementation level session API: resolve a Placement by hash-ID.