37 std::variant<BundleItemSocketValue, BundleItemInternalValue>
value;
44 template<
typename T> std::optional<T>
as()
const;
112 *socket_value->
type, socket_value->
value, dst_socket_type))
114 return converted_value->get<
T>();
122 const std::optional<eNodeSocketDatatype> socket_type =
127 return socket_type_info;
130 const std::optional<eNodeSocketDatatype> socket_type =
142 if constexpr (std::is_base_of_v<BundleItemInternalValueMixin, typename T::element_type>) {
152 using SharingInfoT =
typename T::element_type;
153 const auto *internal_value = std::get_if<BundleItemInternalValue>(&this->
value);
154 if (!internal_value) {
158 const SharingInfoT *converted_value =
dynamic_cast<const SharingInfoT *
>(sharing_info);
159 if (!converted_value) {
165 else if constexpr (std::is_same_v<T, ListPtr>) {
189 return item->
as<
T>();
198 return item->
as<
T>();
203 using DecayT = std::decay_t<T>;
204 if constexpr (std::is_same_v<DecayT, BundleItemValue>) {
205 fn(std::forward<T>(value));
207 else if constexpr (std::is_same_v<DecayT, BundleItemSocketValue>) {
210 else if constexpr (std::is_same_v<DecayT, BundleItemInternalValue>) {
266 return items_.size();
#define BLI_assert_unreachable()
static const CPPType & get()
constexpr bool is_empty() const
static SocketValueVariant From(T &&value)
virtual StringRefNull type_name() const =0
Span< StoredItem > items() const
bool remove(StringRef key)
void delete_self() override
void add_path_new(StringRef path, const BundleItemValue &value)
void add_new(StringRef key, const BundleItemValue &value)
bool contains_path(StringRef path) const
static BundlePtr create()
void add_override(StringRef key, const BundleItemValue &value)
const BundleItemValue * lookup(StringRef key) const
void add_path_override(StringRef path, const BundleItemValue &value)
bool add(StringRef key, const BundleItemValue &value)
static std::string combine_path(const Span< StringRef > path)
const BundleItemValue * lookup_path(Span< StringRef > path) const
bool add_path(StringRef path, const BundleItemValue &value)
bool contains(StringRef key) const
std::optional< eNodeSocketDatatype > geo_nodes_base_cpp_type_to_socket_type(const CPPType &type)
bNodeSocketType * node_socket_type_find_static(int type, int subtype=0)
static constexpr bool is_field_v
const bke::bNodeSocketType * socket_type_info_by_static_type()
ImplicitSharingPtr< Bundle > BundlePtr
ImplicitSharingPtr< List > ListPtr
constexpr bool is_valid_internal_bundle_item_type()
std::optional< SocketValueVariant > implicitly_convert_socket_value(const bke::bNodeSocketType &from_type, const SocketValueVariant &from_value, const bke::bNodeSocketType &to_type)
void to_stored_type(T &&value, Fn &&fn)
static constexpr bool is_ImplicitSharingPtr_strong_v
ImplicitSharingPtr< BundleItemInternalValueMixin > value
const bke::bNodeSocketType * type
bke::SocketValueVariant value
std::variant< BundleItemSocketValue, BundleItemInternalValue > value
std::optional< T > as() const
std::optional< T > as_socket_value(const bke::bNodeSocketType &socket_type) const