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

#include <NOD_geometry_nodes_bundle.hh>

Inherits blender::blender::ImplicitSharingMixin.

Public Types

using BundleItemMap = Map<BundleKey, BundleItemValue>

Public Member Functions

bool add (BundleKey key, const BundleItemValue &value)
bool add (BundleKey key, BundleItemValue &&value)
void add_new (BundleKey key, const BundleItemValue &value)
void add_new (BundleKey key, BundleItemValue &&value)
void add_override (BundleKey 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)
void add_path_override (Span< BundleKey > path, const BundleItemValue &value)
template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void add (BundleKey key, T &&value)
template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void add_new (BundleKey key, T &&value)
template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void add_override (BundleKey key, T &&value)
template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void add_path (StringRef path, T &&value)
template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void add_path_override (Span< BundleKey > path, T &&value)
template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void add_path_override (StringRef path, T &&value)
bool remove (BundleKey key)
bool remove_path (StringRef path)
bool remove_path (Span< BundleKey > path)
bool contains (BundleKey key) const
bool contains_path (StringRef path) const
bool contains_path (Span< BundleKey > path) const
const BundleItemValue * lookup (BundleKey key) const
BundleItemValue * lookup (BundleKey key)
const BundleItemValue * lookup_path (Span< BundleKey > path) const
const BundleItemValue * lookup_path (StringRef path) const
BundleItemValue * lookup_path_for_write (Span< BundleKey > path)
BundleItemValue * lookup_path_for_write (StringRef path)
template<typename T>
std::optional< T > lookup (BundleKey key) const
template<typename T>
std::optional< T > lookup_path (Span< BundleKey > path) const
template<typename T>
std::optional< T > lookup_path (StringRef path) const
template<typename T>
T * lookup_ptr (BundleKey key)
template<typename T>
const T * lookup_ptr (BundleKey key) const
template<typename T>
const T * lookup_path_ptr (StringRef path) const
template<typename T>
const T * lookup_path_ptr (Span< BundleKey > path) const
template<typename T>
T * lookup_path_for_write_ptr (StringRef path)
template<typename T>
T * lookup_path_for_write_ptr (Span< BundleKey > path)
Bundle & ensure_nested_bundle (StringRef path)
void merge (const Bundle &other)
void merge_override (const Bundle &other)
bool is_empty () const
int64_t size () const
void clear ()
std::optional< StringRef > type () const
void ensure_owns_direct_data ()
bool owns_direct_data () const
BundleItemMap::ItemIterator items () const
BundleItemMap::MutableItemIterator items ()
BundlePtr copy () const
void delete_self () override
void count_memory (MemoryCounter &memory) const
Vector< std::string > gather_paths (FunctionRef< bool(const Bundle &bundle)> fn) const
Public Member Functions inherited from blender::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 (Span< StringRef > path)
static std::string combine_path (Span< BundleKey > path)
static bool is_valid_path (StringRef path)
static std::optional< Vector< BundleKey > > split_path (StringRef path)

Static Public Attributes

static BundleKey type_item_name = *BundleKey::from_str("Type")

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 90 of file NOD_geometry_nodes_bundle.hh.

Member Typedef Documentation

◆ BundleItemMap

Member Function Documentation

◆ add() [1/3]

bool blender::nodes::Bundle::add ( BundleKey key,
BundleItemValue && value )

Definition at line 118 of file geometry_nodes_bundle.cc.

References add_new(), and contains().

◆ add() [2/3]

◆ add() [3/3]

template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void blender::nodes::Bundle::add ( BundleKey key,
T && value )
inline

Definition at line 422 of file NOD_geometry_nodes_bundle.hh.

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

◆ add_new() [1/3]

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

Definition at line 98 of file geometry_nodes_bundle.cc.

◆ add_new() [2/3]

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

Definition at line 93 of file geometry_nodes_bundle.cc.

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

◆ add_new() [3/3]

template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void blender::nodes::Bundle::add_new ( BundleKey key,
T && value )
inline

◆ add_override() [1/2]

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

Definition at line 103 of file geometry_nodes_bundle.cc.

References add_new(), and remove().

Referenced by add_override(), and merge_override().

◆ add_override() [2/2]

template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void blender::nodes::Bundle::add_override ( BundleKey key,
T && value )
inline

◆ add_path() [1/2]

◆ add_path() [2/2]

template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void blender::nodes::Bundle::add_path ( StringRef path,
T && value )
inline

◆ add_path_new()

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

Definition at line 168 of file geometry_nodes_bundle.cc.

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

Referenced by add_path().

◆ add_path_override() [1/4]

◆ add_path_override() [2/4]

template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void blender::nodes::Bundle::add_path_override ( Span< BundleKey > path,
T && value )
inline

◆ add_path_override() [3/4]

◆ add_path_override() [4/4]

template<typename T>
requires (!std::is_same_v<std::decay_t<T>, BundleItemValue>)
void blender::nodes::Bundle::add_path_override ( StringRef path,
T && value )
inline

◆ clear()

void blender::nodes::Bundle::clear ( )

Definition at line 352 of file geometry_nodes_bundle.cc.

Referenced by blender::nodes::tests::TEST_F().

◆ combine_path() [1/2]

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

Definition at line 342 of file geometry_nodes_bundle.cc.

◆ combine_path() [2/2]

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

◆ contains()

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

Definition at line 322 of file geometry_nodes_bundle.cc.

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

◆ contains_path() [1/2]

bool blender::nodes::Bundle::contains_path ( Span< BundleKey > path) const

Definition at line 332 of file geometry_nodes_bundle.cc.

References lookup_path().

◆ contains_path() [2/2]

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

Definition at line 327 of file geometry_nodes_bundle.cc.

References lookup_path().

Referenced by add_path(), add_path_new(), and remove_path().

◆ copy()

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

Definition at line 285 of file geometry_nodes_bundle.cc.

References copy(), and create().

Referenced by copy().

◆ count_memory()

void blender::nodes::Bundle::count_memory ( MemoryCounter & memory) const

Definition at line 363 of file geometry_nodes_bundle.cc.

◆ create()

◆ delete_self()

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

Implements blender::blender::ImplicitSharingMixin.

Definition at line 347 of file geometry_nodes_bundle.cc.

◆ ensure_nested_bundle()

◆ ensure_owns_direct_data()

void blender::nodes::Bundle::ensure_owns_direct_data ( )

◆ gather_paths()

Vector< std::string > blender::nodes::Bundle::gather_paths ( FunctionRef< bool(const Bundle &bundle)> fn) const

◆ is_empty()

◆ is_valid_path()

bool blender::nodes::Bundle::is_valid_path ( StringRef path)
static

◆ items() [1/2]

Bundle::BundleItemMap::MutableItemIterator blender::nodes::Bundle::items ( )
inline

Definition at line 478 of file NOD_geometry_nodes_bundle.hh.

◆ items() [2/2]

◆ lookup() [1/3]

BundleItemValue * blender::nodes::Bundle::lookup ( BundleKey key)

Definition at line 191 of file geometry_nodes_bundle.cc.

◆ lookup() [2/3]

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

Definition at line 303 of file NOD_geometry_nodes_bundle.hh.

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

◆ lookup() [3/3]

◆ lookup_path() [1/4]

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

◆ lookup_path() [2/4]

◆ lookup_path() [3/4]

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

◆ lookup_path() [4/4]

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

◆ lookup_path_for_write() [1/2]

◆ lookup_path_for_write() [2/2]

BundleItemValue * blender::nodes::Bundle::lookup_path_for_write ( StringRef path)

◆ lookup_path_for_write_ptr() [1/2]

template<typename T>
T * blender::nodes::Bundle::lookup_path_for_write_ptr ( Span< BundleKey > path)
inline

◆ lookup_path_for_write_ptr() [2/2]

template<typename T>
T * blender::nodes::Bundle::lookup_path_for_write_ptr ( StringRef path)
inline

◆ lookup_path_ptr() [1/2]

template<typename T>
const T * blender::nodes::Bundle::lookup_path_ptr ( Span< BundleKey > path) const
inline

◆ lookup_path_ptr() [2/2]

template<typename T>
const T * blender::nodes::Bundle::lookup_path_ptr ( StringRef path) const
inline

◆ lookup_ptr() [1/2]

template<typename T>
T * blender::nodes::Bundle::lookup_ptr ( BundleKey key)
inline

Definition at line 312 of file NOD_geometry_nodes_bundle.hh.

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

Referenced by type().

◆ lookup_ptr() [2/2]

template<typename T>
const T * blender::nodes::Bundle::lookup_ptr ( BundleKey key) const
inline

◆ merge()

◆ merge_override()

void blender::nodes::Bundle::merge_override ( const Bundle & other)

◆ owns_direct_data()

bool blender::nodes::Bundle::owns_direct_data ( ) const

Definition at line 273 of file geometry_nodes_bundle.cc.

Referenced by blender::nodes::GList::owns_direct_data().

◆ remove()

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

Definition at line 293 of file geometry_nodes_bundle.cc.

Referenced by add_override().

◆ remove_path() [1/2]

◆ remove_path() [2/2]

◆ size()

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

◆ split_path()

◆ type()

std::optional< StringRef > blender::nodes::Bundle::type ( ) const

Member Data Documentation

◆ type_item_name


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