Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
common-protocol-impl.hh
Go to the documentation of this file.
1
#pragma once
10
11
#include "
nix/store/common-protocol.hh
"
12
#include "
nix/store/length-prefixed-protocol-helper.hh
"
13
14
namespace
nix {
15
16
/* protocol-agnostic templates */
17
18
#define COMMON_USE_LENGTH_PREFIX_SERIALISER(TEMPLATE, T) \
19
TEMPLATE T CommonProto::Serialise<T>::read(const StoreDirConfig & store, CommonProto::ReadConn conn) \
20
{ \
21
return LengthPrefixedProtoHelper<CommonProto, T>::read(store, conn); \
22
} \
23
TEMPLATE void CommonProto::Serialise<T>::write( \
24
const StoreDirConfig & store, CommonProto::WriteConn conn, const T & t) \
25
{ \
26
LengthPrefixedProtoHelper<CommonProto, T>::write(store, conn, t); \
27
}
28
29
COMMON_USE_LENGTH_PREFIX_SERIALISER(template<typename T>, std::vector<T>)
30
#define COMMA_ ,
31
COMMON_USE_LENGTH_PREFIX_SERIALISER(template<typename T COMMA_ typename Compare>, std::set<T COMMA_ Compare>)
32
COMMON_USE_LENGTH_PREFIX_SERIALISER(template<typename... Ts>, std::tuple<Ts...>)
33
34
COMMON_USE_LENGTH_PREFIX_SERIALISER(
35
template<typename K COMMA_ typename V COMMA_ typename Compare>, std::map<K COMMA_ V COMMA_ Compare>)
36
#undef COMMA_
37
38
/* protocol-specific templates */
39
40
}
// namespace nix
common-protocol.hh
length-prefixed-protocol-helper.hh
libstore
include
nix
store
common-protocol-impl.hh
Generated by
1.18.0