Sierra Toolkit  Version of the Day
stk_classic::ProductRegistry Class Reference

Class ProductRegistry maps product names and attributes to brief descriptive values. Each added product has at a minimum the NAME value initialized. A region type product also has the PRODUCT_TYPE set to PRODUCT_TYPE_REGION. More...

#include <ProductRegistry.hpp>

Public Types

typedef std::map< std::string, std::string > AttributeMap
 Map of attribute keyword to value.
 
typedef std::map< std::string, AttributeMapProductMap
 Map of product name to attribute map.
 

Public Member Functions

void setRegistryInvalid ()
 Member function setRegistryInvalid marks th registry as contain a conflict of some sort. The ERROR attribute of each product describes each error.
 
bool isRegistryOK ()
 Member function isRegistryOK returns true if the registry has not been flagged as having an error via setRegistryInvalid. More...
 
const std::string & getProductName () const
 Member function getProductName returns the product name. More...
 
void setProductName (const std::string &product_name)
 Member function setProductName sets the product name.
 
ProductMapgetProductMap () const
 Member function getProductMap returns a reference to the map of all products. More...
 
AttributeMapaddProduct (const std::string &name)
 Member function addProduct adds a product to the registry. More...
 
AttributeMapaddTPL (const std::string &name, const std::string &version, const std::string &qualifier="")
 Member function addTPL adds a product to the registry. A product always has the VERSION and QUALIFIER attributes set. More...
 
AttributeMapaddRegion (const std::string &name)
 Member function addRegion add a region as a product to the registry. A region product is a product with the PRODUCT_TYPE set to PRODUCT_TYPE_REGION. More...
 
AttributeMapgetProductAttributeMap (const std::string &name)
 Member function getProduct returns a reference to the product attribute map. More...
 
const std::string & getProductAttribute (const std::string &name, const std::string &attribute) const
 Member function getAttribute returns the attribute for the named product. More...
 
std::string & getProductAttribute (const std::string &name, const std::string &attribute)
 Member function getAttribute returns the attribute for the named product. More...
 
void setProductAttribute (const std::string &name, const std::string &attribute, const std::string &value)
 Member function setAttribute sets the attribute for the named poduct to the specified value. More...
 

Static Public Member Functions

static ProductRegistryinstance ()
 Member function instance returns a reference to the registry singleton. More...
 
static const char * version ()
 Member function version returns the version number of the combined product. More...
 

Static Public Attributes

static const std::string NAME = "Name"
 Product's name attribute.
 
static const std::string TITLE = "Title"
 Product's title attribute.
 
static const std::string VERSION = "Version"
 TPL's version attribute.
 
static const std::string QUALIFIER = "Qualifier"
 TPL's qualifier attribute.
 
static const std::string CONTACT = "Contact"
 Product's contact attribute.
 
static const std::string ERROR = "Error"
 Product's error attribute.
 
static const std::string PRODUCT_TYPE = "Type"
 Product's product_type attribute.
 
static const std::string EXECUTABLE = "Executable"
 Product's executable attribute.
 
static const std::string BUILD_TIME = "Build Time"
 Product's build_time attribute.
 
static const std::string BANNER_DETAIL = "Banner Detail"
 Product's additional banner info attribute.
 
static const std::string COPYRIGHT = "Copyright"
 Product's copyright information.
 
static const std::string REGION_TITLE = "Region Title"
 Product's region_title attribute.
 
static const std::string PRODUCT_TYPE_REGION = "Region"
 Region product_type value.
 

Detailed Description

Class ProductRegistry maps product names and attributes to brief descriptive values. Each added product has at a minimum the NAME value initialized. A region type product also has the PRODUCT_TYPE set to PRODUCT_TYPE_REGION.

A product may have any other attribute keyword and value assocaited with it. In particular, the main execution product often has the /EXECUTABLE_FILE and BUILD_TIME attributes set.

You may add any other attribute keyword and values to the product registry.

Definition at line 55 of file ProductRegistry.hpp.

Member Function Documentation

◆ instance()

ProductRegistry & stk_classic::ProductRegistry::instance ( )
static

Member function instance returns a reference to the registry singleton.

Returns
a ProductRegistry reference to the registry singleton

Definition at line 85 of file ProductRegistry.cpp.

◆ version()

const char * stk_classic::ProductRegistry::version ( )
static

Member function version returns the version number of the combined product.

Returns
a ProductRegistry reference to the registry singleton

Definition at line 94 of file ProductRegistry.cpp.

◆ isRegistryOK()

bool stk_classic::ProductRegistry::isRegistryOK ( )
inline

Member function isRegistryOK returns true if the registry has not been flagged as having an error via setRegistryInvalid.

Returns
a bool value of true of the registry has no conflicts.

Definition at line 112 of file ProductRegistry.hpp.

◆ getProductName()

const std::string& stk_classic::ProductRegistry::getProductName ( ) const
inline

Member function getProductName returns the product name.

Returns
a string const reference to the product name.

Definition at line 121 of file ProductRegistry.hpp.

◆ getProductMap()

ProductMap& stk_classic::ProductRegistry::getProductMap ( ) const
inline

Member function getProductMap returns a reference to the map of all products.

Returns
a ProductMap reference to the product map.

Definition at line 139 of file ProductRegistry.hpp.

◆ addProduct()

ProductRegistry::AttributeMap & stk_classic::ProductRegistry::addProduct ( const std::string &  name)

Member function addProduct adds a product to the registry.

Parameters
namea std::string const reference to the product's name.
Returns
an AttributeMap reference to the attribute map of the newly added product.

Definition at line 137 of file ProductRegistry.cpp.

◆ addTPL()

ProductRegistry::AttributeMap & stk_classic::ProductRegistry::addTPL ( const std::string &  name,
const std::string &  version,
const std::string &  qualifier = "" 
)

Member function addTPL adds a product to the registry. A product always has the VERSION and QUALIFIER attributes set.

Parameters
namea std::string const reference to the product's name.
versiona std::string const reference to the product's version string.
qualifiera std::string const reference to the product's qualifier string.
Returns
an AttributeMap reference to the attribute map of the newly added product.

Definition at line 105 of file ProductRegistry.cpp.

◆ addRegion()

ProductRegistry::AttributeMap & stk_classic::ProductRegistry::addRegion ( const std::string &  name)

Member function addRegion add a region as a product to the registry. A region product is a product with the PRODUCT_TYPE set to PRODUCT_TYPE_REGION.

Parameters
namea std::string const reference to the product's name.
Returns
an AttributeMap reference to the attribute map of the newly added region product.

Definition at line 150 of file ProductRegistry.cpp.

◆ getProductAttributeMap()

ProductRegistry::AttributeMap & stk_classic::ProductRegistry::getProductAttributeMap ( const std::string &  name)

Member function getProduct returns a reference to the product attribute map.

Parameters
namea std::string const reference to the product's name.
Returns
an AttributeMap reference to the attribute map of the newly added region product.

Definition at line 162 of file ProductRegistry.cpp.

◆ getProductAttribute() [1/2]

const std::string & stk_classic::ProductRegistry::getProductAttribute ( const std::string &  name,
const std::string &  attribute 
) const

Member function getAttribute returns the attribute for the named product.

Parameters
namea std::string const reference to the product's name.
attributea std::string const reference to the product's attribute keyword.
Returns
a std::string const reference to the value of product's attribute.

Definition at line 170 of file ProductRegistry.cpp.

◆ getProductAttribute() [2/2]

std::string & stk_classic::ProductRegistry::getProductAttribute ( const std::string &  name,
const std::string &  attribute 
)

Member function getAttribute returns the attribute for the named product.

Parameters
namea std::string const reference to the product's name.
attributea std::string const reference to the product's attribute keyword.
Returns
a std::string const reference to the value of product's attribute.

Definition at line 179 of file ProductRegistry.cpp.

◆ setProductAttribute()

void stk_classic::ProductRegistry::setProductAttribute ( const std::string &  name,
const std::string &  attribute,
const std::string &  value 
)

Member function setAttribute sets the attribute for the named poduct to the specified value.

Parameters
namea std::string const reference to the product's name.
attributea std::string const reference to the product's attribute keyword.
valuea std::string const reference to the value of product's attribute.

Definition at line 188 of file ProductRegistry.cpp.


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