Skip to content

Commit bdb07d5

Browse files
committed
remomve hash in hpp
1 parent 7a7cb9c commit bdb07d5

File tree

11 files changed

+138
-32
lines changed

11 files changed

+138
-32
lines changed

include/geode/mesh/core/coordinate_reference_system.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
#pragma once
2525

26-
#include <absl/hash/hash.h>
27-
2826
#include <geode/basic/bitsery_archive.hpp>
2927
#include <geode/basic/named_type.hpp>
3028

@@ -86,11 +84,8 @@ namespace geode
8684
namespace std
8785
{
8886
template <>
89-
struct hash< geode::CRSType >
87+
struct opengeode_mesh_api hash< geode::CRSType >
9088
{
91-
std::size_t operator()( const geode::CRSType& type ) const
92-
{
93-
return absl::Hash< std::string >{}( type.get() );
94-
}
89+
std::size_t operator()( const geode::CRSType& type ) const;
9590
};
9691
} // namespace std

include/geode/mesh/core/detail/vertex_cycle.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
#include <absl/algorithm/container.h>
3333
#include <absl/container/inlined_vector.h>
34-
#include <absl/hash/hash.h>
3534

3635
#include <bitsery/brief_syntax.h>
3736
#include <bitsery/brief_syntax/array.h>

include/geode/model/mixin/core/component_mesh_element.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <geode/mesh/core/mesh_element.hpp>
2727

28+
#include <geode/model/common.hpp>
2829
#include <geode/model/mixin/core/component_type.hpp>
2930

3031
namespace geode
@@ -79,12 +80,8 @@ namespace geode
7980
namespace std
8081
{
8182
template <>
82-
struct hash< geode::ComponentMeshElement >
83+
struct opengeode_model_api hash< geode::ComponentMeshElement >
8384
{
84-
size_t operator()( const geode::ComponentMeshElement& cme ) const
85-
{
86-
return absl::Hash< geode::uuid >()( cme.component_id.id() )
87-
^ absl::Hash< geode::index_t >()( cme.element_id );
88-
}
85+
size_t operator()( const geode::ComponentMeshElement& cme ) const;
8986
};
9087
} // namespace std

include/geode/model/mixin/core/component_type.hpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525

2626
#include <bitsery/brief_syntax/string.h>
2727

28-
#include <absl/hash/hash.h>
29-
3028
#include <geode/basic/growable.hpp>
3129
#include <geode/basic/named_type.hpp>
3230
#include <geode/basic/uuid.hpp>
3331

32+
#include <geode/model/common.hpp>
33+
3434
namespace geode
3535
{
3636
struct ComponentTag
@@ -110,20 +110,14 @@ namespace geode
110110
namespace std
111111
{
112112
template <>
113-
struct hash< geode::ComponentType >
113+
struct opengeode_model_api hash< geode::ComponentType >
114114
{
115-
size_t operator()( const geode::ComponentType& type ) const
116-
{
117-
return absl::Hash< string >()( type.get() );
118-
}
115+
size_t operator()( const geode::ComponentType& type ) const;
119116
};
120117

121118
template <>
122-
struct hash< geode::ComponentID >
119+
struct opengeode_model_api hash< geode::ComponentID >
123120
{
124-
size_t operator()( const geode::ComponentID& id ) const
125-
{
126-
return absl::Hash< geode::uuid >()( id.id() );
127-
}
121+
size_t operator()( const geode::ComponentID& id ) const;
128122
};
129123
} // namespace std

include/geode/model/mixin/core/vertex_identifier.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,8 @@ namespace geode
205205
namespace std
206206
{
207207
template <>
208-
struct hash< geode::ComponentMeshVertex >
208+
struct opengeode_model_api hash< geode::ComponentMeshVertex >
209209
{
210-
size_t operator()( const geode::ComponentMeshVertex& cmv ) const
211-
{
212-
return absl::Hash< geode::uuid >()( cmv.component_id.id() )
213-
^ absl::Hash< geode::index_t >()( cmv.vertex );
214-
}
210+
size_t operator()( const geode::ComponentMeshVertex& cmv ) const;
215211
};
216212
} // namespace std

src/geode/mesh/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ add_geode_library(
5757
"common.cpp"
5858
"core/attribute_coordinate_reference_system.cpp"
5959
"core/bitsery_archive.cpp"
60+
"core/coordinate_reference_system.cpp"
6061
"core/coordinate_reference_system_manager.cpp"
6162
"core/coordinate_reference_system_managers.cpp"
6263
"core/edged_curve.cpp"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2019 - 2025 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#include <geode/mesh/core/coordinate_reference_system.hpp>
25+
26+
#include <absl/hash/hash.h>
27+
28+
namespace std
29+
{
30+
std::size_t hash< geode::CRSType >::operator()(
31+
const geode::CRSType& type ) const
32+
{
33+
return absl::Hash< std::string >{}( type.get() );
34+
}
35+
} // namespace std

src/geode/model/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ add_geode_library(
6464
"mixin/core/block_collections.cpp"
6565
"mixin/core/block_collection.cpp"
6666
"mixin/core/component.cpp"
67+
"mixin/core/component_mesh_element.cpp"
6768
"mixin/core/component_registry.cpp"
69+
"mixin/core/component_type.cpp"
6870
"mixin/core/corner.cpp"
6971
"mixin/core/corners.cpp"
7072
"mixin/core/corner_collections.cpp"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2019 - 2025 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#include <geode/model/mixin/core/component_mesh_element.hpp>
25+
26+
#include <absl/hash/hash.h>
27+
28+
namespace std
29+
{
30+
size_t hash< geode::ComponentMeshElement >::operator()(
31+
const geode::ComponentMeshElement& cme ) const
32+
{
33+
return absl::Hash< geode::uuid >()( cme.component_id.id() )
34+
^ absl::Hash< geode::index_t >()( cme.element_id );
35+
}
36+
} // namespace std
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2019 - 2025 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#include <geode/model/mixin/core/component_type.hpp>
25+
26+
#include <absl/hash/hash.h>
27+
28+
namespace std
29+
{
30+
size_t hash< geode::ComponentType >::operator()(
31+
const geode::ComponentType& type ) const
32+
{
33+
return absl::Hash< string >()( type.get() );
34+
}
35+
36+
size_t hash< geode::ComponentID >::operator()(
37+
const geode::ComponentID& id ) const
38+
{
39+
return absl::Hash< geode::uuid >()( id.id() );
40+
}
41+
} // namespace std

0 commit comments

Comments
 (0)