65 #ifndef MOBJECT_PLACEMENT_REF_H 66 #define MOBJECT_PLACEMENT_REF_H 98 template<
class MX =MObject>
101 typedef Placement<MX> PlacementMX;
102 typedef Placement<MObject>::ID _ID;
103 typedef Placement<MObject>::Id<MX> _Id;
126 : id_(recast (refID))
135 REQUIRE (!isValid(),
"hash-ID clash with existing ID");
164 validate(recast (r));
171 operator= (Y
const& refID)
173 validate (recast (refID));
174 id_ = recast (refID);
178 void clear () { id_ = bottomID(); }
188 operator string()
const {
return access(id_).operator string(); }
189 size_t use_count()
const {
return access(id_).use_count(); }
193 operator _Id
const&()
const {
return id_; }
194 LumieraUid getLUID()
const {
return id_.get(); }
208 operator bool()
const 218 return access(id_).isValid();
228 return access(id_).resolve();
236 checkValidity ()
const 243 validate (_Id
const& rId)
250 recast (_ID
const& someID)
252 return static_cast<_Id const&
> (someID);
256 recast (
const LumieraUid luid)
259 return reinterpret_cast<_Id const&
> (*luid);
266 return recast (&invalidLUID);
270 access (_Id
const& placementID)
273 throw error::Logic{
"Attempt to access a NIL PlacementRef" 274 , LERR_(BOTTOM_PLACEMENTREF)};
277 REQUIRE (genericPlacement.isValid());
279 if (!(genericPlacement.template isCompatible<MX>()))
280 throw error::Invalid{
"actual type of the resolved placement is incompatible" 281 , LERR_(INVALID_PLACEMENTREF)};
285 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...