push creation of the root MObject to users of PlacementIndex

This commit is contained in:
Fischlurch 2009-12-17 03:16:08 +01:00
parent d7aab2990f
commit 9f09a8aa49
6 changed files with 62 additions and 11 deletions

View file

@ -68,7 +68,6 @@ namespace session {
using std::tr1::unordered_map;
using std::tr1::unordered_multimap;
using lib::TypedAllocationManager;
//using util::getValue_or_default;
//using util::contains;
//using std::string;
//using std::map;
@ -315,13 +314,6 @@ namespace session {
ENSURE (isValid());
}
PlacementIndex::PlacementIndex()
: pTab_(new Table)
{
pTab_->setupRoot(rootDef); //////////////////////////////////////////TODO what to put in here (it's a test dummy)
ENSURE (isValid());
}
PlacementIndex::~PlacementIndex() { }

View file

@ -144,7 +144,6 @@ namespace session {
PlacementIndex(PlacementMO const&);
PlacementIndex() ;
~PlacementIndex() ;
void clear();

View file

@ -22,6 +22,7 @@
#include "proc/mobject/session/session-impl.hpp"
#include "proc/mobject/session/mobjectfactory.hpp"
#include "proc/mobject/placement.hpp"
#include "proc/mobject/mobject.hpp"
#include "lib/error.hpp"

View file

@ -30,6 +30,11 @@
#include "proc/mobject/session/session-impl.hpp"
#include "proc/mobject/session/sess-manager-impl.hpp"
#include "proc/mobject/session/mobjectfactory.hpp"
#include "lib/symbol.hpp"
using lib::Symbol;
namespace mobject {
namespace session {
@ -87,7 +92,9 @@ namespace session {
PPIdx
SessionServiceMockIndex:: install ()
{
PPIdx mockIndex (new PlacementIndex(), &remove_testIndex); // manage instance lifecycle
Symbol typeID ("dummyRoot");
PMO dummyRoot (MObject::create (typeID));
PPIdx mockIndex (new PlacementIndex(dummyRoot), &remove_testIndex); // manage instance lifecycle
ENSURE (mockIndex);
ENSURE (mockIndex->isValid());
ENSURE (1 == mockIndex.use_count());

View file

@ -31,6 +31,7 @@
#include "proc/mobject/placement.hpp"
#include "lib/util.hpp"
#include "proc/mobject/session/testclip.hpp"
#include "proc/mobject/session/testroot.hpp"
//#include <boost/format.hpp>
//#include <iostream>
@ -67,7 +68,7 @@ namespace test {
virtual void
run (Arg)
{
PlacementIndex index;
PlacementIndex index (make_dummyRoot());
ASSERT (index.isValid());
checkSimpleInsertRemove (index);

View file

@ -0,0 +1,51 @@
/*
TESTROOT.hpp - test dummy model root for checking EDL/Session functionality
Copyright (C) Lumiera.org
2009, 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.
*/
#ifndef MOBJECT_SESSION_TESTROOT_H
#define MOBJECT_SESSION_TESTROOT_H
#include "proc/mobject/session/label.hpp"
#include "proc/mobject/session/mobjectfactory.hpp"
#include "lib/symbol.hpp"
using lib::Symbol;
namespace mobject {
namespace session {
namespace test {
inline Placement<Label>
make_dummyRoot()
{
Symbol labelType ("dummyRoot");
return MObject::create (labelType);
}
}}} // namespace mobject::session::test
#endif