push creation of the root MObject to users of PlacementIndex
This commit is contained in:
parent
d7aab2990f
commit
9f09a8aa49
6 changed files with 62 additions and 11 deletions
|
|
@ -68,7 +68,6 @@ namespace session {
|
||||||
using std::tr1::unordered_map;
|
using std::tr1::unordered_map;
|
||||||
using std::tr1::unordered_multimap;
|
using std::tr1::unordered_multimap;
|
||||||
using lib::TypedAllocationManager;
|
using lib::TypedAllocationManager;
|
||||||
//using util::getValue_or_default;
|
|
||||||
//using util::contains;
|
//using util::contains;
|
||||||
//using std::string;
|
//using std::string;
|
||||||
//using std::map;
|
//using std::map;
|
||||||
|
|
@ -315,13 +314,6 @@ namespace session {
|
||||||
ENSURE (isValid());
|
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() { }
|
PlacementIndex::~PlacementIndex() { }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,6 @@ namespace session {
|
||||||
|
|
||||||
|
|
||||||
PlacementIndex(PlacementMO const&);
|
PlacementIndex(PlacementMO const&);
|
||||||
PlacementIndex() ;
|
|
||||||
~PlacementIndex() ;
|
~PlacementIndex() ;
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "proc/mobject/session/session-impl.hpp"
|
#include "proc/mobject/session/session-impl.hpp"
|
||||||
|
#include "proc/mobject/session/mobjectfactory.hpp"
|
||||||
#include "proc/mobject/placement.hpp"
|
#include "proc/mobject/placement.hpp"
|
||||||
#include "proc/mobject/mobject.hpp"
|
#include "proc/mobject/mobject.hpp"
|
||||||
#include "lib/error.hpp"
|
#include "lib/error.hpp"
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,11 @@
|
||||||
#include "proc/mobject/session/session-impl.hpp"
|
#include "proc/mobject/session/session-impl.hpp"
|
||||||
#include "proc/mobject/session/sess-manager-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 mobject {
|
||||||
namespace session {
|
namespace session {
|
||||||
|
|
||||||
|
|
@ -87,7 +92,9 @@ namespace session {
|
||||||
PPIdx
|
PPIdx
|
||||||
SessionServiceMockIndex:: install ()
|
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);
|
||||||
ENSURE (mockIndex->isValid());
|
ENSURE (mockIndex->isValid());
|
||||||
ENSURE (1 == mockIndex.use_count());
|
ENSURE (1 == mockIndex.use_count());
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "proc/mobject/placement.hpp"
|
#include "proc/mobject/placement.hpp"
|
||||||
#include "lib/util.hpp"
|
#include "lib/util.hpp"
|
||||||
#include "proc/mobject/session/testclip.hpp"
|
#include "proc/mobject/session/testclip.hpp"
|
||||||
|
#include "proc/mobject/session/testroot.hpp"
|
||||||
|
|
||||||
//#include <boost/format.hpp>
|
//#include <boost/format.hpp>
|
||||||
//#include <iostream>
|
//#include <iostream>
|
||||||
|
|
@ -67,7 +68,7 @@ namespace test {
|
||||||
virtual void
|
virtual void
|
||||||
run (Arg)
|
run (Arg)
|
||||||
{
|
{
|
||||||
PlacementIndex index;
|
PlacementIndex index (make_dummyRoot());
|
||||||
ASSERT (index.isValid());
|
ASSERT (index.isValid());
|
||||||
|
|
||||||
checkSimpleInsertRemove (index);
|
checkSimpleInsertRemove (index);
|
||||||
|
|
|
||||||
51
tests/components/proc/mobject/session/testroot.hpp
Normal file
51
tests/components/proc/mobject/session/testroot.hpp
Normal 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
|
||||||
Loading…
Reference in a new issue