more stubbing and compilation fixes

This commit is contained in:
Fischlurch 2010-03-28 05:14:57 +02:00
parent 8a2515c0b0
commit c43040985c
9 changed files with 105 additions and 16 deletions

View file

@ -87,7 +87,7 @@ namespace asset {
boost::hash_combine(seed, sym);
lumiera_uid tmpLUID;
lumiera_uid_set_ptr (&tmpLUID, reinterpret_cast<void*> (&seed));
return reinterpret_cast<LuidH> (tmpLUID);
return reinterpret_cast<LuidH&> (tmpLUID);
}
}
@ -110,9 +110,9 @@ namespace asset {
public:
explicit
BareEntryID (string const& symbolID, HashVal seed =0) /////////////TODO couldn't this be protected?
BareEntryID (string const& symbolID, idi::HashVal seed =0) /////////////TODO couldn't this be protected?
: symbol_(util::sanitise(symbolID))
, hash_(buildHash (symbol_, seed))
, hash_(idi::buildHash (symbol_, seed))
{ }
/* default copy- and assignable */
@ -138,7 +138,7 @@ namespace asset {
/** using BareEntryID derived objects as keys within tr1::unordered_map */
struct UseEmbeddedHash
: public std::unary_function<BA, size_t>
: public std::unary_function<BareEntryID, size_t>
{
size_t operator() (BareEntryID const& obj) const { return obj.getHash(); }
};
@ -190,7 +190,7 @@ namespace asset {
getIdent() const
{
Category cat (STRUCT, idi::StructTraits<TY>::catFolder);
return Asset::Ident (name, cat);
return Asset::Ident (this->getSym(), cat);
}
static idi::HashVal
@ -225,7 +225,7 @@ namespace asset {
operator string () const
{
return "ID<"+idi::StructTraits<TY>::idSymbol+">-"+getSym();
return "ID<"+idi::StructTraits<TY>::idSymbol+">-"+EntryID::getSym();
}
friend ostream& operator<< (ostream& os, EntryID const& id) { return os << string(id); }

View file

@ -37,7 +37,8 @@
#include "proc/mobject/session.hpp"
#include "proc/mobject/mobject.hpp"
#include "proc/mobject/session/binding.hpp"
#include "proc/mobject/session/mobjectfactory.hpp"
#include "common/configrules.hpp"
#include "proc/asset/timeline.hpp"
#include "proc/asset/sequence.hpp"

View file

@ -28,7 +28,7 @@ namespace mobject {
namespace session {
/** */
Binding::Binding (PSequence& sequence_to_bind)
Binding::Binding (PSequence const& sequence_to_bind)
: boundSequence_(sequence_to_bind)
{
throwIfInvalid();

View file

@ -28,12 +28,17 @@
#include "proc/mobject/builder/buildertool.hpp"
namespace asset { class Sequence; }
namespace asset {
class Sequence;
typedef lumiera::P<Sequence> PSequence;
}
namespace mobject {
namespace session {
typedef lumiera::P<asset::Sequence> PSequence;
using asset::PSequence;
/**
* Explicit link to bind a Sequence (container) to be used within the Session,
@ -48,7 +53,7 @@ namespace session {
bool isValid() const;
public:
Binding (PSequence& sequence_to_bind);
Binding (PSequence const& sequence_to_bind);
DEFINE_PROCESSABLE_BY (builder::BuilderTool);

View file

@ -99,7 +99,7 @@ namespace session {
/** */
Placement<Binding>
MObjectFactory::operator() (PSequence& sequence_to_bind)
MObjectFactory::operator() (PSequence const& sequence_to_bind)
{
TODO ("any additional liabilities when creating a binding?");
return Placement<Binding> (*new Binding(sequence_to_bind), &deleterFunc);

View file

@ -53,8 +53,6 @@ namespace session {
typedef P<asset::Track> PTrackAsset;
using asset::PSequence;
class DefsManager;
@ -73,7 +71,7 @@ namespace session {
Placement<Track> operator() (PTrackAsset&);
Placement<Effect> operator() (asset::Effect const&);
Placement<Label> operator() (lib::Symbol);
Placement<Binding>operator() (PSequence&);
Placement<Binding>operator() (asset::PSequence const&);
////////////////////////////////////////////////////////////////////////////////TICKET #414
};

View file

@ -0,0 +1,73 @@
/*
SESSION-SERVICE-FETCH.hpp - session implementation service API: fetch PlacementRef
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file session-service-fetch.hpp
** Implementation level session API: resolve a Placement by hash-ID.
** This specialised service is intended to be used by PlacementRef,
** in order to (re)-access the Placement instance within the session,
** given the hash-ID of this placement. An implementation of this
** service is available through the SessionServices access mechanism.
**
** @see session-impl.hpp implementation of the service
** @see session-services.cpp implementation of access
**
*/
#ifndef MOBJECT_SESSION_SESSION_SERVICE_FETCH_H
#define MOBJECT_SESSION_SESSION_SERVICE_FETCH_H
//#include "proc/mobject/session.hpp"
//#include "lib/meta/generator.hpp"
#include "proc/mobject/placement.hpp"
namespace mobject {
namespace session {
// using lumiera::typelist::InstantiateChained;
// using lumiera::typelist::InheritFrom;
// using lumiera::typelist::NullType;
/**
* Implementation-level service for resolving an Placement-ID.
* Usually, this service is backed by the PlacementIndex of the
* current session -- however, for the purpose of unit testing,
* this index may be overlaid temporarily, by using the
* SessionServiceMockIndex API.
*/
class SessionServiceFetch
{
public:
static PlacementMO& resolveID (PlacementMO::ID const&) ;
static bool isRegisteredID (PlacementMO::ID const&) ;
static bool isAccessible() ;
};
}} // namespace mobject::session
#endif

View file

@ -25,6 +25,8 @@
#include "lib/test/test-helper.hpp"
#include "proc/asset/entry-id.hpp"
#include "proc/mobject/session/clip.hpp"
#include "proc/mobject/session/track.hpp"
#include "lib/util-foreach.hpp"
#include "lib/symbol.hpp"
@ -85,7 +87,6 @@ namespace test {
checkCreation ()
{
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
DummyID dID1;
DummyID dID2("strange");
DummyID dID3;
@ -112,12 +113,14 @@ namespace test {
DummyID x (dID2); // copy ctor
CHECK (x == dID2);
CHECK (!isSameObject (x, dID2));
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
}
void
checkBasicProperties ()
{
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
TrackID tID(" test ⚡ ☠ ☭ ⚡ track ");
CHECK (tID.getIdent() == Asset::Ident("test_track", Category(STRUCT,"tracks"), "lumi", 0));
@ -142,12 +145,14 @@ namespace test {
}
CHECK (sizeof (tID) == sizeof(hash::LuidH) + sizeof(Literal));
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
}
void
checkComparisions ()
{
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
TrackID tID1("a1");
TrackID tID2("a1");
TrackID tID3("a2");
@ -165,12 +170,14 @@ namespace test {
CHECK (tID4 > tID3);
CHECK (TrackID() < TrackID());
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
}
void
checkErasure ()
{
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
TrackID tID("suspicious");
ClipID cID("suspicious");
@ -201,12 +208,14 @@ namespace test {
lumiera_uid_copy (&plainLUID, tID.getHash().get());
CHECK (cID == ClipID::recast ("suspicious", plainLUID)); // upcast from type erased data (note: changed type)
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
}
void
buildHashtable ()
{ //---key--+-value-+-hash-function---
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
typedef std::tr1::unordered_map<DummyID, string, DummyID::UseEmbeddedHash()> Hashtable;
Hashtable tab;
@ -220,6 +229,7 @@ namespace test {
CHECK (1000 == tab.size());
for_each (tab.getKeys(), tab[_1] == string(_1)); /////TODO use boost::lambda to make this happen....
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #582
}
};

View file

@ -28,6 +28,8 @@
#include <tr1/unordered_map>
using util::isSameObject;
namespace lib {
namespace test{