merge in Config-System (first version)

Merge commit 'ichthyo/proc'
This commit is contained in:
Fischlurch 2008-09-13 01:27:18 +02:00
commit 4d72bc23b0
7 changed files with 58 additions and 27 deletions

View file

@ -35,7 +35,7 @@ This code is heavily inspired by
#define LUMIERA_SINGLETONFACTORY_H
#include "common/singletonpolicies.hpp" ///< several Policies usable together with SingletonFactory
#include "common/singletonpolicies.hpp" // several Policies usable together with SingletonFactory
#include "common/util.hpp"
#include "proc/nobugcfg.hpp"

View file

@ -35,10 +35,9 @@ using lumiera::query::QueryHandler;
using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY;
namespace mobject
{
namespace session
{
namespace mobject {
namespace session {
using lumiera::P;
@ -51,6 +50,13 @@ namespace mobject
}
/** @internal causes boost::checked_delete from \c scoped_ptr<DefsRegistry>
* to be placed here, where the declaration of DefsRegistry is available.*/
DefsManager::~DefsManager() {}
template<class TAR>
P<TAR>
DefsManager::search (const Query<TAR>& capabilities)

View file

@ -33,14 +33,14 @@
namespace mobject
{
namespace session
{
namespace mobject {
namespace session {
using lumiera::P;
using boost::scoped_ptr;
class DefsRegistry;
namespace impl { class DefsRegistry; }
/**
@ -55,7 +55,7 @@ namespace mobject
*/
class DefsManager : private boost::noncopyable
{
scoped_ptr<DefsRegistry> defsRegistry;
scoped_ptr<impl::DefsRegistry> defsRegistry;
protected:
@ -63,6 +63,8 @@ namespace mobject
friend class SessManagerImpl;
public:
~DefsManager ();
/** common access point: retrieve the default object fulfilling
* some given conditions. May silently trigger object creation.
* @throw error::Config in case no solution is possible, which

View file

@ -21,6 +21,21 @@
*/
/** @file defsregistry.hpp
** A piece of implementation code factored out into a separate header (include).
** Only used in defsmanager.cpp and for the unit tests. We can't place it into
** a separate compilation unit, because defsmanager.cpp defines some explicit
** template instantiaton, which cause the different Slots of the DefsrRegistry#table_
** to be filled with data and defaults for the specific Types.
**
** @see mobject::session::DefsManager
** @see defsregistryimpltest.cpp
**
*/
#ifndef MOBJECT_SESSION_DEFSREGISTRY_H
#define MOBJECT_SESSION_DEFSREGISTRY_H
@ -52,9 +67,14 @@ namespace mobject
using boost::lambda::_1;
using boost::lambda::var;
namespace // Implementation details //////////////////TODO better a named implementation namespace (avoids warnings on gcc 4.3)
//////////////////////////////////////////////////////////FIXME this is a *real* problem, because this namespace create storage, which it shouldn't
{
namespace impl {
namespace {
uint maxSlots (0); ///< number of different registered Types
format dumpRecord ("%2i| %64s --> %s\n");
}
struct TableEntry
{
virtual ~TableEntry() {};
@ -64,9 +84,6 @@ namespace mobject
* for every participating kind of objects */
typedef std::vector< P<TableEntry> > Table;
uint maxSlots (0); ///< number of different registered Types
format dumpRecord ("%2i| %64s --> %s\n");
/**
* holding a single "default object" entry
@ -83,13 +100,13 @@ namespace mobject
query (q),
objRef (obj)
{ }
struct Search ///< Functor searching for a specific object
{
Search (const P<TAR>& obj)
: obj_(obj) { }
const P<TAR>& obj_;
bool
@ -160,9 +177,9 @@ namespace mobject
template<class TAR>
size_t Slot<TAR>::index (0);
} // (End) impl namespace
/**
* @internal Helper for organizing preconfigured default objects.
* Maintaines a collection of objects known or encountered as "default"
@ -315,9 +332,14 @@ namespace mobject
return res;
}
};
} // (End) impl namespace
using impl::DefsRegistry;
} // namespace mobject::session
} // namespace mobject

View file

@ -32,9 +32,8 @@
#include "proc/mobject/session.hpp"
#include "proc/mobject/session/sessionimpl.hpp"
#include "proc/mobject/session/defsmanager.hpp"
#include "proc/mobject/session/defsregistry.hpp"
#include "proc/mobject/session/sessionimpl.hpp"
#include "common/singleton.hpp"

View file

@ -94,6 +94,8 @@ namespace mobject
friend class lumiera::singleton::StaticCreate<SessManagerImpl>;
public:
virtual ~SessManagerImpl() {}
virtual void clear () ;
virtual void reset () ;
virtual void load () ;

View file

@ -39,7 +39,7 @@
#include "proc/mobject/session.hpp"
#include "proc/mobject/session/sessionimpl.hpp"
#include "proc/mobject/session/defsmanager.hpp"
#include "proc/mobject/session/defsregistry.hpp"
//#include "proc/mobject/session/defsregistry.hpp"
#include "common/error.hpp"
using boost::scoped_ptr;