PLaSK library
Loading...
Searching...
No Matches
plask::MaterialInfo::DB Class Reference

Material info database. More...

#include <plask/material/info.hpp>

Public Types

typedef std::map< std::string, MaterialInfo >::iterator iterator
 iterator over materials' meta-information
 
typedef std::map< std::string, MaterialInfo >::const_iterator const_iterator
 const iterator over materials' meta-information
 

Public Member Functions

void clear ()
 Clear the database.
 
void update (const DB &src)
 Update with values from different database.
 
MaterialInfoadd (const std::string &materialName, const std::string &parentMaterial)
 Add meta-information about material to database.
 
MaterialInfoadd (const std::string &materialName)
 Add meta-information about material to database.
 
plask::optional< MaterialInfoget (const std::string &materialName, bool with_inherited_info=true) const
 Get meta-information about material from database.
 
plask::optional< MaterialInfo::PropertyInfoget (const std::string &materialName, PROPERTY_NAME propertyName, bool with_inherited_info=true) const
 Get meta-information about material's property from database.
 
iterator begin ()
 Get begin iterator over materials' meta-information.
 
const_iterator begin () const
 Get const begin iterator over materials' meta-information.
 
iterator end ()
 Get end iterator over materials' meta-information.
 
const_iterator end () const
 Get const end iterator over materials' meta-information.
 

Static Public Member Functions

static DBgetDefault ()
 Get default database of materials' meta-information.
 

Detailed Description

Material info database.

Definition at line 326 of file info.hpp.

Member Typedef Documentation

◆ const_iterator

typedef std::map<std::string,MaterialInfo>::const_iterator plask::MaterialInfo::DB::const_iterator

const iterator over materials' meta-information

Definition at line 391 of file info.hpp.

◆ iterator

typedef std::map<std::string,MaterialInfo>::iterator plask::MaterialInfo::DB::iterator

iterator over materials' meta-information

Definition at line 388 of file info.hpp.

Member Function Documentation

◆ add() [1/2]

MaterialInfo & plask::MaterialInfo::DB::add ( const std::string &  materialName)

Add meta-information about material to database.

Parameters
materialNamename of material to add
Returns
material info object which allow to fill detailed information

Definition at line 220 of file info.cpp.

◆ add() [2/2]

MaterialInfo & plask::MaterialInfo::DB::add ( const std::string &  materialName,
const std::string &  parentMaterial 
)

Add meta-information about material to database.

Parameters
materialNamename of material to add
parentMaterialparent material, from which all properties all inherited (some may be overwritten)
Returns
material info object which allow to fill detailed information

Definition at line 214 of file info.cpp.

◆ begin() [1/2]

iterator plask::MaterialInfo::DB::begin ( )
inline

Get begin iterator over materials' meta-information.

Returns
begin iterator over materials' meta-information

Definition at line 397 of file info.hpp.

◆ begin() [2/2]

const_iterator plask::MaterialInfo::DB::begin ( ) const
inline

Get const begin iterator over materials' meta-information.

Returns
const begin iterator over materials' meta-information

Definition at line 403 of file info.hpp.

◆ clear()

void plask::MaterialInfo::DB::clear ( )
inline

Clear the database.

Definition at line 342 of file info.hpp.

◆ end() [1/2]

iterator plask::MaterialInfo::DB::end ( )
inline

Get end iterator over materials' meta-information.

Returns
end iterator over materials' meta-information

Definition at line 409 of file info.hpp.

◆ end() [2/2]

const_iterator plask::MaterialInfo::DB::end ( ) const
inline

Get const end iterator over materials' meta-information.

Returns
const end iterator over materials' meta-information

Definition at line 415 of file info.hpp.

◆ get() [1/2]

plask::optional< MaterialInfo > plask::MaterialInfo::DB::get ( const std::string &  materialName,
bool  with_inherited_info = true 
) const

Get meta-information about material from database.

Parameters
materialNamename of material to get information about
with_inherited_infoif true (default) returned object will consists also with information inherited from parent, grand-parent, etc. materials
Returns
meta-information about material with name materialName, no value if meta-information of requested material are not included in data-base

Definition at line 224 of file info.cpp.

◆ get() [2/2]

plask::optional< MaterialInfo::PropertyInfo > plask::MaterialInfo::DB::get ( const std::string &  materialName,
PROPERTY_NAME  propertyName,
bool  with_inherited_info = true 
) const

Get meta-information about material's property from database.

Parameters
materialName,propertyNamename of material and its property to get information about
with_inherited_infoif true (default) returned object will consists also with information inherited from parent, grand-parent, etc. materials
Returns
meta-information about material's property from database, no value if meta-information of requested material are not included in data-base

Definition at line 239 of file info.cpp.

◆ getDefault()

MaterialInfo::DB & plask::MaterialInfo::DB::getDefault ( )
static

Get default database of materials' meta-information.

Returns
default database of materials' meta-information

Definition at line 210 of file info.cpp.

◆ update()

void plask::MaterialInfo::DB::update ( const DB src)
inline

Update with values from different database.

Parameters
srcsource database

Definition at line 350 of file info.hpp.


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