Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
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
 
bool markPrivate (const std::string &name, bool set)
 Marks a key as private.
 

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 SimpleMetadata.

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

Referenced by content_nodemeta_deserialize_legacy_body(), deSerialize(), and NodeMetadataList::remove().

+ 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 SimpleMetadata::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, m_privatevars, SimpleMetadata::m_stringvars, 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 SimpleMetadata.

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

Referenced by NodeMetaRef::reportMetadataChange(), and 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(), Client::getInventory(), ServerInventoryManager::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()

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

Marks a key as private.

Returns
metadata modified?

References m_privatevars.

Referenced by 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, SimpleMetadata::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

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