sc::Registry< Key, Value, CreationPolicy, KeyEqual, ValueEqual > Class Template Reference

Registry contains is an extension of std::map with configurable Creation policy. More...

#include <chemistry/qc/mbptr12/registry.h>

Inheritance diagram for sc::Registry< Key, Value, CreationPolicy, KeyEqual, ValueEqual >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

bool key_exists (const Key &key) const
 key exists?
bool value_exists (const Value &value) const
 value exists?
const Value & value (const Key &key) const
 returns object that corresponds to this key. If key is not known, throws
const Key & key (const Value &obj) const
 returns key that corresponds to this object. If obj is not known, throws
void add (const Key &key, const Value &obj)
 registers this object
void add (const std::pair< Key, Value > &keyval_pair)
 useful version

Static Public Member Functions

static Ref< Registryinstance ()
static void save_instance (const Ref< Registry > &, StateOut &)
static Ref< Registryrestore_instance (StateIn &)

Friends

class CreationPolicy< Registry< Key, Value, CreationPolicy, KeyEqual, ValueEqual > >

Classes

class  not_found
struct  SameType
 used to compare types
struct  SameType< T, T >


Detailed Description

template<typename Key, typename Value, template< typename > class CreationPolicy, typename KeyEqual = std::equal_to<Key>, typename ValueEqual = std::equal_to<Value>>
class sc::Registry< Key, Value, CreationPolicy, KeyEqual, ValueEqual >

Registry contains is an extension of std::map with configurable Creation policy.

Registry is not a SavableState, but it behaves like one (see save_instance and restore_instance methods). Therefore both Key and Value are assumed to be usable with StateIn and StateOut.

KeyEqual and ValueEqual are Functor types that define the equivalence of two Key (or Value) objects. By default std::equal_to is used. For pointer types std::equal_to may not be appropriate since it will not distinguish 2 equivalent but distinct objects.

See also:
sc::detail::SingletonCreationPolicy

sc::detail::NonsingletonCreationPolicy


The documentation for this class was generated from the following files:

Generated at Sun Feb 22 10:12:46 2009 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.5.6.
These pages are hosted on SourceForge.net