SDK support

cvar_proxy

The forwarding interface of the proxy returned by string-key indexing on a value.

C++23 mc/cvar_proxy.h
#include <mc/cvar.h>

This is an included class fragment, not a standalone header. Include cvar.h; the methods below belong to cvar::cvar_proxy<K>.

A proxy preserves a reference to its parent, not its lifetime. Keep the parent and any borrowed key alive. Obtain a cvar copy when an independent value is required.

Forwarded methods use the corresponding cvar operation. Const access does not grant write access to a const parent.

Jump to a declaration · 82

cvar::cvar_proxy

Functions

operator()

template<class... Args> decltype(auto) operator()(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator()(). Invokes a stored native Func0–Func15 callable with the matching argument count. A cfunc expression is data and must instead be evaluated by an interpreter or executor.

execute

template<class... Args> decltype(auto) execute(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::execute(). Sends the supplied function node to the stored object’s CExecutor::execute() implementation. The receiver must resolve to an Object; this is not a general evaluator for a cfunc held in this value.

Star

template<class... Args> decltype(auto) Star(Args&&... args);

Resolves the parent map entry, then forwards to cvar::Star(). Follows references and dispatches the runtime Star operation for an object. Ordinary non-object values are returned as value copies.

begin_

template<class... Args> decltype(auto) begin_(Args&&... args);

Resolves the parent map entry, then forwards to cvar::begin_(). Returns a runtime iterator represented by a cvar, suitable for interpreted traversal.

end_

template<class... Args> decltype(auto) end_(Args&&... args);

Resolves the parent map entry, then forwards to cvar::end_(). Returns the corresponding runtime end iterator.

find

template<class... Args> decltype(auto) find(Args&&... args);

Resolves the parent map entry, then forwards to cvar::find(). Returns a runtime map iterator for a key.

unwrap

template<class T> T& unwrap(const cstr& name) const;

Resolves the parent map entry, then forwards to cvar::unwrap(). Returns the native value after checking its C++ wrapper type. name supplies the expected-type text in an error message.

to

template<class... Args> decltype(auto) to(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::to(). Inserts converted elements into the destination container; existing destination contents are retained.

type

template<class... Args> decltype(auto) type(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::type(). Returns the effective type, following explicit references.

rawType

template<class... Args> decltype(auto) rawType(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::rawType(). Returns the stored tag’s type code without following a reference.

store

template<class... Args> decltype(auto) store(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::store(). Appends the value in Catalyst’s binary representation. Set the InlineBuffers template flag to inline attached buffers.

restore

template<class... Args> decltype(auto) restore(Args&&... args);

Resolves the parent map entry, then forwards to cvar::restore(). Extracts a native T from a Buffer value using CBuffer::get<T>(), then consumes the buffer and leaves this value Null.

has

template<class... Args> decltype(auto) has(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::has(). Checks membership in a vector or set, or key presence in a map. Non-string keys are formatted for map lookup; unsupported ordinary value types return false.

erase

template<class... Args> decltype(auto) erase(Args&&... args);

Resolves the parent map entry, then forwards to cvar::erase(). Key overloads erase map/set entries. Iterator overloads erase sequence elements; use compatible iterators from the same live value.

outerMerge

template<class... Args> decltype(auto) outerMerge(Args&&... args);

Resolves the parent map entry, then forwards to cvar::outerMerge(). The cvar overload recursively merges maps and replaces non-map leaves. Maps containing # are replaced as whole values; a plain target map is retained when the incoming value is not a map. The cmap overload merges immediate keys only.

head

template<class... Args> decltype(auto) head(Args&&... args) const;
template<class... Args> decltype(auto) head(Args&&... args);

Resolves the parent map entry, then forwards to cvar::head(). Returns the # entry of a map, follows a reference, or returns this value for other types.

toStr

template<class... Args> decltype(auto) toStr(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::toStr(). Formats the value as display text; string values return their contents without adding quotes. Objects may provide a Str method, otherwise their address is formatted.

isNull

template<class... Args> decltype(auto) isNull(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Null, following one stored reference. It does not perform a conversion or inspect a map’s head.

isBool

template<class... Args> decltype(auto) isBool(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Bool, following one stored reference. It does not perform a conversion or inspect a map’s head.

isInt

template<class... Args> decltype(auto) isInt(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Integer, following one stored reference. It does not perform a conversion or inspect a map’s head.

isFloat

template<class... Args> decltype(auto) isFloat(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Float, following one stored reference. It does not perform a conversion or inspect a map’s head.

isStr

template<class... Args> decltype(auto) isStr(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is String, following one stored reference. It does not perform a conversion or inspect a map’s head.

isVec

template<class... Args> decltype(auto) isVec(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Vector, following one stored reference. It does not perform a conversion or inspect a map’s head.

isSet

template<class... Args> decltype(auto) isSet(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Set, following one stored reference. It does not perform a conversion or inspect a map’s head.

isMap

template<class... Args> decltype(auto) isMap(Args&&... args) const;

Applies the corresponding cvar operation to the resolved entry. Tests whether the effective type is Map, following one stored reference. It does not perform a conversion or inspect a map’s head.

isBuf

template<class... Args> decltype(auto) isBuf(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::isBuf(). Reports whether the effective type is Buffer or Packed. Use isPacked() to distinguish compressed packed values.

isSym

template<class... Args> decltype(auto) isSym(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::isSym(). Tests for a symbol, optionally matching its name. A named lookup uses the symbol’s cached hash, which must be refreshed after direct name changes.

isFunc

template<class... Args> decltype(auto) isFunc(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::isFunc(). Tests for a function expression, optionally matching its name, exact arity, or inclusive arity range. Native Func0–Func15 callables are a different category.

isNumeric

template<class... Args> decltype(auto) isNumeric(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::isNumeric(). Reports whether the effective type is Integer or Float. Bool and convertible strings are not classified as numeric.

b1

template<class... Args> decltype(auto) b1(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::b1(). Converts through as<bool>(). Boolean conversion follows Catalyst’s accepted categories, not general string or collection truthiness.

i8

template<class... Args> decltype(auto) i8(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::i8(). Converts through as<int64_t>(). Unsupported value categories raise CError; numeric narrowing follows C++ conversion rules without an additional range check.

f8

template<class... Args> decltype(auto) f8(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::f8(). Converts through as<double>(). Unsupported value categories raise CError; numeric narrowing follows C++ conversion rules without an additional range check.

u8

template<class... Args> decltype(auto) u8(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::u8(). Converts through as<uint64_t>(). Unsupported value categories raise CError; numeric narrowing follows C++ conversion rules without an additional range check.

str

template<class... Args> decltype(auto) str(Args&&... args) const;
template<class... Args> decltype(auto) str(Args&&... args);

Resolves the parent map entry, then forwards to cvar::str(). Checked access through as<cstr>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

vec

template<class... Args> decltype(auto) vec(Args&&... args) const;
template<class... Args> decltype(auto) vec(Args&&... args);

Resolves the parent map entry, then forwards to cvar::vec(). Checked access through as<cvec>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

set

template<class... Args> decltype(auto) set(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::set(). Checked access through as<cset>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

map

template<class... Args> decltype(auto) map(Args&&... args) const;
template<class... Args> decltype(auto) map(Args&&... args);

Resolves the parent map entry, then forwards to cvar::map(). Checked access through as<cmap>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

buf

template<class... Args> decltype(auto) buf(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::buf(). Checked access through as<CBuffer>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

sym

template<class... Args> decltype(auto) sym(Args&&... args) const;
template<class... Args> decltype(auto) sym(Args&&... args);

Resolves the parent map entry, then forwards to cvar::sym(). Checked access through as<csym>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

func

template<class... Args> decltype(auto) func(Args&&... args) const;
template<class... Args> decltype(auto) func(Args&&... args);

Resolves the parent map entry, then forwards to cvar::func(). Checked access through as<cfunc>(), following references and applicable map # heads. The result is borrowed; it does not create an independent copy or owning handle.

getBool

template<class... Args> decltype(auto) getBool(Args&&... args) const;
template<class... Args> decltype(auto) getBool(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getBool(). Direct access to the raw Bool payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getInt

template<class... Args> decltype(auto) getInt(Args&&... args) const;
template<class... Args> decltype(auto) getInt(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getInt(). Direct access to the raw Integer payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getFloat

template<class... Args> decltype(auto) getFloat(Args&&... args) const;
template<class... Args> decltype(auto) getFloat(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getFloat(). Direct access to the raw Float payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getStr

template<class... Args> decltype(auto) getStr(Args&&... args) const;
template<class... Args> decltype(auto) getStr(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getStr(). Direct access to the raw String payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getVec

template<class... Args> decltype(auto) getVec(Args&&... args) const;
template<class... Args> decltype(auto) getVec(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getVec(). Direct access to the raw Vector payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getSet

template<class... Args> decltype(auto) getSet(Args&&... args) const;
template<class... Args> decltype(auto) getSet(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getSet(). Direct access to the raw Set payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getMap

template<class... Args> decltype(auto) getMap(Args&&... args) const;
template<class... Args> decltype(auto) getMap(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getMap(). Direct access to the raw Map payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getBuf

template<class... Args> decltype(auto) getBuf(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::getBuf(). Direct access to the raw Buffer or Packed payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getSym

template<class... Args> decltype(auto) getSym(Args&&... args) const;
template<class... Args> decltype(auto) getSym(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getSym(). Direct access to the raw Symbol payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getFunc

template<class... Args> decltype(auto) getFunc(Args&&... args) const;
template<class... Args> decltype(auto) getFunc(Args&&... args);

Resolves the parent map entry, then forwards to cvar::getFunc(). Direct access to the raw Function payload. Establish the matching raw type first; this does not follow references or perform conversion, and returned references are borrowed.

getRef

template<class... Args> decltype(auto) getRef(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::getRef(). Returns the borrowed referent of a value whose raw type is Reference. The caller must establish that type before calling; this accessor does not perform a checked conversion.

begin

template<class... Args> decltype(auto) begin(Args&&... args) const;
template<class... Args> decltype(auto) begin(Args&&... args);

Resolves the parent map entry, then forwards to cvar::begin(). Returns a C++ iterator over vector elements or function arguments. Map and set traversal require their typed container accessors or the runtime iterator API.

end

template<class... Args> decltype(auto) end(Args&&... args) const;
template<class... Args> decltype(auto) end(Args&&... args);

Resolves the parent map entry, then forwards to cvar::end(). Returns the matching past-the-end iterator for vector elements or function arguments. It must be compared with iterators from the same live value.

hash

template<class... Args> decltype(auto) hash(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::hash(). Computes the seeded value hash recursively. Map and set hashes do not depend on iteration order; numerically equal integral floats and integers share hashes.

size

template<class... Args> decltype(auto) size(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::size(). Counts vector elements, set elements, or function arguments, and forwards to objects and references. Other types, including strings and maps, return zero; use str().size() or map().size() for those.

empty

template<class... Args> decltype(auto) empty(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::empty(). Checks vectors, sets, and function arguments, forwarding to objects and references. Other types return true even when a contained string or map has contents.

span

template<class... Args> decltype(auto) span(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::span(). Returns numeric indices rather than an element view.

pack

template<class... Args> decltype(auto) pack(Args&&... args);

Resolves the parent map entry, then forwards to cvar::pack(). Replaces the value with its compressed packed representation. A Buffer value is rejected; an already Packed value is unchanged.

unpack

template<class... Args> decltype(auto) unpack(Args&&... args);

Resolves the parent map entry, then forwards to cvar::unpack(). Restores a Packed value. Other ordinary types are rejected.

save

template<class... Args> decltype(auto) save(Args&&... args);

Resolves the parent map entry, then forwards to cvar::save(). Stores the value in a file; use open() to restore it.

open

template<class... Args> decltype(auto) open(Args&&... args);

Resolves the parent map entry, then forwards to cvar::open(). Loads an archive written by save() and replaces this value. Checks the archive marker and decompresses the stored value.

back

template<class... Args> decltype(auto) back(Args&&... args);
template<class... Args> decltype(auto) back(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::back(). Returns the last vector element or function argument by reference; the sequence must be nonempty. Objects may implement the corresponding runtime operation.

pushFront

template<class... Args> decltype(auto) pushFront(Args&&... args);

Resolves the parent map entry, then forwards to cvar::pushFront(). Prepends to a vector or function argument list. A Null value becomes a vector; objects receive pushFront.

operator==

template<class... Args> decltype(auto) operator==(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator==(). Performs dynamic equality comparison and returns a C++ boolean. Numeric types compare by numeric value, collections compare by their contents, and unlike ordinary categories use type ordering; object comparisons dispatch to the object.

operator!=

template<class... Args> decltype(auto) operator!=(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator!=(). Performs dynamic inequality comparison and returns a C++ boolean. Numeric types compare by numeric value, collections compare by their contents, and unlike ordinary categories use type ordering; object comparisons dispatch to the object.

operator<

template<class... Args> decltype(auto) operator<(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator<(). Performs dynamic less-than comparison and returns a C++ boolean. Numeric types compare by numeric value, collections compare by their contents, and unlike ordinary categories use type ordering; object comparisons dispatch to the object.

operator>

template<class... Args> decltype(auto) operator>(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator>(). Performs dynamic greater-than comparison and returns a C++ boolean. Numeric types compare by numeric value, collections compare by their contents, and unlike ordinary categories use type ordering; object comparisons dispatch to the object.

operator<=

template<class... Args> decltype(auto) operator<=(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator<=(). Performs dynamic less-or-equal comparison and returns a C++ boolean. Numeric types compare by numeric value, collections compare by their contents, and unlike ordinary categories use type ordering; object comparisons dispatch to the object.

operator>=

template<class... Args> decltype(auto) operator>=(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator>=(). Performs dynamic greater-or-equal comparison and returns a C++ boolean. Numeric types compare by numeric value, collections compare by their contents, and unlike ordinary categories use type ordering; object comparisons dispatch to the object.

operator+

template<class... Args> decltype(auto) operator+(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator+(). Performs dynamic add arithmetic on numeric values or component-wise on compatible vectors. Unsupported operands raise CError; vector sizes must be compatible. Two string values concatenate.

operator-

template<class... Args> decltype(auto) operator-(Args&&... args) const;
cvar operator-() const;

Resolves the parent map entry, then forwards to cvar::operator-(). Performs dynamic sub arithmetic on numeric values or component-wise on compatible vectors. Unsupported operands raise CError; vector sizes must be compatible. The unary overload negates numeric values.

operator*

template<class... Args> decltype(auto) operator*(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator*(). Performs dynamic mul arithmetic on numeric values or component-wise on compatible vectors. Unsupported operands raise CError; vector sizes must be compatible. The zero-argument unary overload instead returns a borrowed referent, or this value for a non-reference.

operator/

template<class... Args> decltype(auto) operator/(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator/(). Performs dynamic div arithmetic on numeric values or component-wise on compatible vectors. Unsupported operands raise CError; vector sizes must be compatible. Integral division truncates; use Div() for explicit zero-divisor checking.

operator%

template<class... Args> decltype(auto) operator%(Args&&... args) const;

Resolves the parent map entry, then forwards to cvar::operator%(). Performs dynamic mod arithmetic on numeric values or component-wise on compatible vectors. Unsupported operands raise CError; vector sizes must be compatible. Floating-point remainder uses std::fmod.

operator+=

template<class... Args> decltype(auto) operator+=(Args&&... args);

Resolves the parent map entry, then forwards to cvar::operator+=(). Applies dynamic add arithmetic in place and returns this value. References modify their referent; compatible vectors are updated component by component.

operator-=

template<class... Args> decltype(auto) operator-=(Args&&... args);

Resolves the parent map entry, then forwards to cvar::operator-=(). Applies dynamic sub arithmetic in place and returns this value. References modify their referent; compatible vectors are updated component by component.

operator*=

template<class... Args> decltype(auto) operator*=(Args&&... args);

Resolves the parent map entry, then forwards to cvar::operator*=(). Applies dynamic mul arithmetic in place and returns this value. References modify their referent; compatible vectors are updated component by component.

operator/=

template<class... Args> decltype(auto) operator/=(Args&&... args);

Resolves the parent map entry, then forwards to cvar::operator/=(). Applies dynamic div arithmetic in place and returns this value. References modify their referent; compatible vectors are updated component by component.

operator%=

template<class... Args> decltype(auto) operator%=(Args&&... args);

Resolves the parent map entry, then forwards to cvar::operator%=(). Applies dynamic mod arithmetic in place and returns this value. References modify their referent; compatible vectors are updated component by component.

operator!

cvar operator!() const;

Applies the corresponding cvar operation to the resolved entry. Applies dynamic negation: None remains None, Null becomes true, and integers compare with zero. References forward, maps negate their # head, and objects dispatch Not; unsupported categories such as Float and String throw CError.

operator++

cvar operator++(int);
cvar& operator++();

Applies the corresponding cvar operation to the resolved entry. Increments an Integer or Float in place, forwarding through a reference. Prefix returns the updated receiver and postfix returns the old value; objects dispatch Inc or PostInc.

operator--

cvar operator--(int);
cvar& operator--();

Applies the corresponding cvar operation to the resolved entry. Decrements an Integer or Float in place, forwarding through a reference. Prefix returns the updated receiver and postfix returns the old value; objects dispatch Dec or PostDec.