diff --git a/src/proc/asset/entry-id.hpp b/src/proc/asset/entry-id.hpp index d22e0d3a8..02b8f49d9 100644 --- a/src/proc/asset/entry-id.hpp +++ b/src/proc/asset/entry-id.hpp @@ -43,8 +43,7 @@ #define ASSET_ENTRY_ID_H -#include "proc/asset.hpp" -#include "proc/asset/struct-scheme.hpp" +#include "lib/error.hpp" #include "lib/hash-indexed.hpp" #include "lib/idi/genfunc.hpp" #include "lib/util.hpp" @@ -58,11 +57,14 @@ namespace proc { namespace asset { + namespace error = lumiera::error; + using std::string; using std::ostream; using lib::idi::generateSymbolicID; using lib::idi::getTypeHash; + using lib::idi::typeSymbol; /** @@ -219,21 +221,6 @@ namespace asset { { } - /** generate an Asset identification tuple - * based on this EntryID's symbolic ID and type information. - * The remaining fields are filled in with hardwired defaults. - * @note there is a twist, as this asset identity tuple generates - * a different hash as the EntryID. It would be desirable - * to make those two addressing systems interchangeable. /////////////TICKET #739 - */ - Asset::Ident - getIdent() const - { - Category cat (STRUCT, idi::StructTraits::catFolder()); - return Asset::Ident (this->getSym(), cat); - } - - /** @return true if the upcast would yield exactly the same * tuple (symbol,type) as was used on original definition * of an ID, based on the given BareEntryID. Implemented @@ -258,7 +245,7 @@ namespace asset { operator string () const { - return "ID<"+idi::StructTraits::idSymbol()+">-"+EntryID::getSym(); + return "ID<"+typeSymbol()+">-"+EntryID::getSym(); } friend ostream& operator<< (ostream& os, EntryID const& id) { return os << string(id); } diff --git a/src/proc/asset/meta/time-grid.cpp b/src/proc/asset/meta/time-grid.cpp index 8966b4383..12771ec67 100644 --- a/src/proc/asset/meta/time-grid.cpp +++ b/src/proc/asset/meta/time-grid.cpp @@ -22,6 +22,7 @@ #include "proc/asset/meta/time-grid.hpp" +#include "proc/asset/struct-scheme.hpp" #include "proc/asset/entry-id.hpp" #include "proc/assetmanager.hpp" #include "lib/time/quantiser.hpp" @@ -36,7 +37,6 @@ using util::_Fmt; using util::cStr; using util::isnil; -using boost::str; using std::string; @@ -50,7 +50,7 @@ namespace meta { /** */ TimeGrid::TimeGrid (EntryID const& nameID) - : Meta (nameID.getIdent()) + : Meta (idi::getAssetIdent (nameID)) { } diff --git a/src/proc/asset/struct-scheme.hpp b/src/proc/asset/struct-scheme.hpp index 34b2bc581..1f015a36e 100644 --- a/src/proc/asset/struct-scheme.hpp +++ b/src/proc/asset/struct-scheme.hpp @@ -37,6 +37,8 @@ #include "lib/symbol.hpp" +#include "proc/asset.hpp" +#include "proc/asset/entry-id.hpp" #include @@ -45,11 +47,9 @@ using boost::format; -namespace lumiera { - class StreamType; -} - namespace proc { + class StreamType; + namespace mobject { namespace session { @@ -105,7 +105,7 @@ namespace asset{ static Symbol catFolder() { return "pipes";} static Symbol idSymbol() { return "pipe"; } }; - template<> struct StructTraits + template<> struct StructTraits { static Symbol namePrefix() { return "type"; } static Symbol catFolder() { return "stream-types";} @@ -147,7 +147,21 @@ namespace asset{ - + /** generate an Asset identification tuple + * based on this EntryID's symbolic ID and type information. + * The remaining fields are filled in with hardwired defaults. + * @note there is a twist, as this asset identity tuple generates + * a different hash as the EntryID. It would be desirable + * to make those two addressing systems interchangeable. /////////////TICKET #739 + */ + template + inline Asset::Ident + getAssetIdent (EntryID const& entryID) + { + Category cat (STRUCT, idi::StructTraits::catFolder()); + return Asset::Ident (entryID.getSym(), cat); + } + }}} // namespace asset::idi diff --git a/src/proc/mobject/session/generator-mo.hpp b/src/proc/mobject/session/generator-mo.hpp index c0c64a4f9..ba72e0e9b 100644 --- a/src/proc/mobject/session/generator-mo.hpp +++ b/src/proc/mobject/session/generator-mo.hpp @@ -83,8 +83,6 @@ namespace session { DEFINE_PROCESSABLE_BY (builder::BuilderTool); }; - - typedef Placement PClipMO; diff --git a/src/proc/streamtype.hpp b/src/proc/streamtype.hpp index d42fbf6cd..296bc79b3 100644 --- a/src/proc/streamtype.hpp +++ b/src/proc/streamtype.hpp @@ -191,4 +191,10 @@ namespace proc { } // namespace proc -#endif + + +namespace lumiera { + using proc::StreamType; +} + +#endif /*PROC_STREAMTYPE_H*/ diff --git a/tests/core/proc/asset/entry-id-test.cpp b/tests/core/proc/asset/entry-id-test.cpp index 12bfda4ce..e9ceadfb8 100644 --- a/tests/core/proc/asset/entry-id-test.cpp +++ b/tests/core/proc/asset/entry-id-test.cpp @@ -25,6 +25,7 @@ #include "lib/test/test-helper.hpp" #include "proc/asset/entry-id.hpp" +#include "proc/asset/struct-scheme.hpp" #include "proc/mobject/session/clip.hpp" #include "proc/mobject/session/fork.hpp" #include "lib/meta/trait-special.hpp" @@ -133,13 +134,13 @@ namespace test { checkBasicProperties () { ForkID tID(" test ⚡ ☠ ☭ ⚡ track "); - CHECK (tID.getIdent() == Asset::Ident("test_track", Category(STRUCT,"forks"), "lumi", 0)); + CHECK (idi::getAssetIdent(tID) == Asset::Ident("test_track", Category(STRUCT,"forks"), "lumi", 0)); CHECK (tID.getHash() == ForkID("☢ test ☢ track ☢").getHash()); - CHECK (tID.getSym() == tID.getIdent().name); - CHECK (ForkID().getIdent().category == Category (STRUCT,"forks")); - CHECK (ClipID().getIdent().category == Category (STRUCT,"clips")); + CHECK (tID.getSym() == idi::getAssetIdent(tID).name); + CHECK (idi::getAssetIdent(ForkID()).category == Category (STRUCT,"forks")); + CHECK (idi::getAssetIdent(ClipID()).category == Category (STRUCT,"clips")); ClipID cID2,cID3; CHECK (cID2.getSym() < cID3.getSym()); @@ -153,7 +154,7 @@ namespace test { tID = arbitrary; CHECK (tID.getHash() == arbitrary.getHash()); CHECK (tID.getSym() == arbitrary.getSym()); - CHECK (tID.getIdent()== arbitrary.getIdent()); + CHECK (idi::getAssetIdent(tID)== idi::getAssetIdent(arbitrary)); } cout << showSizeof() << endl;