diff --git a/libraries/db/include/graphene/db/object_database.hpp b/libraries/db/include/graphene/db/object_database.hpp index e070125e..ff4cc52d 100644 --- a/libraries/db/include/graphene/db/object_database.hpp +++ b/libraries/db/include/graphene/db/object_database.hpp @@ -87,6 +87,19 @@ namespace graphene { namespace db { ///@} + template + static const T& cast( const object& obj ) + { + assert( nullptr != dynamic_cast(&obj) ); + return static_cast(obj); + } + template + static T& cast( object& obj ) + { + assert( nullptr != dynamic_cast(&obj) ); + return static_cast(obj); + } + template const T& get( object_id_type id )const {