Lumiera  0.pre.03
»edit your freedom«
placement.cpp
Go to the documentation of this file.
1 /*
2  Placement - Key Abstraction: a way to place and locate a Media Object
3 
4  Copyright (C)
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
23 #include "lib/format-string.hpp"
24 
25 #include <typeinfo>
26 
27 using util::_Fmt;
28 using lib::meta::typeStr;
29 
30 namespace steam {
31 namespace mobject {
32 
33 
40  ExplicitPlacement
42  {
43  return ExplicitPlacement (*this, chain.resolve());
44  }
45 
46 
47 
48  Placement<MObject>::operator string () const
49  {
50  return _Fmt{"Placement<%s> %|50T.| use-cnt=%u ID(%016x) adr=%p pointee=%p"}
51  % typeStr(this->get()) % use_count()
52  % (size_t)getID()
53  % (void*)this
54  % (void*)get()
55  ;
56  }
57 
58 
59  string
60  format_PlacementID (Placement<MObject> const& pla)
61  {
62  size_t hashVal = pla.getID();
63  return _Fmt{"pID(%016x)"} % hashVal;
64  }
65 
66 
67  bool
68  isSameDef (PlacementMO const& pl1, PlacementMO const& pl2)
69  {
70  return pl1.getID() == pl2.getID()
71  || pl1.chain == pl2.chain
72  ;
73  }
74 
75 
76 
77 
78 
79 }} // namespace steam::mobject
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
Definition: trait.hpp:82
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.
Front-end for printf-style string template interpolation.
Core abstraction of the Session model: a media object.
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
bool isSameDef(PlacementMO const &pl1, PlacementMO const &pl2)
compare the properties of placement
Definition: placement.cpp:68
std::string typeStr(TY const *obj=nullptr) noexcept
failsafe human readable type display
Definition: meta/util.hpp:316
string resolve(fsys::path iniSpec)
use the general mechanism for resolving a search path to get the absolute path of the setup...
Definition: basic-setup.cpp:56