placed DefsRegistry into an impl namespace

This commit is contained in:
Fischlurch 2008-09-10 04:42:09 +02:00
parent d651ce4762
commit a4f4496481
3 changed files with 40 additions and 20 deletions

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;

View file

@ -40,8 +40,7 @@ namespace mobject {
using lumiera::P;
using boost::scoped_ptr;
class DefsRegistry;
class SessManagerImpl;
namespace impl { class DefsRegistry; }
/**
@ -56,7 +55,7 @@ namespace mobject {
*/
class DefsManager : private boost::noncopyable
{
scoped_ptr<DefsRegistry> defsRegistry;
scoped_ptr<impl::DefsRegistry> defsRegistry;
protected:

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