Luanti 5.16.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

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

Additional Inherited Members

Constructor & Destructor Documentation

◆ NodeMetadata()

NodeMetadata::NodeMetadata ( IItemDefManager * item_def_mgr)

References m_inventory.

◆ ~NodeMetadata()

NodeMetadata::~NodeMetadata ( )
default

Member Function Documentation

◆ clear()

void NodeMetadata::clear ( )
virtual

Reimplemented from SimpleMetadata.

References 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(), 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(), 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(), 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, 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

std::unique_ptr<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: