Changeset 432
- Timestamp:
- 07/21/15 14:12:57 (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/engine/resource_system.hh
r431 r432 17 17 #include <nv/interface/context.hh> 18 18 #include <nv/lua/lua_state.hh> 19 #include <nv/stl/ unordered_map.hh>19 #include <nv/stl/hash_store.hh> 20 20 #include <nv/stl/vector.hh> 21 21 … … 43 43 44 44 lua::state* m_lua; 45 hash ed_table< shash64, resource_id > m_names;45 hash_store< shash64, resource_id > m_names; 46 46 }; 47 47 … … 99 99 protected: 100 100 vector< resource_manager_base* > m_managers; 101 unordered_map< uint64, resource_id > m_manager_names;101 hash_store< shash64, resource_id > m_manager_names; 102 102 lua::state* m_lua_state; 103 103 }; -
trunk/nv/stl/container/hash_table.hh
r408 r432 422 422 typename SuperClass = empty_type 423 423 > 424 class hash_table : public hash_table_storage< HashEntryPolicy, RehashPolicy, SuperClass >424 class hash_table_base : public hash_table_storage< HashEntryPolicy, RehashPolicy, SuperClass > 425 425 { 426 426 typedef hash_table_storage< HashEntryPolicy, RehashPolicy, SuperClass > base_type; … … 447 447 448 448 public: // constructors 449 hash_table () {}450 explicit hash_table ( size_type size ) : base_type( size ) {}451 hash_table ( const hash_table& other ) = delete;452 hash_table ( hash_table&& other ) = default;449 hash_table_base() {} 450 explicit hash_table_base( size_type size ) : base_type( size ) {} 451 hash_table_base( const hash_table_base& other ) = delete; 452 hash_table_base( hash_table_base&& other ) = default; 453 453 template< typename InputIterator > 454 hash_table ( InputIterator first, InputIterator last ) : base_type()454 hash_table_base( InputIterator first, InputIterator last ) : base_type() 455 455 { 456 456 insert( first, last ); … … 459 459 public: // assignements 460 460 461 hash_table & operator=( const hash_table& other ) = delete;462 hash_table & operator=( hash_table&& other ) = default;461 hash_table_base& operator=( const hash_table_base& other ) = delete; 462 hash_table_base& operator=( hash_table_base&& other ) = default; 463 463 464 464 public: // iterators -
trunk/nv/stl/container/hash_table_policy.hh
r408 r432 145 145 { 146 146 template< typename H > 147 static size_t get_index( H h, size_t n ) { return h % n; } 147 static enable_if_t< is_integral< H >::value, size_t > 148 get_index( H h, size_t n ) { return h % n; } 149 150 template< typename H > 151 static enable_if_t< is_class< H >::value, size_t > 152 get_index( H h, size_t n ) { return h.value() % n; } 153 148 154 149 155 static uint32 get_bucket_count( uint32 requested_count ) -
trunk/nv/stl/hash_map.hh
r408 r432 88 88 template < typename > class InsertConvertPolicy = hash_table_no_extra_types_policy 89 89 > 90 class hash_map : public hash_table < EntryPolicy, QueryConvertPolicy >90 class hash_map : public hash_table_base< EntryPolicy, QueryConvertPolicy > 91 91 { 92 92 public: 93 typedef hash_table < EntryPolicy, QueryConvertPolicy > base_type;93 typedef hash_table_base< EntryPolicy, QueryConvertPolicy > base_type; 94 94 typedef hash_map< Key, Mapped, Hash, EntryPolicy, QueryConvertPolicy > this_type; 95 95 typedef typename base_type::value_type value_type; -
trunk/nv/stl/string_table.hh
r431 r432 16 16 #include <nv/stl/vector.hh> 17 17 #include <nv/stl/string.hh> 18 #include <nv/stl/ unordered_map.hh>18 #include <nv/stl/hash_store.hh> 19 19 #include <nv/stl/stream.hh> 20 20 … … 30 30 typedef uint32 size_type; 31 31 typedef uint16 length_type; 32 typedef unordered_map< hash_type, size_type > indexer_type;32 typedef hash_store< hash_type, size_type > indexer_type; 33 33 typedef vector< char > storage_type; 34 34 typedef indexer_type::const_iterator const_iterator; -
trunk/nv/stl/unordered_map.hh
r431 r432 230 230 > 231 231 class unordered_map 232 : public hash_table <232 : public hash_table_base< 233 233 HashEntryPolicy, 234 234 hash_table_no_extra_types_policy, … … 238 238 { 239 239 public: 240 typedef hash_table <240 typedef hash_table_base< 241 241 HashEntryPolicy, 242 242 hash_table_no_extra_types_policy, … … 324 324 }; 325 325 326 // TODO: remove and make a proper hashed map327 template <328 typename Key,329 typename T,330 typename Hasher = hash< Key, typename Key::value_type >,331 typename KeyEqual = equal_to< Key >,332 typename HashEntryPolicy = hash_table_stl_map_policy< Key, T, typename Key::value_type, KeyEqual, Hasher >333 >334 class hashed_table335 : public hash_table<336 HashEntryPolicy,337 hash_table_no_extra_types_policy,338 hash_table_prime_rehash_policy,339 HashEntryPolicy340 >341 {342 public:343 typedef hash_table<344 HashEntryPolicy,345 hash_table_no_extra_types_policy,346 hash_table_prime_rehash_policy,347 HashEntryPolicy348 > base_type;349 typedef typename base_type::value_type value_type;350 typedef typename base_type::pointer pointer;351 typedef typename base_type::const_pointer const_pointer;352 typedef typename base_type::reference reference;353 typedef typename base_type::const_reference const_reference;354 typedef typename base_type::iterator iterator;355 typedef typename base_type::const_iterator const_iterator;356 typedef typename base_type::size_type size_type;357 typedef typename base_type::difference_type difference_type;358 typedef typename base_type::key_type key_type;359 typedef typename base_type::mapped_type mapped_type;360 typedef typename base_type::node_type node_type;361 typedef typename base_type::insert_return_type insert_return_type;362 typedef Hasher hasher;363 typedef KeyEqual key_equal;364 365 using base_type::base_type;366 367 mapped_type& operator[]( const key_type& key )368 {369 return ( *base_type::insert_key( key ).first ).second;370 }371 };372 373 374 326 } 375 327 -
trunk/src/formats/assimp_loader.cc
r431 r432 8 8 9 9 #include "nv/interface/data_channel_access.hh" 10 #include "nv/stl/ unordered_map.hh"10 #include "nv/stl/hash_store.hh" 11 11 #include "nv/lib/assimp.hh" 12 12 … … 288 288 const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene ); 289 289 mesh_nodes_data* result = new mesh_nodes_data( make_name( "bones" ) ); 290 hash ed_table< shash64, uint16 > names;290 hash_store< shash64, uint16 > names; 291 291 for ( unsigned int m = 0; m < m_mesh_count; ++m ) 292 292 {
Note: See TracChangeset
for help on using the changeset viewer.