Blender  V3.3
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
blender::bke::AssetCatalogTreeItem Class Reference

#include <BKE_asset_catalog.hh>

Public Types

using ChildMap = std::map< std::string, AssetCatalogTreeItem >
 
using ItemIterFn = FunctionRef< void(AssetCatalogTreeItem &)>
 

Public Member Functions

 AssetCatalogTreeItem (StringRef name, CatalogID catalog_id, StringRef simple_name, const AssetCatalogTreeItem *parent=nullptr)
 
CatalogID get_catalog_id () const
 
StringRefNull get_simple_name () const
 
StringRefNull get_name () const
 
bool has_unsaved_changes () const
 
AssetCatalogPath catalog_path () const
 
int count_parents () const
 
bool has_children () const
 
void foreach_child (const ItemIterFn callback)
 

Protected Attributes

ChildMap children_
 
CatalogPathComponent name_
 
CatalogID catalog_id_
 
std::string simple_name_
 
bool has_unsaved_changes_ = false
 
const AssetCatalogTreeItemparent_ = nullptr
 

Friends

class AssetCatalogTree
 

Detailed Description

Representation of a catalog path in the AssetCatalogTree.

Definition at line 284 of file BKE_asset_catalog.hh.

Member Typedef Documentation

◆ ChildMap

Container for child items. Uses a #std::map to keep items ordered by their name (i.e. their last catalog component).

Definition at line 290 of file BKE_asset_catalog.hh.

◆ ItemIterFn

Definition at line 291 of file BKE_asset_catalog.hh.

Constructor & Destructor Documentation

◆ AssetCatalogTreeItem()

blender::bke::AssetCatalogTreeItem::AssetCatalogTreeItem ( StringRef  name,
CatalogID  catalog_id,
StringRef  simple_name,
const AssetCatalogTreeItem parent = nullptr 
)

Definition at line 675 of file blenkernel/intern/asset_catalog.cc.

Member Function Documentation

◆ catalog_path()

AssetCatalogPath blender::bke::AssetCatalogTreeItem::catalog_path ( ) const

◆ count_parents()

int blender::bke::AssetCatalogTreeItem::count_parents ( ) const

◆ foreach_child()

void blender::bke::AssetCatalogTreeItem::foreach_child ( const ItemIterFn  callback)

Iterate over children calling callback for each of them, but do not recurse into their children.

Definition at line 734 of file blenkernel/intern/asset_catalog.cc.

References callback, and children_.

Referenced by blender::bke::tests::AssetCatalogTest::assert_expected_tree_item_child_items().

◆ get_catalog_id()

CatalogID blender::bke::AssetCatalogTreeItem::get_catalog_id ( ) const

◆ get_name()

StringRefNull blender::bke::AssetCatalogTreeItem::get_name ( ) const

◆ get_simple_name()

StringRefNull blender::bke::AssetCatalogTreeItem::get_simple_name ( ) const

◆ has_children()

bool blender::bke::AssetCatalogTreeItem::has_children ( ) const

Definition at line 720 of file blenkernel/intern/asset_catalog.cc.

References children_.

◆ has_unsaved_changes()

bool blender::bke::AssetCatalogTreeItem::has_unsaved_changes ( ) const

Friends And Related Function Documentation

◆ AssetCatalogTree

friend class AssetCatalogTree
friend

Definition at line 285 of file BKE_asset_catalog.hh.

Member Data Documentation

◆ catalog_id_

CatalogID blender::bke::AssetCatalogTreeItem::catalog_id_
protected

Definition at line 317 of file BKE_asset_catalog.hh.

Referenced by get_catalog_id().

◆ children_

ChildMap blender::bke::AssetCatalogTreeItem::children_
protected

Child tree items, ordered by their names.

Definition at line 314 of file BKE_asset_catalog.hh.

Referenced by foreach_child(), has_children(), and blender::bke::AssetCatalogTree::insert_item().

◆ has_unsaved_changes_

bool blender::bke::AssetCatalogTreeItem::has_unsaved_changes_ = false
protected

Copy of #AssetCatalog::flags.has_unsaved_changes.

Definition at line 321 of file BKE_asset_catalog.hh.

Referenced by has_unsaved_changes().

◆ name_

CatalogPathComponent blender::bke::AssetCatalogTreeItem::name_
protected

The user visible name of this component.

Definition at line 316 of file BKE_asset_catalog.hh.

Referenced by catalog_path(), and get_name().

◆ parent_

const AssetCatalogTreeItem* blender::bke::AssetCatalogTreeItem::parent_ = nullptr
protected

Pointer back to the parent item. Used to reconstruct the hierarchy from an item (e.g. to build a path).

Definition at line 325 of file BKE_asset_catalog.hh.

Referenced by catalog_path(), and count_parents().

◆ simple_name_

std::string blender::bke::AssetCatalogTreeItem::simple_name_
protected

Copy of #AssetCatalog::simple_name.

Definition at line 319 of file BKE_asset_catalog.hh.

Referenced by get_simple_name().


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