relocate EntryID to library namespace
This commit is contained in:
parent
7285c6f4d5
commit
f88236319f
13 changed files with 56 additions and 67 deletions
|
|
@ -39,8 +39,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef ASSET_ENTRY_ID_H
|
#ifndef LIB_IDI_ENTRY_ID_H
|
||||||
#define ASSET_ENTRY_ID_H
|
#define LIB_IDI_ENTRY_ID_H
|
||||||
|
|
||||||
|
|
||||||
#include "lib/error.hpp"
|
#include "lib/error.hpp"
|
||||||
|
|
@ -54,8 +54,16 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace proc {
|
namespace lib {
|
||||||
namespace asset {
|
|
||||||
|
/**
|
||||||
|
* Identification Schemes.
|
||||||
|
* Collection of commonly used mechanisms to build identification records,
|
||||||
|
* unique identifiers, registration numbers and hashes. These are used as glue
|
||||||
|
* and thin abstraction to link various subsystems or to allow interoperation
|
||||||
|
* of registration facilities
|
||||||
|
*/
|
||||||
|
namespace idi {
|
||||||
|
|
||||||
namespace error = lumiera::error;
|
namespace error = lumiera::error;
|
||||||
|
|
||||||
|
|
@ -65,19 +73,6 @@ namespace asset {
|
||||||
using lib::idi::generateSymbolicID;
|
using lib::idi::generateSymbolicID;
|
||||||
using lib::idi::getTypeHash;
|
using lib::idi::getTypeHash;
|
||||||
using lib::idi::typeSymbol;
|
using lib::idi::typeSymbol;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Identification Schemes.
|
|
||||||
* Collection of commonly used mechanisms to build identification records,
|
|
||||||
* unique identifiers, registration numbers and hashes. These are used as glue
|
|
||||||
* and thin abstraction to link various subsystems or to allow interoperation
|
|
||||||
* of registration facilities
|
|
||||||
*/
|
|
||||||
namespace idi {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
using lib::hash::LuidH;
|
using lib::hash::LuidH;
|
||||||
using lib::HashVal;
|
using lib::HashVal;
|
||||||
|
|
||||||
|
|
@ -126,7 +121,6 @@ namespace asset {
|
||||||
class BareEntryID
|
class BareEntryID
|
||||||
: public boost::equality_comparable<BareEntryID>
|
: public boost::equality_comparable<BareEntryID>
|
||||||
{
|
{
|
||||||
typedef lib::hash::LuidH LuidH;
|
|
||||||
|
|
||||||
string symbol_;
|
string symbol_;
|
||||||
LuidH hash_;
|
LuidH hash_;
|
||||||
|
|
@ -281,5 +275,5 @@ namespace asset {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}} // namespace proc::asset
|
}} // namespace lib::idi
|
||||||
#endif
|
#endif /*LIB_IDI_ENTRY_ID_H*/
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "proc/asset/meta.hpp"
|
#include "proc/asset/meta.hpp"
|
||||||
#include "lib/util.hpp"
|
#include "lib/util.hpp"
|
||||||
|
|
||||||
|
using lib::idi::EntryID;
|
||||||
|
|
||||||
namespace proc {
|
namespace proc {
|
||||||
namespace asset {
|
namespace asset {
|
||||||
|
|
|
||||||
|
|
@ -153,10 +153,10 @@ namespace asset {
|
||||||
typedef P<asset::Meta> PType;
|
typedef P<asset::Meta> PType;
|
||||||
|
|
||||||
template<class MA>
|
template<class MA>
|
||||||
meta::Builder<MA> operator() (EntryID<MA> elementIdentity);
|
meta::Builder<MA> operator() (lib::idi::EntryID<MA> elementIdentity);
|
||||||
|
|
||||||
template<class MA>
|
template<class MA>
|
||||||
meta::Builder<MA> operator() (meta::Descriptor const& prototype, EntryID<MA> elementIdentity);
|
meta::Builder<MA> operator() (meta::Descriptor const& prototype, lib::idi::EntryID<MA> elementIdentity);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include "proc/asset/meta/time-grid.hpp"
|
#include "proc/asset/meta/time-grid.hpp"
|
||||||
#include "proc/asset/struct-scheme.hpp"
|
#include "proc/asset/struct-scheme.hpp"
|
||||||
#include "proc/asset/entry-id.hpp"
|
|
||||||
#include "proc/assetmanager.hpp"
|
#include "proc/assetmanager.hpp"
|
||||||
#include "lib/time/quantiser.hpp"
|
#include "lib/time/quantiser.hpp"
|
||||||
#include "lib/time/timevalue.hpp"
|
#include "lib/time/timevalue.hpp"
|
||||||
|
|
@ -49,7 +48,7 @@ namespace meta {
|
||||||
|
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
TimeGrid::TimeGrid (EntryID<TimeGrid> const& nameID)
|
TimeGrid::TimeGrid (GridID const& nameID)
|
||||||
: Meta (idi::getAssetIdent (nameID))
|
: Meta (idi::getAssetIdent (nameID))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
@ -108,12 +107,12 @@ namespace meta {
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SimpleTimeGrid (Time start, Duration frameDuration, EntryID<TimeGrid> const& name)
|
SimpleTimeGrid (Time start, Duration frameDuration, GridID const& name)
|
||||||
: TimeGrid (name)
|
: TimeGrid (name)
|
||||||
, FixedFrameQuantiser(frameDuration,start)
|
, FixedFrameQuantiser(frameDuration,start)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
SimpleTimeGrid (Time start, FrameRate frames_per_second, EntryID<TimeGrid> const& name)
|
SimpleTimeGrid (Time start, FrameRate frames_per_second, GridID const& name)
|
||||||
: TimeGrid (name)
|
: TimeGrid (name)
|
||||||
, FixedFrameQuantiser(frames_per_second,start)
|
, FixedFrameQuantiser(frames_per_second,start)
|
||||||
{ }
|
{ }
|
||||||
|
|
@ -149,7 +148,7 @@ namespace meta {
|
||||||
_Fmt gridIdFormat("grid(%f_%d)");
|
_Fmt gridIdFormat("grid(%f_%d)");
|
||||||
id_ = string(gridIdFormat % fps_ % _raw(origin_));
|
id_ = string(gridIdFormat % fps_ % _raw(origin_));
|
||||||
}
|
}
|
||||||
EntryID<TimeGrid> nameID (id_);
|
GridID nameID (id_);
|
||||||
|
|
||||||
return publishWrapped (*new SimpleTimeGrid(origin_, fps_, nameID));
|
return publishWrapped (*new SimpleTimeGrid(origin_, fps_, nameID));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
#define ASSET_META_TIME_GRID_H
|
#define ASSET_META_TIME_GRID_H
|
||||||
|
|
||||||
#include "proc/asset/meta.hpp"
|
#include "proc/asset/meta.hpp"
|
||||||
|
#include "proc/asset/entry-id.hpp"
|
||||||
#include "lib/time/grid.hpp"
|
#include "lib/time/grid.hpp"
|
||||||
#include "lib/time/timevalue.hpp"
|
#include "lib/time/timevalue.hpp"
|
||||||
#include "lib/symbol.hpp"
|
#include "lib/symbol.hpp"
|
||||||
|
|
@ -67,7 +68,8 @@ namespace meta {
|
||||||
|
|
||||||
|
|
||||||
class TimeGrid;
|
class TimeGrid;
|
||||||
typedef P<TimeGrid> PGrid;
|
using PGrid = lib::P<TimeGrid>;
|
||||||
|
using GridID = lib::idi::EntryID<TimeGrid>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,7 +93,7 @@ namespace meta {
|
||||||
static PGrid build (Symbol gridID, FrameRate frames_per_second, Time origin);
|
static PGrid build (Symbol gridID, FrameRate frames_per_second, Time origin);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TimeGrid (EntryID<TimeGrid> const&);
|
TimeGrid (GridID const&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ namespace asset {
|
||||||
using proc::mobject::session::Scope;
|
using proc::mobject::session::Scope;
|
||||||
using proc::mobject::session::match_specificFork;
|
using proc::mobject::session::match_specificFork;
|
||||||
using proc::mobject::session::RBinding;
|
using proc::mobject::session::RBinding;
|
||||||
|
using proc::mobject::session::ForkID;
|
||||||
using proc::mobject::session::RFork;
|
using proc::mobject::session::RFork;
|
||||||
using proc::mobject::session::Fork;
|
using proc::mobject::session::Fork;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ namespace asset{
|
||||||
*/
|
*/
|
||||||
template<typename TY>
|
template<typename TY>
|
||||||
inline Asset::Ident
|
inline Asset::Ident
|
||||||
getAssetIdent (EntryID<TY> const& entryID)
|
getAssetIdent (lib::idi::EntryID<TY> const& entryID)
|
||||||
{
|
{
|
||||||
Category cat (STRUCT, idi::StructTraits<TY>::catFolder());
|
Category cat (STRUCT, idi::StructTraits<TY>::catFolder());
|
||||||
return Asset::Ident (entryID.getSym(), cat);
|
return Asset::Ident (entryID.getSym(), cat);
|
||||||
|
|
|
||||||
|
|
@ -34,25 +34,13 @@ namespace proc {
|
||||||
namespace mobject {
|
namespace mobject {
|
||||||
namespace session { //////////////////////////////////////////////////////TICKET #637
|
namespace session { //////////////////////////////////////////////////////TICKET #637
|
||||||
|
|
||||||
using lib::P;
|
|
||||||
using lib::time::Time;
|
using lib::time::Time;
|
||||||
|
|
||||||
class Fork;
|
class Fork;
|
||||||
|
|
||||||
typedef P<Fork> PFork;
|
using ForkID = lib::idi::EntryID<Fork>;
|
||||||
|
|
||||||
}}
|
|
||||||
|
|
||||||
namespace asset { //////////////////////////////////////////////////////TICKET #637
|
|
||||||
|
|
||||||
typedef EntryID<mobject::session::Fork> ForkID;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace mobject {
|
|
||||||
namespace session {
|
|
||||||
|
|
||||||
using asset::ForkID;
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////TICKET #646
|
//////////////////////////////////////////////////////TICKET #646
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ namespace session {
|
||||||
Placement<Root> operator() (lumiera::query::DefsManager&);
|
Placement<Root> operator() (lumiera::query::DefsManager&);
|
||||||
Placement<Clip> operator() (asset::Clip const&, asset::Media const&);
|
Placement<Clip> operator() (asset::Clip const&, asset::Media const&);
|
||||||
Placement<Clip> operator() (asset::Clip const&, vector<asset::Media const*>);
|
Placement<Clip> operator() (asset::Clip const&, vector<asset::Media const*>);
|
||||||
Placement<Fork> operator() (asset::EntryID<Fork> const&);
|
Placement<Fork> operator() (lib::idi::EntryID<Fork> const&);
|
||||||
Placement<Effect> operator() (asset::Effect const&);
|
Placement<Effect> operator() (asset::Effect const&);
|
||||||
Placement<Label> operator() (lib::Symbol);
|
Placement<Label> operator() (lib::Symbol);
|
||||||
Placement<Binding>operator() (asset::PSequence const&);
|
Placement<Binding>operator() (asset::PSequence const&);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace proc {
|
||||||
class ImplFacade;
|
class ImplFacade;
|
||||||
class ImplConstraint;
|
class ImplConstraint;
|
||||||
|
|
||||||
typedef asset::EntryID<StreamType> ID;
|
typedef lib::idi::EntryID<StreamType> ID;
|
||||||
|
|
||||||
|
|
||||||
Prototype const& prototype;
|
Prototype const& prototype;
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,9 @@ using std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace proc {
|
namespace lib {
|
||||||
namespace asset{
|
namespace idi {
|
||||||
namespace test {
|
namespace test{
|
||||||
|
|
||||||
using lumiera::error::LUMIERA_ERROR_WRONG_TYPE;
|
using lumiera::error::LUMIERA_ERROR_WRONG_TYPE;
|
||||||
|
|
||||||
|
|
@ -58,11 +58,11 @@ namespace test {
|
||||||
|
|
||||||
struct Dummy { };
|
struct Dummy { };
|
||||||
|
|
||||||
typedef EntryID<Dummy> DummyID;
|
|
||||||
typedef EntryID<mobject::session::Fork> ForkID;
|
|
||||||
typedef EntryID<mobject::session::Clip> ClipID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using DummyID = EntryID<Dummy>;
|
||||||
|
using ForkID = EntryID<proc::mobject::session::Fork>;
|
||||||
|
using ClipID = EntryID<proc::mobject::session::Clip>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -133,14 +133,19 @@ namespace test {
|
||||||
void
|
void
|
||||||
checkBasicProperties ()
|
checkBasicProperties ()
|
||||||
{
|
{
|
||||||
|
using proc::asset::Asset;
|
||||||
|
using proc::asset::STRUCT;
|
||||||
|
using proc::asset::Category;
|
||||||
|
using proc::asset::idi::getAssetIdent;
|
||||||
|
|
||||||
ForkID tID(" test ⚡ ☠ ☭ ⚡ track ");
|
ForkID tID(" test ⚡ ☠ ☭ ⚡ track ");
|
||||||
CHECK (idi::getAssetIdent(tID) == Asset::Ident("test_track", Category(STRUCT,"forks"), "lumi", 0));
|
CHECK (getAssetIdent(tID) == Asset::Ident("test_track", Category(STRUCT,"forks"), "lumi", 0));
|
||||||
|
|
||||||
CHECK (tID.getHash() == ForkID("☢ test ☢ track ☢").getHash());
|
CHECK (tID.getHash() == ForkID("☢ test ☢ track ☢").getHash());
|
||||||
|
|
||||||
CHECK (tID.getSym() == idi::getAssetIdent(tID).name);
|
CHECK (tID.getSym() == getAssetIdent(tID).name);
|
||||||
CHECK (idi::getAssetIdent(ForkID()).category == Category (STRUCT,"forks"));
|
CHECK (getAssetIdent(ForkID()).category == Category (STRUCT,"forks"));
|
||||||
CHECK (idi::getAssetIdent(ClipID()).category == Category (STRUCT,"clips"));
|
CHECK (getAssetIdent(ClipID()).category == Category (STRUCT,"clips"));
|
||||||
|
|
||||||
ClipID cID2,cID3;
|
ClipID cID2,cID3;
|
||||||
CHECK (cID2.getSym() < cID3.getSym());
|
CHECK (cID2.getSym() < cID3.getSym());
|
||||||
|
|
@ -154,7 +159,7 @@ namespace test {
|
||||||
tID = arbitrary;
|
tID = arbitrary;
|
||||||
CHECK (tID.getHash() == arbitrary.getHash());
|
CHECK (tID.getHash() == arbitrary.getHash());
|
||||||
CHECK (tID.getSym() == arbitrary.getSym());
|
CHECK (tID.getSym() == arbitrary.getSym());
|
||||||
CHECK (idi::getAssetIdent(tID)== idi::getAssetIdent(arbitrary));
|
CHECK (getAssetIdent(tID)== getAssetIdent(arbitrary));
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << showSizeof<ForkID>() << endl;
|
cout << showSizeof<ForkID>() << endl;
|
||||||
|
|
@ -214,8 +219,8 @@ namespace test {
|
||||||
CHECK (bIDt.getSym() == bIDc.getSym());
|
CHECK (bIDt.getSym() == bIDc.getSym());
|
||||||
CHECK ("suspicious" == bIDc.getSym());
|
CHECK ("suspicious" == bIDc.getSym());
|
||||||
|
|
||||||
using mobject::session::Fork;
|
using proc::mobject::session::Fork;
|
||||||
using mobject::session::Clip;
|
using proc::mobject::session::Clip;
|
||||||
ForkID tIDnew = bIDt.recast<Fork>();
|
ForkID tIDnew = bIDt.recast<Fork>();
|
||||||
ClipID cIDnew = bIDc.recast<Clip>();
|
ClipID cIDnew = bIDc.recast<Clip>();
|
||||||
CHECK (tIDnew == tID);
|
CHECK (tIDnew == tID);
|
||||||
|
|
@ -291,4 +296,4 @@ namespace test {
|
||||||
LAUNCHER (EntryID_test, "unit asset");
|
LAUNCHER (EntryID_test, "unit asset");
|
||||||
|
|
||||||
|
|
||||||
}}} // namespace proc::asset::test
|
}}} // namespace lib::idi::test
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ namespace test {
|
||||||
using namespace lib::time;
|
using namespace lib::time;
|
||||||
|
|
||||||
typedef Builder<TimeGrid> GridBuilder;
|
typedef Builder<TimeGrid> GridBuilder;
|
||||||
typedef EntryID<TimeGrid> GridID;
|
|
||||||
|
|
||||||
namespace { // Test definitions...
|
namespace { // Test definitions...
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,14 @@ namespace query {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace proc {
|
namespace lib {
|
||||||
namespace asset{
|
namespace idi {
|
||||||
namespace test {
|
namespace test{
|
||||||
|
|
||||||
using mobject::session::test::DummyEntity;
|
using proc::mobject::session::test::DummyEntity;
|
||||||
using mobject::session::test::PDum;
|
using proc::mobject::session::test::PDum;
|
||||||
|
|
||||||
typedef EntryID<DummyEntity> DummyID;
|
using DummyID = EntryID<DummyEntity>;
|
||||||
|
|
||||||
namespace { // Test definitions...
|
namespace { // Test definitions...
|
||||||
|
|
||||||
|
|
@ -244,4 +244,4 @@ namespace test {
|
||||||
LAUNCHER (TypedID_test, "unit asset");
|
LAUNCHER (TypedID_test, "unit asset");
|
||||||
|
|
||||||
|
|
||||||
}}} // namespace proc::asset::test
|
}}} // namespace lib::idi::test
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue