8 #ifndef DRIPLINE_VERSIONSTORE_HH_ 9 #define DRIPLINE_VERSIONSTORE_HH_ 11 #include "singleton.hh" 15 #include "member_variables.hh" 16 #include "version_semantic.hh" 45 template<
typename x_version >
47 void add_version(
const std::string& a_name, scarab::version_semantic_ptr_t a_version_ptr );
48 void remove_version(
const std::string& a_name );
50 typedef std::map< std::string, scarab::version_semantic_ptr_t >
version_map_t;
51 mv_referrable_const( version_map_t, versions );
65 template<
typename x_version >
70 version_store::get_instance()->add_version< x_version >( a_name );
85 template<
typename x_version >
88 return std::make_shared< version_store_adder<x_version> >( a_name );
110 #define ADD_VERSION( version_name, version_type ) \ 111 static ::dripline::version_store_adder< version_type > s_version_adder_##version_name( TOSTRING(version_name) ); 114 template<
typename x_version >
117 f_versions.insert( std::make_pair( a_name, scarab::version_semantic_ptr_t(
new x_version() ) ) );
123 f_versions.insert( std::make_pair( a_name, a_version_ptr ) );
129 f_versions.erase( a_name );
std::map< std::string, scarab::version_semantic_ptr_t > version_map_t
Singleton class to store all version information relevant in any particular application context...
void remove_version(const std::string &a_name)
Version adder struct to enable adding version classes at static initialization. See ADD_VERSION...
version_store_adder(const std::string &a_name)
void add_version(const std::string &a_name)
void add_version(const std::string &a_name, scarab::version_semantic_ptr_t a_version_ptr)