Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::ValueStorage< ptrSize, Enable > Class Template Reference

#include <value.hh>

Inheritance diagram for nix::ValueStorage< ptrSize, Enable >:
nix::detail::ValueBase

Protected Types

using Payload

Protected Member Functions

void getStorage (NixInt &val) const noexcept
void getStorage (bool &val) const noexcept
void getStorage (ValueBase::StringWithContext &val) const noexcept
void getStorage (ValueBase::Path &val) const noexcept
void getStorage (ValueBase::Null &val) const noexcept
void getStorage (const Bindings *&val) const noexcept
void getStorage (ValueBase::List &val) const noexcept
void getStorage (ValueBase::Symbol &val) const noexcept
void getStorage (ValueBase::SmallList &val) const noexcept
void getStorage (ValueBase::ClosureThunk &val) const noexcept
void getStorage (ValueBase::FunctionApplicationThunk &val) const noexcept
void getStorage (ValueBase::Lambda &val) const noexcept
void getStorage (PrimOp *&val) const noexcept
void getStorage (ValueBase::PrimOpApplicationThunk &val) const noexcept
void getStorage (ExternalValueBase *&val) const noexcept
void getStorage (ValueBase::Failed *&val) const noexcept
void getStorage (NixFloat &val) const noexcept
void setStorage (NixInt val) noexcept
void setStorage (bool val) noexcept
void setStorage (ValueBase::StringWithContext val) noexcept
void setStorage (ValueBase::Path val) noexcept
void setStorage (ValueBase::Null val) noexcept
void setStorage (const Bindings *val) noexcept
void setStorage (ValueBase::List val) noexcept
void setStorage (ValueBase::Symbol val) noexcept
void setStorage (ValueBase::SmallList val) noexcept
void setStorage (ValueBase::ClosureThunk val) noexcept
void setStorage (ValueBase::FunctionApplicationThunk val) noexcept
void setStorage (ValueBase::Lambda val) noexcept
void setStorage (PrimOp *val) noexcept
void setStorage (ValueBase::PrimOpApplicationThunk val) noexcept
void setStorage (ExternalValueBase *val) noexcept
void setStorage (ValueBase::Failed *val) noexcept
void setStorage (NixFloat val) noexcept
InternalType getInternalType () const noexcept
bool isAtomic ()

Static Protected Member Functions

static bool isAtomic ()

Additional Inherited Members

Public Types inherited from nix::detail::ValueBase
using SmallList = std::array<Value *, 2>

Detailed Description

template<std::size_t ptrSize, typename Enable = void>
class nix::ValueStorage< ptrSize, Enable >

Discriminated union of types stored in the value. The union discriminator is InternalType enumeration.

This class can be specialized with a non-type template parameter of pointer size for more optimized data layouts on when pointer alignment bits can be used for storing the discriminator.

All specializations of this type need to implement getStorage, setStorage and getInternalType methods.

Member Typedef Documentation

◆ Payload

template<std::size_t ptrSize, typename Enable = void>
using nix::ValueStorage< ptrSize, Enable >::Payload
protected
Initial value:
union
{
#define NIX_VALUE_STORAGE_DEFINE_FIELD(T, FIELD_NAME, DISCRIMINATOR)
NixInt integer; bool boolean; ValueBase::StringWithContext string; ValueBase::Path path; ValueBase::Null null_; const Bindings * attrs; ValueBase::List bigList; ValueBase::Symbol symbol; ValueBase::SmallList smallList; ValueBase::ClosureThunk thunk; ValueBase::FunctionApplicationThunk app; ValueBase::Lambda lambda; PrimOp * primOp; ValueBase::PrimOpApplicationThunk primOpApp; ExternalValueBase * external; ValueBase::Failed * failed; NixFloat fpoint;
}
Definition attr-set.hh:67
Definition value.hh:116
Definition eval.hh:111

Member Function Documentation

◆ getInternalType()

template<std::size_t ptrSize, typename Enable = void>
InternalType nix::ValueStorage< ptrSize, Enable >::getInternalType ( ) const
inlineprotectednoexcept

Get internal type currently occupying the storage.


The documentation for this class was generated from the following file: