56 #ifndef MOBJECT_PLACEMENT_REF_H 57 #define MOBJECT_PLACEMENT_REF_H 89 template<
class MX =MObject>
92 typedef Placement<MX> PlacementMX;
93 typedef Placement<MObject>::ID _ID;
94 typedef Placement<MObject>::Id<MX> _Id;
117 : id_(recast (refID))
126 REQUIRE (!isValid(),
"hash-ID clash with existing ID");
155 validate(recast (r));
162 operator= (Y
const& refID)
164 validate (recast (refID));
165 id_ = recast (refID);
169 void clear () { id_ = bottomID(); }
179 operator string()
const {
return access(id_).operator string(); }
180 size_t use_count()
const {
return access(id_).use_count(); }
184 operator _Id
const&()
const {
return id_; }
185 LumieraUid getLUID()
const {
return id_.get(); }
199 operator bool()
const 209 return access(id_).isValid();
219 return access(id_).resolve();
227 checkValidity ()
const 234 validate (_Id
const& rId)
241 recast (_ID
const& someID)
243 return static_cast<_Id const&
> (someID);
247 recast (
const LumieraUid luid)
250 return reinterpret_cast<_Id const&
> (*luid);
257 return recast (&invalidLUID);
261 access (_Id
const& placementID)
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);
Reference tag denoting a placement attached to the session.
static bool isRegisteredID(PlacementMO::ID const &)
verify the given placement-ID (hash) is valid, by checking if it refers to a Placement instance curre...
Core abstraction: completely resolved placement of an MObject Within the session model, all media objects are attached with the help of mobject::Placement elements.
Core abstraction: placement of a media object into session context.
Special kind of Placement, where the location of the MObject has been nailed down to a fixed position...
PlacementRef()
Default is an NIL Placement ref.
PlacementRef(PlacementRef const &r)
Implementation level session API: resolve a Placement by hash-ID.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
static PlacementMO & resolveID(PlacementMO::ID const &)
actually retrieve a Placement tracked by the index.
Steam-Layer implementation namespace root.
Derived specific exceptions within Lumiera's exception hierarchy.
static bool isAccessible()
is the element-fetch service usable? Effectively this means: is the session up?
PlacementMX & operator->() const
provide access to pointee API by smart-ptr chaining
PlacementRef< MObject > RefPlacement
frequently-used shorthand
Lumiera error handling (C++ interface).
Lumiera public interface.
PlacementRef(PlacementRef< X > const &r)
PlacementMX & operator*() const
dereferencing fetches referred Placement from Index
unsigned char lumiera_uid[16]
storage for a Lumiera unique ID, based on a 128bit random number
PlacementRef(Y const &refID)
Creating a PlacementRef from a compatible reference source.
string resolve(fsys::path iniSpec)
use the general mechanism for resolving a search path to get the absolute path of the setup...