1 // This is brl/bbas/brdb/brdb_value.cxx
2 #include "brdb_value.h"
3 //:
4 // \file
5 // \author updated by Yong Zhao
6 // \date Apr 4th, 2007
7 //
8 // make it work with the database initially based on Matt's sketch
9 
10 //: Return a reference to the global registry of database value classes
11 std::map<std::string, const brdb_value*> &
mut_registry()12 brdb_value::mut_registry()
13 {
14   static std::map<std::string, const brdb_value*> reg;
15   return reg;
16 }
17 
18 //: The Constructor for this struct registers an exemplar database value object with the base class
registrar(const brdb_value * exemplar)19 brdb_value::registrar::registrar(const brdb_value* exemplar)
20 {
21   std::string type = exemplar->is_a();
22   //std::cout << "registering " << type << std::endl;
23   // register with the base class
24   brdb_value::mut_registry()[type] = exemplar;
25 }
26