Atoms Crowd  7.0.0
AtomsCore::ArrayMetadata Class Reference

ArrayMetadata class. More...

#include <ArrayMetadata.h>

Inheritance diagram for AtomsCore::ArrayMetadata:
AtomsCore::Metadata

Public Types

typedef std::vector< AtomsPtr< Metadata > > valueType
 value type
 

Public Member Functions

std::string typeStr () const
 Type string. More...
 
unsigned int typeId () const
 Type id. More...
 
 ArrayMetadata ()
 Constructor.
 
 ArrayMetadata (const ArrayMetadata &rhs)
 Copy constructor.
 
 ~ArrayMetadata ()
 Destructor.
 
ArrayMetadataoperator= (const ArrayMetadata &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...
 
size_t size () const
 Array size. More...
 
AtomsPtr< Metadataoperator[] (size_t index)
 Get an element. More...
 
AtomsPtr< const Metadataoperator[] (size_t index) const
 Subscript operator. More...
 
template<class T >
AtomsPtr< T > getTypedElement (size_t index)
 Get a typed element. More...
 
template<class T >
AtomsPtr< const T > getTypedElement (size_t index) const
 Get a typed element. More...
 
void erase (size_t index)
 Remove an element.
 
void push_back (const AtomsPtr< Metadata > &data)
 Add an entry. More...
 
void push_back (Metadata *data)
 Add an entry. More...
 
void insert (size_t index, const AtomsPtr< Metadata > &data)
 Insert an entry at the given index. More...
 
void insert (size_t index, Metadata *data)
 Insert an entry. More...
 
void clear ()
 Clear map. More...
 
virtual void hash (MurmurHash3 &hasher) const
 Hash function.
 
virtual void * dataPtr ()
 
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< size_t > &keys, bool append=false)
 Deserialise only specific keys.
 
bool deserialiseKeys (const std::string &fileName, const std::vector< std::size_t > &keysToDeserialise, bool append=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

ArrayMetadata class.

A map container for mixed type of metadata

Member Function Documentation

◆ clear()

void AtomsCore::ArrayMetadata::clear ( )

Clear map.

Delete all the data stored inside the map

◆ clone()

virtual AtomsPtr<Metadata> AtomsCore::ArrayMetadata::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::ArrayMetadata::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::ArrayMetadata::creator ( )
static

Creator function.

Needad mainly by the metadata factory

Returns
Return a new allocad metadata object

◆ getTypedElement() [1/2]

template<class T >
AtomsPtr< T > AtomsCore::ArrayMetadata::getTypedElement ( size_t  index)

Get a typed element.

Parameters
keyElement index
Returns
Entry stored inside a smart pointer to derived Matedata class

◆ getTypedElement() [2/2]

template<class T >
AtomsPtr< const T > AtomsCore::ArrayMetadata::getTypedElement ( size_t  index) const

Get a typed element.

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

◆ insert() [1/2]

void AtomsCore::ArrayMetadata::insert ( size_t  index,
const AtomsPtr< Metadata > &  data 
)

Insert an entry at the given index.

The data is cloned before is inserted in the map

Parameters
indexDestination index
dataEntry data

◆ insert() [2/2]

void AtomsCore::ArrayMetadata::insert ( size_t  index,
Metadata data 
)

Insert an entry.

The data is cloned before is inserted in the map

Parameters
indexDestination index
dataEntry data

◆ memSize()

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

Memory size.

Return the memory used when binary serialized

Implements AtomsCore::Metadata.

◆ operator[]() [1/2]

AtomsPtr<Metadata> AtomsCore::ArrayMetadata::operator[] ( size_t  index)

Get an element.

Parameters
indexSubscript operator
Returns
Smart pointer to the element

◆ operator[]() [2/2]

AtomsPtr<const Metadata> AtomsCore::ArrayMetadata::operator[] ( size_t  index) const

Subscript operator.

Parameters
keyElement index
Returns
Smart pointer to base Matedata class of the entry

◆ push_back() [1/2]

void AtomsCore::ArrayMetadata::push_back ( const AtomsPtr< Metadata > &  data)

Add an entry.

The data is cloned before is added to the map

Parameters
keyEntry key
dataEntry data

◆ push_back() [2/2]

void AtomsCore::ArrayMetadata::push_back ( Metadata data)

Add an entry.

The data is cloned before is added to the map

Parameters
keyEntry key
dataEntry data

◆ size()

size_t AtomsCore::ArrayMetadata::size ( ) const

Array size.

Returns
Number of elements store inside the map

◆ typeId()

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

Type id.

Returns
Class type id

Implements AtomsCore::Metadata.

◆ typeStr()

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

Type string.

Returns
Class type string

Implements AtomsCore::Metadata.


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