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) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
32 #include "lib/format-string.hpp"
33 
34 #include <typeinfo>
35 
36 using util::_Fmt;
37 using lib::meta::typeStr;
38 
39 namespace steam {
40 namespace mobject {
41 
42 
49  ExplicitPlacement
51  {
52  return ExplicitPlacement (*this, chain.resolve());
53  }
54 
55 
56 
57  Placement<MObject>::operator string () const
58  {
59  return _Fmt{"Placement<%s> %|50T.| use-cnt=%u ID(%016x) adr=%p pointee=%p"}
60  % typeStr(this->get()) % use_count()
61  % (size_t)getID()
62  % (void*)this
63  % (void*)get()
64  ;
65  }
66 
67 
68  string
69  format_PlacementID (Placement<MObject> const& pla)
70  {
71  size_t hashVal = pla.getID();
72  return _Fmt{"pID(%016x)"} % hashVal;
73  }
74 
75 
76  bool
77  isSameDef (PlacementMO const& pl1, PlacementMO const& pl2)
78  {
79  return pl1.getID() == pl2.getID()
80  || pl1.chain == pl2.chain
81  ;
82  }
83 
84 
85 
86 
87 
88 }} // namespace steam::mobject
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
Definition: trait.hpp:89
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:77
std::string typeStr(TY const *obj=nullptr) noexcept
failsafe human readable type display
Definition: meta/util.hpp:297
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:65