Atoms Crowd  4.1.0
AtomsCore::MapMetadata Class Reference

MapMetadata class. More...

#include <MapMetadata.h>

Inheritance diagram for AtomsCore::MapMetadata:
AtomsCore::Metadata

Public Types

typedef std::string Key
 
typedef std::map< Key, AtomsPtr< Metadata > > valueType
 value type
 

Public Member Functions

std::string typeStr () const
 Type string. More...
 
unsigned int typeId () const
 Type id. More...
 
 MapMetadata ()
 Constructor.
 
 MapMetadata (const MapMetadata &rhs)
 Copy constructor.
 
 ~MapMetadata ()
 Destructor.
 
MapMetadataoperator= (const MapMetadata &other)
 Assign operator.
 
virtual void copy (Metadata *other)
 copy value More...
 
virtual AtomsPtr< Metadataclone () const
 clone object More...
 
virtual size_t memSize () const
 Memory size. More...
 
unsigned int size () const
 Map size. More...
 
bool hasKey (const Key &key) const
 Has key. More...
 
std::vector< Key > getKeys () const
 Get keys. More...
 
AtomsPtr< MetadatagetEntry (const Key &key)
 Get an entry. More...
 
AtomsPtr< const MetadatagetEntry (const Key &key) const
 Get an entry. More...
 
template<class T >
AtomsPtr< T > getTypedEntry (const Key &key)
 Get a typed entry. More...
 
template<class T >
AtomsPtr< const T > getTypedEntry (const Key &key) const
 Get a typed entry. More...
 
void eraseEntry (const Key &key)
 Remove an entry.
 
void addEntry (const Key &key, AtomsPtr< Metadata > &data, bool cloneData=true)
 Add an entry. More...
 
void addEntry (const Key &key, const AtomsPtr< const Metadata > &data)
 Add an entry. More...
 
void addEntry (const Key &key, Metadata *data)
 Add an entry. More...
 
void insertEntry (const Key &key, AtomsPtr< Metadata > data)
 Add an entry. More...
 
void addEmptyEntry (const Key &key)
 Add n empty entry.
 
void clear ()
 Clear map. More...
 
valueType::iterator begin ()
 Begin iteration.
 
valueType::iterator end ()
 End iteration.
 
valueType::const_iterator cbegin () const
 Begin const iterator.
 
valueType::const_iterator cend () const
 End const iterator.
 
virtual void hash (MurmurHash3 &hasher) const
 Hash.
 
valueTypedata ()
 
const valueTypedata () const
 
bool serialise (Archive &outStream) const
 Serialise.
 
bool deserialise (Archive &inStream)
 Deserialise.
 
void toString (std::stringstream &ss) const
 String conversion.
 
bool serialiseCompressed (Archive &outStream) const
 Serialise random access compressed archive.
 
bool deserialiseCompressed (Archive &outStream)
 Deserialise random access compressed archive.
 
bool deserialiseKeys (Archive &outStream, const std::vector< std::string > &keys, bool append=false)
 Deserialise only specific keys.
 
bool deserialiseKeys (const std::string &filePath, const std::vector< std::string > &keys, bool append=false, bool multithread=false)
 

Static Public Member Functions

static std::string staticTypeStr ()
 Class static type string.
 
static unsigned int staticTypeId ()
 Class static type string.
 
static Metadatacreator ()
 Creator function. More...
 

Detailed Description

MapMetadata class.

A map container for mixed type of metadata

Member Function Documentation

◆ addEntry() [1/3]

void AtomsCore::MapMetadata::addEntry ( const Key &  key,
AtomsPtr< Metadata > &  data,
bool  cloneData = true 
)

Add an entry.

The data is cloned before is added to the map

Parameters
keyEntry key
dataEntry data

◆ addEntry() [2/3]

void AtomsCore::MapMetadata::addEntry ( const Key &  key,
const AtomsPtr< const Metadata > &  data 
)

Add an entry.

The data is cloned before is added to the map

Parameters
keyEntry key
dataEntry data

◆ addEntry() [3/3]

void AtomsCore::MapMetadata::addEntry ( const Key &  key,
Metadata data 
)

Add an entry.

The data is cloned before is added to the map

Parameters
keyEntry key
dataEntry data

◆ clear()

void AtomsCore::MapMetadata::clear ( )

Clear map.

Delete all the data stored inside the map

◆ clone()

virtual AtomsPtr<Metadata> AtomsCore::MapMetadata::clone ( ) const
virtual

clone object

Clone the obj. It returns a shared pointer to the new allocated object

Implements AtomsCore::Metadata.

◆ copy()

virtual void AtomsCore::MapMetadata::copy ( Metadata other)
virtual

copy value

Virtual function to copy the value from one metadata to another using base pointer.

Parameters
otherObject to copy from

Implements AtomsCore::Metadata.

◆ creator()

static Metadata* AtomsCore::MapMetadata::creator ( )
static

Creator function.

Needad mainly by the metadata factory

Returns
Return a new allocad metadata object

◆ getEntry() [1/2]

AtomsPtr<Metadata> AtomsCore::MapMetadata::getEntry ( const Key &  key)

Get an entry.

Parameters
keyEntry key
Returns
Smart pointer to the entry

◆ getEntry() [2/2]

AtomsPtr<const Metadata> AtomsCore::MapMetadata::getEntry ( const Key &  key) const

Get an entry.

Parameters
keyEntry key
Returns
Smart pointer to base Matedata class of the entry

◆ getKeys()

std::vector<Key> AtomsCore::MapMetadata::getKeys ( ) const

Get keys.

Get all keys used by the map

Returns
Vector with all keys

◆ getTypedEntry() [1/2]

template<class T >
AtomsPtr< T > AtomsCore::MapMetadata::getTypedEntry ( const Key &  key)

Get a typed entry.

Parameters
keyEntry key
Returns
Entry stored inside a smart pointer to derived Matedata class

◆ getTypedEntry() [2/2]

template<class T >
AtomsPtr< const T > AtomsCore::MapMetadata::getTypedEntry ( const Key &  key) const

Get a typed entry.

Parameters
keyEntry key
Returns
Entry stored inside a smart pointer to derived Matedata class

◆ hasKey()

bool AtomsCore::MapMetadata::hasKey ( const Key &  key) const

Has key.

Check if an entry using a specific key exists

Parameters
keyEntry key
Returns
True if the key exists

◆ insertEntry()

void AtomsCore::MapMetadata::insertEntry ( const Key &  key,
AtomsPtr< Metadata data 
)

Add an entry.

The data is not cloned but insert directly inside

Parameters
keyEntry key
dataEntry data

◆ memSize()

virtual size_t AtomsCore::MapMetadata::memSize ( ) const
virtual

Memory size.

Return the memory used when binary serialized

Implements AtomsCore::Metadata.

◆ size()

unsigned int AtomsCore::MapMetadata::size ( ) const

Map size.

Returns
Number of elements store inside the map

◆ typeId()

unsigned int AtomsCore::MapMetadata::typeId ( ) const
virtual

Type id.

Returns
Class type id

Implements AtomsCore::Metadata.

◆ typeStr()

std::string AtomsCore::MapMetadata::typeStr ( ) const
virtual

Type string.

Returns
Class type string

Implements AtomsCore::Metadata.


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