Libpf::Persistency::TypeDescriptor Struct Reference

To define the characteristics of a type before a Case of such type is instantiated. More...

#include <TypeDescriptor.h>

Public Member Functions

 TypeDescriptor (std::string name, std::string description, std::string category, bool instantiatable, const std::vector< IntegerOption > &integerOptions, const std::vector< StringOption > &stringOptions, const std::vector< QuantityOption > &quantityOptions, std::string icon)
 
 TypeDescriptor (Libpf::Persistency::TypeDescriptor const &)
 
 ~TypeDescriptor (void)
 
void addIntegerOption (const IntegerOption &option)
 
void addStringOption (const StringOption &option)
 
void addQuantityOption (const QuantityOption &option)
 
std::string json (void) const
 
bool hasIntegerOption (const std::string &name)
 
bool hasStringOption (const std::string &name)
 
const IntegerOptionintegerOption (const std::string &name)
 
const StringOptionstringOption (const std::string &name)
 

Public Attributes

std::string name_
 UTF-8 encoded string; acts as URN in the type: namespace. More...
 
std::string description_
 UTF-8 encoded string. More...
 
std::string category_
 UTF-8 encoded string, one of: stream, unit, flowsheet or option. More...
 
bool instantiatable_
 bool true if type is instantiable More...
 
std::vector< IntegerOptionintegerOptions_
 supported integer options More...
 
std::vector< StringOptionstringOptions_
 supported string options More...
 
std::vector< QuantityOptionquantityOptions_
 supported quantity options More...
 
std::string icon_
 UTF-8 encoded string with the icon name, without extension. More...
 

Detailed Description

To define the characteristics of a type before a Case of such type is instantiated.

See also
IntegerOption, StringOption

Constructor & Destructor Documentation

◆ TypeDescriptor() [1/2]

Libpf::Persistency::TypeDescriptor::TypeDescriptor ( std::string  name,
std::string  description,
std::string  category,
bool  instantiatable,
const std::vector< IntegerOption > &  integerOptions,
const std::vector< StringOption > &  stringOptions,
const std::vector< QuantityOption > &  quantityOptions,
std::string  icon 
)

◆ TypeDescriptor() [2/2]

Libpf::Persistency::TypeDescriptor::TypeDescriptor ( Libpf::Persistency::TypeDescriptor const &  )

◆ ~TypeDescriptor()

Libpf::Persistency::TypeDescriptor::~TypeDescriptor ( void  )

Member Function Documentation

◆ addIntegerOption()

void Libpf::Persistency::TypeDescriptor::addIntegerOption ( const IntegerOption option)

◆ addQuantityOption()

void Libpf::Persistency::TypeDescriptor::addQuantityOption ( const QuantityOption option)

◆ addStringOption()

void Libpf::Persistency::TypeDescriptor::addStringOption ( const StringOption option)

◆ hasIntegerOption()

bool Libpf::Persistency::TypeDescriptor::hasIntegerOption ( const std::string &  name)
Returns
true if an integer option with the supplied name is available

◆ hasStringOption()

bool Libpf::Persistency::TypeDescriptor::hasStringOption ( const std::string &  name)
Returns
true if a string option with the supplied name is available

◆ integerOption()

const IntegerOption & Libpf::Persistency::TypeDescriptor::integerOption ( const std::string &  name)
Returns
the integer option with the supplied name
Exceptions
ErrorRunTimeif the option is not available

◆ json()

std::string Libpf::Persistency::TypeDescriptor::json ( void  ) const
Returns
UTF-8 encoded string with the JSON-serialized object

◆ stringOption()

const StringOption & Libpf::Persistency::TypeDescriptor::stringOption ( const std::string &  name)
Returns
the string option with the supplied name
Exceptions
ErrorRunTimeif the option is not available

Member Data Documentation

◆ category_

std::string Libpf::Persistency::TypeDescriptor::category_

UTF-8 encoded string, one of: stream, unit, flowsheet or option.

◆ description_

std::string Libpf::Persistency::TypeDescriptor::description_

UTF-8 encoded string.

◆ icon_

std::string Libpf::Persistency::TypeDescriptor::icon_

UTF-8 encoded string with the icon name, without extension.

◆ instantiatable_

bool Libpf::Persistency::TypeDescriptor::instantiatable_

bool true if type is instantiable

◆ integerOptions_

std::vector<IntegerOption> Libpf::Persistency::TypeDescriptor::integerOptions_

supported integer options

◆ name_

std::string Libpf::Persistency::TypeDescriptor::name_

UTF-8 encoded string; acts as URN in the type: namespace.

◆ quantityOptions_

std::vector<QuantityOption> Libpf::Persistency::TypeDescriptor::quantityOptions_

supported quantity options

◆ stringOptions_

std::vector<StringOption> Libpf::Persistency::TypeDescriptor::stringOptions_

supported string options


The documentation for this struct was generated from the following file: