18 #ifndef TYPE_REPOSITORY_HH_
19 #define TYPE_REPOSITORY_HH_
49 "T must be a descendant of Input::Type::TypeBase"
65 std::shared_ptr<T>
add_type(
const T & type);
112 auto search = find_hash(hash);
116 auto type_ptr = std::make_shared<T>( type );
125 auto search = type_repository_map_.find(hash);
126 if (search != type_repository_map_.end()) {
127 return search->second;
129 return std::shared_ptr<T>();
135 for (
typename TypeRepositoryMap::iterator
it = type_repository_map_.begin();
it != type_repository_map_.end(); ++
it) {
136 it->second->finish(finish_type);
143 for (
typename TypeRepositoryMap::iterator
it = type_repository_map_.begin();
it != type_repository_map_.end(); ++
it) {
145 ASSERT(
it->second.use_count() == 1)(
it->second.use_count()).error();
147 deleted_hashes.push_back(
it->first);
151 for (
auto deleted_hash : deleted_hashes) {
152 type_repository_map_.erase(deleted_hash);