Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
derived-path-map.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/types.hh
"
5
#include "
nix/store/derived-path.hh
"
6
7
namespace
nix {
8
30
template
<
typename
V>
31
struct
DerivedPathMap
32
{
36
struct
ChildNode
37
{
43
V
value
;
44
48
using
Map
= std::map<OutputName, ChildNode>;
49
53
Map
childMap
;
54
55
bool
operator==(
const
ChildNode
&)
const
noexcept
;
56
57
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
58
// decltype(std::declval<V>() <=> std::declval<V>())
59
// operator <=> (const ChildNode &) const noexcept;
60
};
61
65
using
Map
= std::map<StorePath, ChildNode>;
66
70
Map
map
;
71
72
bool
operator==(
const
DerivedPathMap
&)
const
=
default
;
73
74
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
75
// auto operator <=> (const DerivedPathMap &) const noexcept;
76
84
ChildNode
&
ensureSlot
(
const
SingleDerivedPath
& k);
85
95
ChildNode
*
findSlot
(
const
SingleDerivedPath
& k);
96
108
void
removeSlot
(
const
SingleDerivedPath
& k,
fun
<
bool
(
ChildNode
&)> callback);
109
};
110
111
template
<>
112
bool
DerivedPathMap<StringSet>::ChildNode::operator==(
const
DerivedPathMap<StringSet>::ChildNode
&)
const
noexcept
;
113
114
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
115
#if 0
116
template
<>
117
std::strong_ordering
DerivedPathMap<StringSet>::ChildNode::operator <=>
(
118
const
DerivedPathMap<StringSet>::ChildNode
&)
const
noexcept
;
119
120
template
<>
121
inline
auto
DerivedPathMap<StringSet>::operator <=>
(
const
DerivedPathMap<StringSet>
&)
const
noexcept
=
default
;
122
#endif
123
124
extern
template
struct
DerivedPathMap<StringSet>::ChildNode
;
125
extern
template
struct
DerivedPathMap<StringSet>
;
126
127
}
// namespace nix
nix::fun
Definition
fun.hh:19
derived-path.hh
nix::DerivedPathMap::ChildNode
Definition
derived-path-map.hh:37
nix::DerivedPathMap::ChildNode::value
V value
Definition
derived-path-map.hh:43
nix::DerivedPathMap::ChildNode::Map
std::map< OutputName, ChildNode > Map
Definition
derived-path-map.hh:48
nix::DerivedPathMap::ChildNode::childMap
Map childMap
Definition
derived-path-map.hh:53
nix::DerivedPathMap
Definition
derived-path-map.hh:32
nix::DerivedPathMap::Map
std::map< StorePath, ChildNode > Map
Definition
derived-path-map.hh:65
nix::DerivedPathMap::removeSlot
void removeSlot(const SingleDerivedPath &k, fun< bool(ChildNode &)> callback)
Definition
derived-path-map.cc:52
nix::DerivedPathMap::ensureSlot
ChildNode & ensureSlot(const SingleDerivedPath &k)
Definition
derived-path-map.cc:8
nix::DerivedPathMap::map
Map map
Definition
derived-path-map.hh:70
nix::DerivedPathMap::findSlot
ChildNode * findSlot(const SingleDerivedPath &k)
Definition
derived-path-map.cc:28
nix::SingleDerivedPath
Definition
derived-path.hh:105
types.hh
libstore
include
nix
store
derived-path-map.hh
Generated by
1.18.0