Blender V5.0
blender::nodes::Bundle Class Reference

#include <NOD_geometry_nodes_bundle.hh>

Inherits blender::ImplicitSharingMixin.

Classes

struct  StoredItem

Public Member Functions

bool add (StringRef key, const BundleItemValue &value)
void add_new (StringRef key, const BundleItemValue &value)
void add_override (StringRef key, const BundleItemValue &value)
bool add_path (StringRef path, const BundleItemValue &value)
void add_path_new (StringRef path, const BundleItemValue &value)
void add_path_override (StringRef path, const BundleItemValue &value)
template<typename T>
void add (StringRef key, T value)
template<typename T>
void add_override (StringRef key, T value)
template<typename T>
void add_path (StringRef path, T value)
template<typename T>
void add_path_override (StringRef path, T value)
bool remove (StringRef key)
bool contains (StringRef key) const
bool contains_path (StringRef path) const
const BundleItemValuelookup (StringRef key) const
const BundleItemValuelookup_path (Span< StringRef > path) const
const BundleItemValuelookup_path (StringRef path) const
template<typename T>
std::optional< Tlookup (StringRef key) const
template<typename T>
std::optional< Tlookup_path (StringRef path) const
bool is_empty () const
int64_t size () const
Span< StoredItemitems () const
BundlePtr copy () const
void delete_self () override
Public Member Functions inherited from blender::ImplicitSharingInfo
virtual ~ImplicitSharingInfo ()
bool is_mutable () const
bool is_expired () const
void add_user () const
void add_weak_user () const
void tag_ensured_mutable () const
int64_t version () const
int strong_users () const
void remove_user_and_delete_if_last () const
void remove_weak_user_and_delete_if_last () const

Static Public Member Functions

static BundlePtr create ()
static std::string combine_path (const Span< StringRef > path)

Detailed Description

A bundle is a map containing keys and their corresponding values.

The API also supports working with paths in nested bundles like root/child/data.

Definition at line 52 of file NOD_geometry_nodes_bundle.hh.

Member Function Documentation

◆ add() [1/2]

◆ add() [2/2]

template<typename T>
void blender::nodes::Bundle::add ( StringRef key,
T value )
inline

Definition at line 230 of file NOD_geometry_nodes_bundle.hh.

References add(), T, and blender::nodes::to_stored_type().

◆ add_new()

void blender::nodes::Bundle::add_new ( StringRef key,
const BundleItemValue & value )

Definition at line 45 of file geometry_nodes_bundle.cc.

References BLI_assert, and blender::nodes::is_valid_key().

Referenced by add(), add_override(), and add_path_override().

◆ add_override() [1/2]

void blender::nodes::Bundle::add_override ( StringRef key,
const BundleItemValue & value )

Definition at line 51 of file geometry_nodes_bundle.cc.

References add_new(), and remove().

Referenced by add_override().

◆ add_override() [2/2]

template<typename T>
void blender::nodes::Bundle::add_override ( StringRef key,
T value )
inline

Definition at line 241 of file NOD_geometry_nodes_bundle.hh.

References add_override(), T, and blender::nodes::to_stored_type().

◆ add_path() [1/2]

bool blender::nodes::Bundle::add_path ( StringRef path,
const BundleItemValue & value )

◆ add_path() [2/2]

template<typename T>
void blender::nodes::Bundle::add_path ( StringRef path,
T value )
inline

Definition at line 235 of file NOD_geometry_nodes_bundle.hh.

References add_path(), T, and blender::nodes::to_stored_type().

◆ add_path_new()

void blender::nodes::Bundle::add_path_new ( StringRef path,
const BundleItemValue & value )

Definition at line 105 of file geometry_nodes_bundle.cc.

References add_path_override(), BLI_assert, and contains_path().

Referenced by add_path().

◆ add_path_override() [1/2]

◆ add_path_override() [2/2]

template<typename T>
void blender::nodes::Bundle::add_path_override ( StringRef path,
T value )
inline

◆ combine_path()

std::string blender::nodes::Bundle::combine_path ( const Span< StringRef > path)
static

Create the combined path by inserting '/' between each element.

Definition at line 194 of file geometry_nodes_bundle.cc.

◆ contains()

bool blender::nodes::Bundle::contains ( StringRef key) const

Definition at line 178 of file geometry_nodes_bundle.cc.

References BLI_assert, and blender::nodes::is_valid_key().

Referenced by add(), and blender::nodes::tests::TEST_F().

◆ contains_path()

bool blender::nodes::Bundle::contains_path ( StringRef path) const

Definition at line 189 of file geometry_nodes_bundle.cc.

References lookup_path().

Referenced by add_path(), and add_path_new().

◆ copy()

BundlePtr blender::nodes::Bundle::copy ( ) const

Definition at line 161 of file geometry_nodes_bundle.cc.

References copy(), and create().

Referenced by copy().

◆ create()

◆ delete_self()

void blender::nodes::Bundle::delete_self ( )
overridevirtual

Implements blender::ImplicitSharingMixin.

Definition at line 199 of file geometry_nodes_bundle.cc.

◆ is_empty()

bool blender::nodes::Bundle::is_empty ( ) const
inline

Definition at line 259 of file NOD_geometry_nodes_bundle.hh.

References blender::Span< T >::is_empty().

◆ items()

◆ lookup() [1/2]

template<typename T>
std::optional< T > blender::nodes::Bundle::lookup ( StringRef key) const
inline

Definition at line 183 of file NOD_geometry_nodes_bundle.hh.

References blender::nodes::BundleItemValue::as(), lookup(), and T.

◆ lookup() [2/2]

const BundleItemValue * blender::nodes::Bundle::lookup ( StringRef key) const

◆ lookup_path() [1/3]

◆ lookup_path() [2/3]

template<typename T>
std::optional< T > blender::nodes::Bundle::lookup_path ( StringRef path) const
inline

◆ lookup_path() [3/3]

const BundleItemValue * blender::nodes::Bundle::lookup_path ( StringRef path) const

Definition at line 155 of file geometry_nodes_bundle.cc.

References lookup_path(), and blender::nodes::split_path().

◆ remove()

bool blender::nodes::Bundle::remove ( StringRef key)

◆ size()

int64_t blender::nodes::Bundle::size ( ) const
inline

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