clean-up visibility of lib::P

this was introduced into namespace mobject and spread from there.
Since the habit is to use more specific typedefs like PClip,
it is preferrable to spell out the full namespace
This commit is contained in:
Fischlurch 2015-07-02 19:16:46 +02:00
parent f88236319f
commit 1c8cddba84
41 changed files with 107 additions and 108 deletions

View file

@ -37,7 +37,6 @@ namespace lumiera{
namespace query {
using lib::P;
using lumiera::Query;
using boost::scoped_ptr;
@ -73,14 +72,14 @@ namespace query {
* is considered \e misconfiguration.
*/
template<class TAR>
P<TAR> operator() (Query<TAR> const&);
lib::P<TAR> operator() (Query<TAR> const&);
/** search through the registered defaults, never create anything.
* @return object fulfilling the query, \c empty ptr if not found.
*/
template<class TAR>
P<TAR> search (Query<TAR> const&);
lib::P<TAR> search (Query<TAR> const&);
/** retrieve an object fulfilling the query and register it as default.
* The resolution is delegated to the ConfigQuery system (which may cause
@ -88,7 +87,7 @@ namespace query {
* @return object fulfilling the query, \c empty ptr if no solution.
*/
template<class TAR>
P<TAR> create (Query<TAR> const&);
lib::P<TAR> create (Query<TAR> const&);
/** register the given object as default, after ensuring it fulfils the
* query. The latter may cause some properties of the object to be set,
@ -97,13 +96,13 @@ namespace query {
* @note only a weak ref to the object is stored
*/
template<class TAR>
bool define (P<TAR> const&, Query<TAR> const& =Query<TAR>());
bool define (lib::P<TAR> const&, Query<TAR> const& =Query<TAR>());
/** remove the defaults registration of the given object, if there was such
* @return false if nothing has been changed because the object wasn't registered
*/
template<class TAR>
bool forget (P<TAR> const&);
bool forget (lib::P<TAR> const&);
/** @internal for session lifecycle */

View file

@ -121,13 +121,13 @@ namespace lumiera {
};
typedef lib::IterSource<proc::mobject::ModelPort>::iterator ModelPorts;
typedef lib::IterSource<proc::mobject::OutputDesignation>::iterator Pipes;
typedef proc::play::POutputManager Output;
typedef proc::mobject::session::PClipMO Clip;
typedef proc::mobject::PFork Fork;
typedef proc::asset::PTimeline Timeline;
typedef proc::asset::PViewer Viewer;
using ModelPorts = lib::IterSource<proc::mobject::ModelPort>::iterator;
using Pipes = lib::IterSource<proc::mobject::OutputDesignation>::iterator;
using Output = proc::play::POutputManager;
using Clip = proc::mobject::session::PClip;
using Fork = proc::mobject::PFork;
using Timeline = proc::asset::PTimeline;
using Viewer = proc::asset::PViewer;
/* ==== convenience shortcuts for common use cases ==== */

View file

@ -87,7 +87,6 @@ namespace asset {
using std::static_pointer_cast;
using lib::HashVal;
using lib::P;
@ -119,8 +118,8 @@ namespace asset {
class Asset;
class AssetManager;
typedef const ID<Asset>& IDA;
typedef P<Asset> PAsset;
typedef P<const Asset> PcAsset;
typedef lib::P<Asset> PAsset;
typedef lib::P<const Asset> PcAsset;

View file

@ -44,15 +44,14 @@ using std::string;
namespace proc {
namespace asset {
using lib::P;
using lib::Symbol;
using lib::Literal;
class Proc;
class ProcPatt;
typedef P<const asset::Proc> PProc;
typedef P<const asset::ProcPatt> PProcPatt;
using PProc = lib::P<const asset::Proc>;
using PProcPatt = lib::P<const asset::ProcPatt>;
static Symbol CURRENT = "current";

View file

@ -49,7 +49,7 @@ namespace asset {
mediaref.ident.version );
}
Media::PClipMO
Media::PClip
createClipMO (const Clip& thisClipAsset, const Media& mediaChannel)
{
return mobject::MObject::create (thisClipAsset,mediaChannel);
@ -64,9 +64,9 @@ namespace asset {
mediaref.getLength())
, source_ (mediaref)
, clipMO_ (createClipMO (*this, source_))
{
this->defineDependency (mediaref);
}
{
this->defineDependency (mediaref);
}
/** Specialisation of the asset::Media interface method,
@ -76,7 +76,7 @@ namespace asset {
* Placements or no placement at all (meaning it need not
* be placed within the session)
*/
Media::PClipMO
Media::PClip
Clip::createClip () const
{
return clipMO_;
@ -87,7 +87,7 @@ namespace asset {
/** return this wrapped into a shared ptr,
* because it's already the desired asset::Clip
*/
Media::PClip
Media::PClipAsset
Clip::getClipAsset ()
{
return AssetManager::wrap (*this);

View file

@ -42,21 +42,21 @@ namespace asset {
const Media& source_;
/** the corresponding (dependent) clip-MO */
PClipMO clipMO_;
PClip clipMO_;
public:
virtual PClipMO createClip () const;
virtual PClip createClip () const;
protected:
Clip (Media& mediaref);
friend class MediaFactory;
virtual PClip getClipAsset ();
virtual PClipAsset getClipAsset ();
virtual PMedia checkCompound () const;
};
typedef P<const asset::Clip> PClipAsset;
typedef lib::P<const asset::Clip> PClipAsset;
const string CLIP_SUBFOLDER = "clips"; // TODO: handling of hard-wired constants....

View file

@ -107,7 +107,7 @@ namespace asset {
public:
template<class KIND>
P<KIND>
lib::P<KIND>
get (ID<KIND> hash) const
{
return dynamic_pointer_cast<KIND,Asset> (find (hash));
@ -115,7 +115,7 @@ namespace asset {
template<class KIND>
void
put (ID<KIND> hash, P<KIND>& ptr)
put (ID<KIND> hash, lib::P<KIND>& ptr)
{
table[hash] = static_pointer_cast (ptr);
}

View file

@ -41,7 +41,7 @@ namespace asset {
{};
typedef P<Inventory> PInv;
typedef lib::P<Inventory> PInv;
}} // namespace proc::asset

View file

@ -75,11 +75,11 @@ namespace asset {
Media::PClipMO
Media::PClip
Media::createClip ()
{
PClip clipAsset (getClipAsset());
PClipMO clipMO = clipAsset->createClip();
PClipAsset clipAsset (getClipAsset());
PClip clipMO = clipAsset->createClip();
ENSURE (clipMO->isValid());
return clipMO;
@ -90,7 +90,7 @@ namespace asset {
* or to get the right reference to some already existing asset::Clip,
* especially when this media is part of a compound (multichannel) media.
*/
Media::PClip
Media::PClipAsset
Media::getClipAsset ()
{
if (PMedia parent = this->checkCompound())
@ -228,7 +228,7 @@ namespace asset {
* @throw Invalid if the given media asset is not top-level,
* but rather part or a multichannel (compound) media
*/
P<Clip>
lib::P<Clip>
MediaFactory::operator() (Media& mediaref)
{
if (mediaref.checkCompound())

View file

@ -75,10 +75,10 @@ namespace asset {
const Duration len_;
public:
typedef P<Media> PMedia;
typedef P<proc::asset::Clip> PClip;
typedef P<proc::asset::ProcPatt> PProcPatt;
typedef proc::mobject::session::PClipMO PClipMO;
using PMedia = lib::P<Media>;
using PClipAsset = lib::P<proc::asset::Clip>;
using PProcPatt = lib::P<proc::asset::ProcPatt>;
using PClip = mobject::Placement<mobject::session::Clip>;
static MediaFactory create;
@ -103,7 +103,7 @@ namespace asset {
* it can be regenerated from the corresponding asset::Clip
* @return a Placement smart ptr owning the new Clip MObject
*/
PClipMO createClip ();
PClip createClip ();
/** @return the overall length of the media represented by this asset */
virtual Duration getLength () const;
@ -116,7 +116,7 @@ namespace asset {
/** get or create the correct asset::Clip
* corresponding to this media */
virtual PClip getClipAsset ();
virtual PClipAsset getClipAsset ();
/** predicate to decide if this asset::Media
* is part of a compound (multichannel) media.
@ -144,7 +144,7 @@ namespace asset {
: boost::noncopyable
{
public:
typedef P<Media> PType;
typedef lib::P<Media> PType;
PType operator() (Asset::Ident& key, const string& file="");
PType operator() (const string& file, const Category& cat);
@ -154,7 +154,7 @@ namespace asset {
PType operator() (const char* file, const Category& cat);
PType operator() (const char* file, asset::Kind);
P<Clip>
lib::P<Clip>
operator() (Media& mediaref);
};

View file

@ -139,7 +139,7 @@ namespace asset {
inline ID<Meta>::ID(HashVal id) : ID<Asset> (id) {};
inline ID<Meta>::ID(const Meta& meta) : ID<Asset> (meta.getID()) {};
typedef P<Meta> PMeta;
typedef lib::P<Meta> PMeta;
@ -150,7 +150,7 @@ namespace asset {
: boost::noncopyable
{
public:
typedef P<asset::Meta> PType;
typedef lib::P<asset::Meta> PType;
template<class MA>
meta::Builder<MA> operator() (lib::idi::EntryID<MA> elementIdentity);

View file

@ -135,7 +135,7 @@ namespace meta {
* Later on the intention is that in such cases, instead of creating a new grid
* we'll silently return the already registered existing and equivalent grid.
*/
P<TimeGrid>
lib::P<TimeGrid>
Builder<TimeGrid>::commit()
{
if (predecessor_)

View file

@ -113,7 +113,7 @@ namespace meta {
* the origin of this (local) grid.
* @todo currently not supported (as of 12/2010)
*/
P<TimeGrid> predecessor_;
lib::P<TimeGrid> predecessor_;
/**
* initialise to blank (zero).
@ -130,7 +130,7 @@ namespace meta {
/** create a time grid
* based on settings within this builder
*/
P<TimeGrid> commit();
lib::P<TimeGrid> commit();
};

View file

@ -40,7 +40,7 @@ namespace asset {
using std::string;
class Pipe;
typedef P<Pipe> PPipe;
typedef lib::P<Pipe> PPipe;
template<>

View file

@ -50,7 +50,7 @@ namespace asset {
class Proc;
class ProcFactory;
typedef P<const Proc> PProc;
typedef lib::P<const Proc> PProc;
@ -121,7 +121,7 @@ namespace asset {
: boost::noncopyable
{
public:
typedef P<asset::Proc> PType;
typedef lib::P<asset::Proc> PType;
PType operator() (Asset::Ident& key); ////////////TODO define actual operation

View file

@ -65,7 +65,7 @@ namespace asset {
* some ProcPatt as a template for creating more
* specialised patterns.
*/
P<ProcPatt>
lib::P<ProcPatt>
ProcPatt::newCopy (string newID) const
{
TODO ("implement the Pattern-ID within the propDescriptor!");

View file

@ -40,8 +40,8 @@ namespace asset {
class Proc;
class ProcPatt;
class BuildInstruct;
typedef P<const asset::Proc> PProc;
typedef P<const asset::ProcPatt> PProcPatt;
typedef lib::P<const asset::Proc> PProc;
typedef lib::P<const asset::ProcPatt> PProcPatt;
typedef vector<BuildInstruct> InstructionSequence;
@ -64,7 +64,7 @@ namespace asset {
friend class StructFactoryImpl;
public:
P<ProcPatt> newCopy (string newID) const;
lib::P<ProcPatt> newCopy (string newID) const;
ProcPatt& attach (Symbol where, PProc& node);
ProcPatt& operator+= (PProcPatt& toReuse);

View file

@ -78,7 +78,7 @@ namespace asset {
class Sequence;
typedef P<Sequence> PSequence;
typedef lib::P<Sequence> PSequence;
@ -103,7 +103,6 @@ namespace asset {
};
typedef P<Sequence> PSequence;
///////////////////////////TODO currently just fleshing the API

View file

@ -76,7 +76,7 @@ namespace asset {
* asset is a code smell ////////////////////////////TICKET #691
*/
template<class STRU>
P<STRU>
lib::P<STRU>
StructFactory::newInstance (Symbol nameID)
{
Query<STRU> desired_name (isnil(nameID)? "" : "id("+nameID+")");
@ -103,10 +103,10 @@ namespace asset {
* created as a side effect of calling the concrete Struct subclass ctor.
*/
template<class STRU>
P<STRU>
lib::P<STRU>
StructFactory::operator() (Query<STRU> const& capabilities)
{
P<STRU> res;
lib::P<STRU> res;
QueryHandler<STRU>& typeHandler = ConfigResolver::instance();
typeHandler.resolve (res, capabilities);
@ -131,7 +131,7 @@ namespace asset {
* re-invoking the ConfigRules....
*/
template<class STRU>
P<STRU>
lib::P<STRU>
StructFactory::made4fake (Query<STRU> const& query)
{
STRU* pS = impl_->fabricate(query);
@ -149,7 +149,7 @@ namespace asset {
* @see ProcPatt
* @see DefaultsManager
*/
P<Pipe>
lib::P<Pipe>
StructFactory::newPipe (string pipeID, string streamID)
{
normaliseID (pipeID);
@ -178,18 +178,19 @@ namespace asset {
namespace proc {
namespace asset {
using PPipe = lib::P<Pipe>;
template P<Pipe> StructFactory::operator() (Query<Pipe> const&);
template PPipe StructFactory::operator() (Query<Pipe> const&);
template PProcPatt StructFactory::operator() (Query<const ProcPatt> const&);
template PTimeline StructFactory::operator() (Query<Timeline> const&);
template PSequence StructFactory::operator() (Query<Sequence>const&);
template P<Pipe> StructFactory::newInstance (Symbol);
template PPipe StructFactory::newInstance (Symbol);
template PProcPatt StructFactory::newInstance (Symbol);
template PTimeline StructFactory::newInstance (Symbol);
template PSequence StructFactory::newInstance (Symbol);
template P<Pipe> StructFactory::made4fake (Query<Pipe> const&);
template PPipe StructFactory::made4fake (Query<Pipe> const&);
template PProcPatt StructFactory::made4fake (Query<const ProcPatt> const&);
template PTimeline StructFactory::made4fake (Query<Timeline> const&);
template PSequence StructFactory::made4fake (Query<Sequence>const&);

View file

@ -151,17 +151,17 @@ namespace asset {
public:
template<class STRU>
P<STRU> operator() (Query<STRU> const& query);
lib::P<STRU> operator() (Query<STRU> const& query);
// P<Timeline> operator() (MORef<Binding>); ///////////TODO doesn't this create circular includes?? Any better idea how to refer to an existing binding?
// lib::P<Timeline> operator() (MORef<Binding>); ///////////TODO doesn't this create circular includes?? Any better idea how to refer to an existing binding?
template<class STRU>
P<STRU> newInstance (Symbol nameID ="");
lib::P<STRU> newInstance (Symbol nameID ="");
template<class STRU>
P<STRU> made4fake (Query<STRU> const& query); ///< @warning to be removed in Alpha when using a real resolution engine /////TICKET #710
lib::P<STRU> made4fake (Query<STRU> const& query); ///< @warning to be removed in Alpha when using a real resolution engine /////TICKET #710
P<Pipe> newPipe (string pipeID, string streamID);
lib::P<Pipe> newPipe (string pipeID, string streamID);
};

View file

@ -80,7 +80,7 @@ namespace asset {
class Timeline;
typedef P<Timeline> PTimeline;
typedef lib::P<Timeline> PTimeline;
/**

View file

@ -75,7 +75,7 @@ namespace asset {
class Viewer;
typedef P<Viewer> PViewer;
typedef lib::P<Viewer> PViewer;
/**

View file

@ -117,7 +117,7 @@ namespace asset {
DB::Lock guard(&registry);
//////////////////////////////////////////////////////////TICKET #840 handle duplicate Registrations
P<KIND> smart_ptr (obj, &destroy);
lib::P<KIND> smart_ptr (obj, &destroy);
registry.put (asset_id, smart_ptr);
return asset_id;
@ -129,10 +129,10 @@ namespace asset {
* of the stored object differs and can't be casted.
*/
template<class KIND>
P<KIND>
lib::P<KIND>
AssetManager::getAsset (const ID<KIND>& id)
{
if (P<KIND> obj = registry.get (id))
if (lib::P<KIND> obj = registry.get (id))
return obj;
else
if (known (id)) // provide Ident tuple of existing Asset
@ -148,7 +148,7 @@ namespace asset {
* is explicitly given by type KIND.
*/
template<class KIND>
P<KIND>
lib::P<KIND>
AssetManager::wrap (const KIND& asset)
{
ENSURE (instance().known(asset.id),
@ -250,6 +250,7 @@ namespace asset {
namespace proc {
namespace asset {
using lib::P;
template ID<Asset> AssetManager::reg (Asset* obj, const Asset::Ident& idi);

View file

@ -81,11 +81,11 @@ namespace asset {
/** retrieve the registered smart-ptr for any asset */
template<class KIND>
static P<KIND> wrap (const KIND& asset);
static lib::P<KIND> wrap (const KIND& asset);
/** find and return corresponding object */
template<class KIND>
P<KIND> getAsset (const ID<KIND>& id);
lib::P<KIND> getAsset (const ID<KIND>& id);
/** @return true if the given id is registered in the internal asset DB */

View file

@ -71,7 +71,7 @@ namespace query {
using proc::asset::PSequence;
using proc::mobject::session::Fork;
using proc::mobject::session::PFork;
using PFork = lib::P<Fork>;
template PPipe DefsManager::operator() (Query<Pipe> const&);
template PProcPatt DefsManager::operator() (Query<const ProcPatt> const&);

View file

@ -52,7 +52,6 @@
namespace proc {
namespace control {
// using lib::P;
// using std::string;
// using boost::format;

View file

@ -68,7 +68,6 @@ namespace mobject {
namespace builder {
using lib::P;
/**
* Policy invoking an catch-all function for processing
@ -146,10 +145,10 @@ namespace mobject {
}
template<class TAR>
P<TAR>
lib::P<TAR>
getPtr ()
{
P<TAR>* pP = currentWrapper_.get<P<TAR>*>();
lib::P<TAR>* pP = currentWrapper_.get<lib::P<TAR>*>();
ENSURE (pP, "wrong target type when invoking %s", __PRETTY_FUNCTION__);
return *pP;
}

View file

@ -46,7 +46,6 @@ namespace proc {
namespace mobject {
using std::string;
using lib::P;
//NOBUG_DECLARE_FLAG (mobjectmem);

View file

@ -65,8 +65,8 @@
namespace proc {
namespace asset {
class Timeline; typedef P<Timeline> PTimeline;
class Sequence; typedef P<Sequence> PSequence;
class Timeline; typedef lib::P<Timeline> PTimeline;
class Sequence; typedef lib::P<Sequence> PSequence;
}
namespace mobject {

View file

@ -32,7 +32,7 @@ namespace proc {
namespace asset {
class Sequence;
typedef P<Sequence> PSequence;
typedef lib::P<Sequence> PSequence;
}

View file

@ -32,7 +32,7 @@ namespace proc {
namespace asset {
class Pipe;
typedef P<Pipe> PPipe;
typedef lib::P<Pipe> PPipe;
}

View file

@ -26,6 +26,7 @@
#include "proc/mobject/session/abstractmo.hpp"
#include "lib/time/timevalue.hpp"
#include "lib/p.hpp"
namespace proc {
@ -40,8 +41,12 @@ namespace session {
using asset::Media;
using lib::time::TimeVar;
typedef P<Media> PMedia;
typedef P<asset::Clip> PClipAsset;
class Clip;
using PMedia = lib::P<Media>;
using PClipAsset = lib::P<asset::Clip>;
using PClip = Placement<Clip>;
/**
@ -103,7 +108,6 @@ namespace session {
};
typedef Placement<Clip> PClipMO;

View file

@ -40,8 +40,8 @@ namespace session {
using asset::Media;
using lib::time::TimeVar;
typedef P<Media> PMedia;
typedef P<asset::Clip> PClipAsset;
typedef lib::P<Media> PMedia;
typedef lib::P<asset::Clip> PClipAsset;
/**

View file

@ -42,7 +42,7 @@ namespace asset {
class Effect;
class Sequence;
typedef P<Sequence> PSequence;
typedef lib::P<Sequence> PSequence;
}

View file

@ -76,7 +76,7 @@ namespace asset {
template<class CHI, class PAR>
inline bool
dependencyCheck (P<CHI> child, P<PAR> parent)
dependencyCheck (lib::P<CHI> child, lib::P<PAR> parent)
{
return (child == parent)
|| (0 < child->getParents().size()

View file

@ -153,8 +153,8 @@ namespace test {
void dependProcPatt(string pID)
{
typedef P<Pipe> PPipe; /////TODO: transition to P<>
typedef P<const ProcPatt> PProcPatt;
typedef lib::P<Pipe> PPipe; /////TODO: transition to P<>
typedef lib::P<const ProcPatt> PProcPatt;
PPipe thePipe = Pipe::query ("pipe("+pID+")");
CHECK (thePipe);

View file

@ -65,7 +65,7 @@ namespace test {
////////////////////////////////////TICKET #589
typedef P<Media> PM; /////TODO: transition to P<>
typedef lib::P<Media> PM; /////TODO: transition to P<>
/** @test Creating and automatically registering Asset instances.
* Re-Retrieving the newly created objects from AssetManager.

View file

@ -198,8 +198,8 @@ namespace test {
Depend4Test<backend::test::MediaAccessMock> within_this_scope;
// -----Media and Clip--------------------------------
typedef P<Media> PM;
typedef P<Clip> PC;
typedef lib::P<Media> PM;
typedef lib::P<Clip> PC;
PM mm = asset::Media::create("test-1", VIDEO);
PC cc = mm->createClip()->findClipAsset();
CHECK (dependencyCheck (cc,mm));

View file

@ -54,8 +54,8 @@ namespace test {
*/
class MakeClip_test : public Test
{
typedef P<asset::Media> PM;
typedef asset::Media::PClipMO PC;
typedef lib::P<asset::Media> PM;
typedef asset::Media::PClip PC;
virtual void run (Arg)
{

View file

@ -79,7 +79,7 @@ namespace test {
* within AssetManager by the Asset base class ctor
*/
template<class A>
P<TestAsset<A> >
lib::P<TestAsset<A> >
TestAsset<A>::ptrFromThis ()
{
return static_pointer_cast<TestAsset<A>,Asset>
@ -111,8 +111,8 @@ namespace test {
template TestAsset<Asset>::TestAsset (PAsset& pRef);
template TestAsset<Unknown>::TestAsset (PAsset& pRef);
template P<TestAsset<Asset> > TestAsset<Asset>::ptrFromThis ();
template P<TestAsset<Unknown> > TestAsset<Unknown>::ptrFromThis ();
template lib::P<TestAsset<Asset> > TestAsset<Asset>::ptrFromThis ();
template lib::P<TestAsset<Unknown> > TestAsset<Unknown>::ptrFromThis ();

View file

@ -53,7 +53,7 @@ namespace test {
static void deleter (TestAsset<A>* aa) { delete aa; }
public:
typedef P<TestAsset<A> > PA;
typedef lib::P<TestAsset<A> > PA;
static PA create () { return (new TestAsset<A> )->ptrFromThis(); }
static PA create (PAsset& pRef) { return (new TestAsset<A> (pRef))->ptrFromThis(); }