Blender
V3.3
source
blender
editors
asset
intern
asset_library_reference.cc
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
7
#include "
BLI_hash.hh
"
8
9
#include "
asset_library_reference.hh
"
10
11
namespace
blender::ed::asset
{
12
13
AssetLibraryReferenceWrapper::AssetLibraryReferenceWrapper
(
const
AssetLibraryReference
&reference)
14
:
AssetLibraryReference
(reference)
15
{
16
}
17
18
bool
operator==
(
const
AssetLibraryReferenceWrapper
&
a
,
const
AssetLibraryReferenceWrapper
&
b
)
19
{
20
return
(
a
.type ==
b
.type) &&
21
((
a
.type ==
ASSET_LIBRARY_CUSTOM
) ? (
a
.custom_library_index ==
b
.custom_library_index) :
22
true
);
23
}
24
25
uint64_t
AssetLibraryReferenceWrapper::hash
()
const
26
{
27
uint64_t
hash1 =
DefaultHash
<decltype(
type
)>{}(
type
);
28
if
(
type
!=
ASSET_LIBRARY_CUSTOM
) {
29
return
hash1;
30
}
31
32
uint64_t
hash2 =
DefaultHash
<decltype(
custom_library_index
)>{}(
custom_library_index
);
33
return
hash1 ^ (hash2 * 33);
/* Copied from DefaultHash for std::pair. */
34
}
35
36
}
// namespace blender::ed::asset
BLI_hash.hh
ASSET_LIBRARY_CUSTOM
@ ASSET_LIBRARY_CUSTOM
Definition:
DNA_asset_types.h:95
asset_library_reference.hh
blender::ed::asset::AssetLibraryReferenceWrapper
Definition:
asset_library_reference.hh:20
blender::ed::asset::AssetLibraryReferenceWrapper::hash
uint64_t hash() const
Definition:
asset_library_reference.cc:25
blender::ed::asset::AssetLibraryReferenceWrapper::AssetLibraryReferenceWrapper
AssetLibraryReferenceWrapper(const AssetLibraryReference &reference)
Definition:
asset_library_reference.cc:13
Freestyle::a
static unsigned a[3]
Definition:
RandGen.cpp:78
blender::ed::asset
Definition:
asset_indexer.cc:35
blender::ed::asset::operator==
bool operator==(const AssetLibraryReferenceWrapper &a, const AssetLibraryReferenceWrapper &b)
Definition:
asset_library_reference.cc:18
usdtokens::b
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
uint64_t
unsigned __int64 uint64_t
Definition:
stdint.h:90
AssetLibraryReference
Definition:
DNA_asset_types.h:105
AssetLibraryReference::type
short type
Definition:
DNA_asset_types.h:106
AssetLibraryReference::custom_library_index
int custom_library_index
Definition:
DNA_asset_types.h:113
blender::DefaultHash
Definition:
BLI_hash.hh:83
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1