Minetest  5.4.0
NodeMetadata Class Reference

#include <nodemetadata.h>

+ Inheritance diagram for NodeMetadata:
+ Collaboration diagram for NodeMetadata:

Public Member Functions

 NodeMetadata (IItemDefManager *item_def_mgr)
 
 ~NodeMetadata ()
 
void serialize (std::ostream &os, u8 version, bool disk=true) const
 
void deSerialize (std::istream &is, u8 version)
 
void clear ()
 
bool empty () const
 
InventorygetInventory ()
 
bool isPrivate (const std::string &name) const
 
void markPrivate (const std::string &name, bool set)
 

Private Member Functions

int countNonPrivate () const
 

Private Attributes

Inventorym_inventory
 
std::unordered_set< std::string > m_privatevars
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ NodeMetadata()

NodeMetadata::NodeMetadata ( IItemDefManager item_def_mgr)

◆ ~NodeMetadata()

NodeMetadata::~NodeMetadata ( )

References m_inventory.

Member Function Documentation

◆ clear()

void NodeMetadata::clear ( )
virtual

Reimplemented from Metadata.

References Inventory::clear(), Metadata::clear(), m_inventory, and m_privatevars.

Referenced by content_nodemeta_deserialize_legacy_body(), and deSerialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ countNonPrivate()

int NodeMetadata::countNonPrivate ( ) const
private

References isPrivate(), and Metadata::m_stringvars.

Referenced by serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deSerialize()

void NodeMetadata::deSerialize ( std::istream &  is,
u8  version 
)

References clear(), Inventory::deSerialize(), deSerializeString16(), deSerializeString32(), m_inventory, Metadata::m_stringvars, markPrivate(), readU32(), and readU8().

Referenced by RollbackAction::applyRevert(), and NodeMetadataList::deSerialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ empty()

bool NodeMetadata::empty ( ) const
virtual

Reimplemented from Metadata.

References Metadata::empty(), Inventory::getLists(), and m_inventory.

Referenced by NodeMetadataList::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInventory()

Inventory* NodeMetadata::getInventory ( )
inline

References m_inventory.

Referenced by content_nodemeta_deserialize_legacy_body(), ServerInventoryManager::getInventory(), Client::getInventory(), NodeMetaRef::handleFromTable(), and NodeMetaRef::handleToTable().

+ Here is the caller graph for this function:

◆ isPrivate()

bool NodeMetadata::isPrivate ( const std::string &  name) const
inline

References m_privatevars.

Referenced by countNonPrivate(), NodeMetaRef::reportMetadataChange(), and serialize().

+ Here is the caller graph for this function:

◆ markPrivate()

void NodeMetadata::markPrivate ( const std::string &  name,
bool  set 
)

References m_privatevars.

Referenced by deSerialize(), and NodeMetaRef::l_mark_as_private().

+ Here is the caller graph for this function:

◆ serialize()

void NodeMetadata::serialize ( std::ostream &  os,
u8  version,
bool  disk = true 
) const

References countNonPrivate(), isPrivate(), m_inventory, Metadata::m_stringvars, Inventory::serialize(), serializeString16(), serializeString32(), writeU32(), and writeU8().

Referenced by RollbackNode::RollbackNode(), and NodeMetadataList::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_inventory

Inventory* NodeMetadata::m_inventory
private

◆ m_privatevars

std::unordered_set<std::string> NodeMetadata::m_privatevars
private

Referenced by clear(), isPrivate(), and markPrivate().


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