Skip to main content

Common Fluids Format 2025 R2

ansys::Project::Metadata Class Reference

Last update: 16.07.2025

Dictionary of values associated with an Iterator. More...

#include "Metadata.hpp"

Public Member Functions

bool hasKey (const std::string) const
 
bool removeKey (const std::string)
 
bool isString (const std::string) const
 
bool isInt (const std::string) const
 
bool isDouble (const std::string) const
 
std::string getValue (const std::string) const
 
std::vector< std::string > getValueVector (const std::string) const
 
int getValueInt (const std::string) const
 
double getValueDouble (const std::string) const
 
MetaVariableType getValueType (const std::string) const
 
void setValue (const std::string &pKey, const std::string &pValue)
 
void setValueVector (const std::string &pKey, const std::vector< std::string > &pValue)
 
void setValue (const std::string &pKey, int pValue)
 
void setValue (const std::string &pKey, double pValue)
 
void setValueLink (const Iterator &pParent, const std::string &pKey, const Iterator &pTarget)
 
Iterator getValueLink (const Iterator &pParent, const std::string &pKey) const
 
bool isLink (const std::string &pKey) const
 
void copyAllTo (Metadata &pTarget) const
 
void copyValueTo (const std::string &pKey, Metadata &pTarget) const
 
std::vector< std::string > getKeys () const
 Return the list of variables in the metadata index. More...
 
void reset ()
 
 Metadata ()
 

Detailed Description

Dictionary of values associated with an Iterator.

The metadata index is mapping a variable name to a value and type. Each variable has a single type. The metadata of an Iterator is obtained through Iterator::getMeta() and can be accessed/modified as such

 it.getMeta().setValue("Temperature",288.)
   it.isDouble() == true
 double t = it.getMeta().getValueDouble("Temperature");
 it.getMeta().setValue("Temperature",288)
   it.isDouble() == false
   it.isInt() == false
 it.getMeta().setValue("Temperature","288")
   it.isString() == true

The metadata changes will be saved in the project index at the next Project::saveProject()

Constructor & Destructor Documentation

◆ Metadata()

ansys::Project::Metadata::Metadata ( )
inline

Member Function Documentation

◆ copyAllTo()

void ansys::Project::Metadata::copyAllTo ( Metadata pTarget) const

◆ copyValueTo()

void ansys::Project::Metadata::copyValueTo ( const std::string &  pKey,
Metadata pTarget 
) const

◆ getKeys()

std::vector< std::string > ansys::Project::Metadata::getKeys ( ) const

Return the list of variables in the metadata index.

◆ getValue()

std::string ansys::Project::Metadata::getValue ( const std::string  pKey) const

◆ getValueDouble()

double ansys::Project::Metadata::getValueDouble ( const std::string  pKey) const

◆ getValueInt()

int ansys::Project::Metadata::getValueInt ( const std::string  pKey) const

◆ getValueLink()

Iterator ansys::Project::Metadata::getValueLink ( const Iterator pParent,
const std::string &  pKey 
) const

◆ getValueType()

MetaVariableType ansys::Project::Metadata::getValueType ( const std::string  pKey) const

◆ getValueVector()

std::vector< std::string > ansys::Project::Metadata::getValueVector ( const std::string  pKey) const

◆ hasKey()

bool ansys::Project::Metadata::hasKey ( const std::string  pKey) const

◆ isDouble()

bool ansys::Project::Metadata::isDouble ( const std::string  pKey) const

◆ isInt()

bool ansys::Project::Metadata::isInt ( const std::string  pKey) const

◆ isLink()

bool ansys::Project::Metadata::isLink ( const std::string &  pKey) const

◆ isString()

bool ansys::Project::Metadata::isString ( const std::string  pKey) const

◆ removeKey()

bool ansys::Project::Metadata::removeKey ( const std::string  pKey)

◆ reset()

void ansys::Project::Metadata::reset ( )

◆ setValue() [1/3]

void ansys::Project::Metadata::setValue ( const std::string &  pKey,
const std::string &  pValue 
)

◆ setValue() [2/3]

void ansys::Project::Metadata::setValue ( const std::string &  pKey,
double  pValue 
)

◆ setValue() [3/3]

void ansys::Project::Metadata::setValue ( const std::string &  pKey,
int  pValue 
)

◆ setValueLink()

void ansys::Project::Metadata::setValueLink ( const Iterator pParent,
const std::string &  pKey,
const Iterator pTarget 
)

◆ setValueVector()

void ansys::Project::Metadata::setValueVector ( const std::string &  pKey,
const std::vector< std::string > &  pValue 
)

Connect with Ansys