OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::PropertyMap Class Reference

PropertyMap class maintains a list of GenericData. More...

#include <PropertyMap.hpp>

Public Member Functions

 PropertyMap ()
 trivial constructor
 
virtual ~PropertyMap ()=default
 Virtual Destructor responsible for deleting all of the generc data in PropertyMap.
 
void addProperty (std::shared_ptr< GenericData > genData)
 Adds property into property map.
 
bool removeProperty (const std::string &propName)
 Removes property from PropertyMap by name.
 
std::vector< std::string > getPropertyNames ()
 Returns all names of properties.
 
std::vector< std::shared_ptr< GenericData > > getProperties ()
 Returns all of the properties in PropertyMap.
 
bool hasProperty (const std::string &propName)
 Checks if property is in this PropertyMap.
 
std::shared_ptr< GenericDatagetPropertyByName (const std::string &propName)
 Returns property.
 

Protected Attributes

std::map< std::string, std::shared_ptr< GenericData > > propMap_
 

Detailed Description

PropertyMap class maintains a list of GenericData.

Type of Property is actually GenericData.

Definition at line 69 of file PropertyMap.hpp.

Constructor & Destructor Documentation

◆ PropertyMap()

OpenMD::PropertyMap::PropertyMap ( )
inline

trivial constructor

Definition at line 72 of file PropertyMap.hpp.

Member Function Documentation

◆ addProperty()

void OpenMD::PropertyMap::addProperty ( std::shared_ptr< GenericData > genData)

Adds property into property map.

Parameters
genDataGenericData to be added into PropertyMap
See also
removeProperty
#clearProperties

Definition at line 53 of file PropertyMap.cpp.

Referenced by OpenMD::SimInfo::addProperty(), OpenMD::AtomType::addProperty(), and OpenMD::NonBondedInteractionType::addProperty().

◆ getProperties()

std::vector< std::shared_ptr< GenericData > > OpenMD::PropertyMap::getProperties ( )

Returns all of the properties in PropertyMap.

Returns
all of the properties in PropertyMap
See also
getPropertyByName

Definition at line 89 of file PropertyMap.cpp.

Referenced by OpenMD::SimInfo::getProperties(), OpenMD::AtomType::getProperties(), and OpenMD::NonBondedInteractionType::getProperties().

◆ getPropertyByName()

std::shared_ptr< GenericData > OpenMD::PropertyMap::getPropertyByName ( const std::string & propName)

Returns property.

Parameters
propNamename of property
Returns
a pointer point to property with propName. If no property named propName exists, return NULL
See also
getProperties

Definition at line 110 of file PropertyMap.cpp.

Referenced by OpenMD::SimInfo::getPropertyByName(), OpenMD::NonBondedInteractionType::getPropertyByName(), and OpenMD::AtomType::getPropertyByName().

◆ getPropertyNames()

std::vector< std::string > OpenMD::PropertyMap::getPropertyNames ( )

Returns all names of properties.

Returns
all names of properties

Definition at line 79 of file PropertyMap.cpp.

Referenced by OpenMD::SimInfo::getPropertyNames(), OpenMD::AtomType::getPropertyNames(), and OpenMD::NonBondedInteractionType::getPropertyNames().

◆ hasProperty()

bool OpenMD::PropertyMap::hasProperty ( const std::string & propName)

Checks if property is in this PropertyMap.

Parameters
propNamename of property
Returns
boolean
See also
getProperties, getPropertyByName

Definition at line 99 of file PropertyMap.cpp.

Referenced by OpenMD::AtomType::hasProperty().

◆ removeProperty()

bool OpenMD::PropertyMap::removeProperty ( const std::string & propName)

Removes property from PropertyMap by name.

Parameters
propNamethe name of property to be removed
See also
addProperty
#clearProperties

Definition at line 65 of file PropertyMap.cpp.

Referenced by OpenMD::SimInfo::removeProperty(), OpenMD::NonBondedInteractionType::removeProperty(), and OpenMD::AtomType::removeProperty().

Member Data Documentation

◆ propMap_

std::map<std::string, std::shared_ptr<GenericData> > OpenMD::PropertyMap::propMap_
protected

Definition at line 142 of file PropertyMap.hpp.


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