Atoms Crowd
7.0.0
|
ArrayMetadata class. More...
#include <ArrayMetadata.h>
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. | |
ArrayMetadata & | operator= (const ArrayMetadata &other) |
Assign operator. | |
virtual void | copy (Metadata *other) |
copy value More... | |
virtual AtomsPtr< Metadata > | clone () const |
clone object More... | |
virtual size_t | memSize () const |
Memory size. More... | |
size_t | size () const |
Array size. More... | |
AtomsPtr< Metadata > | operator[] (size_t index) |
Get an element. More... | |
AtomsPtr< const Metadata > | operator[] (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) |
Public Member Functions inherited from AtomsCore::Metadata | |
Metadata () | |
constructor | |
virtual | ~Metadata ()=0 |
Virtual destructor. | |
virtual bool | setWithValuesAndWeights (const std::vector< AtomsPtr< Metadata >> &values, const std::vector< double > &weights) |
Set with weighted values. | |
virtual bool | setWithValuesAndWeights (const std::vector< Metadata * > &values, const std::vector< double > &weights) |
virtual bool | isEqual (Metadata *right, double err=0.0) const |
Equal function. | |
virtual bool | isGreater (Metadata *right) const |
virtual bool | isLess (Metadata *right) const |
virtual bool | isArray () const |
Static Public Member Functions | |
static std::string | staticTypeStr () |
Class static type string. | |
static unsigned int | staticTypeId () |
Class static type string. | |
static Metadata * | creator () |
Creator function. More... | |
ArrayMetadata class.
A map container for mixed type of metadata
void AtomsCore::ArrayMetadata::clear | ( | ) |
Clear map.
Delete all the data stored inside the map
|
virtual |
clone object
Clone the obj. It returns a shared pointer to the new allocated object
Implements AtomsCore::Metadata.
|
virtual |
copy value
Virtual function to copy the value from one metadata to another using base pointer.
other | Object to copy from |
Implements AtomsCore::Metadata.
|
static |
Creator function.
Needad mainly by the metadata factory
AtomsPtr< T > AtomsCore::ArrayMetadata::getTypedElement | ( | size_t | index | ) |
Get a typed element.
key | Element index |
AtomsPtr< const T > AtomsCore::ArrayMetadata::getTypedElement | ( | size_t | index | ) | const |
Get a typed element.
index |
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
index | Destination index |
data | Entry data |
void AtomsCore::ArrayMetadata::insert | ( | size_t | index, |
Metadata * | data | ||
) |
Insert an entry.
The data is cloned before is inserted in the map
index | Destination index |
data | Entry data |
|
virtual |
AtomsPtr<Metadata> AtomsCore::ArrayMetadata::operator[] | ( | size_t | index | ) |
Get an element.
index | Subscript operator |
AtomsPtr<const Metadata> AtomsCore::ArrayMetadata::operator[] | ( | size_t | index | ) | const |
Subscript operator.
key | Element index |
void AtomsCore::ArrayMetadata::push_back | ( | const AtomsPtr< Metadata > & | data | ) |
Add an entry.
The data is cloned before is added to the map
key | Entry key |
data | Entry data |
void AtomsCore::ArrayMetadata::push_back | ( | Metadata * | data | ) |
Add an entry.
The data is cloned before is added to the map
key | Entry key |
data | Entry data |
size_t AtomsCore::ArrayMetadata::size | ( | ) | const |
Array size.
|
virtual |
|
virtual |