Lumiera  0.pre.03
»edit your freedom«
placement-index.cpp File Reference

Go to the source code of this file.

Description

Implementation of core session storage structure.

The PlacementIndex associates IDs to instances, within a nested scope structure. Moreover, it provides and manages the actual Placement instances (storage), considered to be part of the session.

Simple hash based implementation. Seems adequate for now (12/09). A main table associates Placement-ID to a Placement instance, which is contained and managed within this index. A second hashtable allows to reverse lookup the scope associations, especially for enumerating the contents of a scope. The latter is done by wrapping up an STL iterator range into a "Lumiera Forward Iterator" (adapter). Generally speaking, PlacementIndex is an implementation level facility and provides the basic/low-level functionality. For example, the PlacementIndexQueryResolver provides depth-first exploration of all the contents of an scope, including nested scopes, building on top of the scope iterators from PlacementIndex.

PlacementIndex can be seen as the core datastructure of the session. Objects are attached to the session by adding (copying) a Placement instance, which is owned and managed by the PlacementIndex. Adding this Placement instance creates a new Placement-ID, which from then on acts as a shorthand for "the object instance" within the session. The actual storage is provided by an embedded TypedAllocationManager instance, which is planned (as of 12/09) to be backed later by a memory pool based custom allocator.

See also
PlacementRef
PlacementIndex_test

Definition in file placement-index.cpp.

#include "steam/mobject/session/placement-index.hpp"
#include "steam/mobject/session/session-impl.hpp"
#include "steam/mobject/session/scope.hpp"
#include "lib/typed-allocation-manager.hpp"
#include "lib/iter-adapter-stl.hpp"
#include "lib/util-foreach.hpp"
#include "lib/iter-source.hpp"
#include "include/logging.h"
#include <boost/functional/hash.hpp>
#include <unordered_map>
#include <functional>
#include <memory>
#include <string>

Classes

struct  PlacementIndex::Table::PlacementEntry
 
struct  SelfCheckFailure
 
class  PlacementIndex::Table
 Storage and implementation backing the PlacementIndex. More...
 
class  PlacementIndex::Validator
 PlacementIndex self-verification code Executes all built-in checks automatically on object creation. More...
 

Typedefs

typedef PlacementIndex::ID ID
 
typedef mobject::PlacementMO PlacementMO
 
typedef PlacementIndex::PRef PRef
 

Macros

#define VERIFY(_CHECK_, CHECK_ID, DESCRIPTION)
 

Functions

 LUMIERA_ERROR_DEFINE (NOT_IN_SESSION, "referring to a Placement not known to the current session")
 
 LUMIERA_ERROR_DEFINE (PLACEMENT_TYPE, "requested Placement (pointee) type not compatible with data or context")
 
 LUMIERA_ERROR_DEFINE (NONEMPTY_SCOPE, "Placement scope (still) contains other elements")
 
 LUMIERA_ERROR_DEFINE (INDEX_CORRUPTED, "PlacementIndex corrupted")
 

Namespaces

 lumiera
 Lumiera public interface.
 
 steam
 Steam-Layer implementation namespace root.
 
 steam::mobject
 Media-Objects, edit operations and high-level session.
 
 steam::mobject::session
 Namespace of Session and user visible high-level objects.
 

Macro Definition Documentation

◆ VERIFY

#define VERIFY (   _CHECK_,
  CHECK_ID,
  DESCRIPTION 
)
Value:
if (!(_CHECK_)) \
throw SelfCheckFailure (CHECK_ID, (DESCRIPTION));

Definition at line 599 of file placement-index.cpp.


Class Documentation

◆ steam::mobject::session::PlacementIndex::Table::PlacementEntry

struct steam::mobject::session::PlacementIndex::Table::PlacementEntry
Class Members
PPlacement element
PPlacement scope
+ Collaboration diagram for PlacementIndex::Table::PlacementEntry: