4 template <
typename Signature>
7 template <
typename TReturn,
typename Signature,
typename... TArgs>
10 decltype(
auto) result = GLOBAL_FUNCTION<Signature>(args...);
14 template <
typename Signature>
17 GLOBAL_FUNCTION<Signature> = std::move(function);
20 template <
typename LinkAddressType>
23 template <
typename LinkAddressType>
26 template <
typename LinkAddressType>
94 uint8_t
ByteLinks_Update(
void* this_,
const uint8_t* restriction, uintptr_t len_r,
const uint8_t* substitution,
117 template <
typename Stop>
120 static constexpr bool value =
false;
123 template <
typename TSelf,
typename TLinkOptions,
typename... TBase>
124 class LinksBase :
public Interfaces::Polymorph<TSelf, TBase...>
132 using LinkType =
typename LinksOptionsType::LinkType;
135 static constexpr LinksConstants<LinkAddressType>
Constants = LinksOptionsType::Constants;
139 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
143 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
147 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
151 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
159 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");
165 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
172 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
179 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
186 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
197 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");
203 auto substitutionLength = std::ranges::size(substitution);
204 auto substitutionPtr = std::ranges::data(substitution);
207 Link afterLink{after.
Index, after.Source, after.Target};
208 return handler(beforeLink, afterLink);
211 set_global<Signature>(callback);
212 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
217 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
222 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
227 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
236 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");
243 auto restrictionLength = std::ranges::size(restriction);
244 auto restrictionPtr{std::ranges::data(restriction)};
245 auto substitutionLength = std::ranges::size(substitution);
246 auto substitutionPtr{std::ranges::data(substitution)};
249 Link afterLink{after.
Index, after.Source, after.Target};
250 return handler(beforeLink, afterLink);
253 set_global<Signature>(callback);
254 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
256 return ByteLinks_Update(_ptr, restrictionPtr, restrictionLength, substitutionPtr, substitutionLength,
259 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
261 return UInt16Links_Update(_ptr, restrictionPtr, restrictionLength, substitutionPtr, substitutionLength,
264 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
266 return UInt32Links_Update(_ptr, restrictionPtr, restrictionLength, substitutionPtr, substitutionLength,
269 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
271 return UInt64Links_Update(_ptr, restrictionPtr, restrictionLength, substitutionPtr, substitutionLength,
278 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");
284 auto restrictionLength = std::ranges::size(restriction);
285 auto restrictionPtr = std::ranges::data(restriction);
288 Link afterLink{after.
Index, after.Source, after.Target};
289 return handler(beforeLink, afterLink);
292 set_global<Signature>(callback);
293 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
298 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
303 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
308 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
317 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");
324 auto restrictionLength = std::ranges::size(restriction);
325 auto restrictionPtr = std::ranges::data(restriction);
327 return handler(
Link{link.
Index, link.Source, link.Target});
329 set_global<Signature>(callback);
330 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
335 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
340 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
345 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
354 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");
360 auto restrictionLength = std::ranges::size(restriction);
361 auto restrictionPtr = std::ranges::data(restriction);
362 if constexpr (std::same_as<LinkAddressType, std::uint8_t>)
366 else if constexpr (std::same_as<LinkAddressType, std::uint16_t>)
370 else if constexpr (std::same_as<LinkAddressType, std::uint32_t>)
374 else if constexpr (std::same_as<LinkAddressType, std::uint64_t>)
382 "LinkAddressType must be one of std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t");