stk::ProductRegistry Class Reference

#include <ProductRegistry.hpp>

List of all members.


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 30 of file ProductRegistry.hpp.

Public Types

typedef std::map< std::string,
std::string > 
AttributeMap
 Map of attribute keyword to value.
typedef std::map< std::string,
AttributeMap
ProductMap
 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.
bool isRegistryOK ()
 Member function isRegistryOK returns true if the registry has not been flagged as having an error via setRegistryInvalid.
const std::string & getProductName () const
 Member function getProductName returns the product name.
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.
AttributeMapaddProduct (const std::string &name)
 Member function addProduct adds a product to the registry.
AttributeMapaddTPL (const std::string &name, const std::string &version, const std::string &qualifier="")
 Member function addTPL adds a product to the registry.
AttributeMapaddRegion (const std::string &name)
 Member function addRegion add a region as a product to the registry.
AttributeMapgetProductAttributeMap (const std::string &name)
 Member function getProduct returns a reference to the product attribute map.
const std::string & getProductAttribute (const std::string &name, const std::string &attribute) const
 Member function getAttribute returns the attribute for the named product.
std::string & getProductAttribute (const std::string &name, const std::string &attribute)
 Member function getAttribute returns the attribute for the named product.
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.

Static Public Member Functions

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

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.


Member Function Documentation

ProductRegistry & stk::ProductRegistry::instance (  )  [static]

Member function instance returns a reference to the registry singleton.

Returns:
a ProductRegistry reference to the registry singleton

Definition at line 60 of file ProductRegistry.cpp.

const char * stk::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 69 of file ProductRegistry.cpp.

void stk::ProductRegistry::setRegistryInvalid (  )  [inline]

Member function setRegistryInvalid marks th registry as contain a conflict of some sort.

The ERROR attribute of each product describes each error.

Definition at line 76 of file ProductRegistry.hpp.

bool stk::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 87 of file ProductRegistry.hpp.

const std::string& stk::ProductRegistry::getProductName (  )  const [inline]

Member function getProductName returns the product name.

Returns:
a string const reference to the product name.

Definition at line 96 of file ProductRegistry.hpp.

ProductMap& stk::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 114 of file ProductRegistry.hpp.

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

Member function addProduct adds a product to the registry.

Parameters:
name a 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 112 of file ProductRegistry.cpp.

ProductRegistry::AttributeMap & stk::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:
name a std::string const reference to the product's name.
version a std::string const reference to the product's version string.
qualifier a 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 80 of file ProductRegistry.cpp.

ProductRegistry::AttributeMap & stk::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:
name a 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 125 of file ProductRegistry.cpp.

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

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

Parameters:
name a 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 137 of file ProductRegistry.cpp.

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

Member function getAttribute returns the attribute for the named product.

Parameters:
name a std::string const reference to the product's name.
attribute a 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 145 of file ProductRegistry.cpp.

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

Member function getAttribute returns the attribute for the named product.

Parameters:
name a std::string const reference to the product's name.
attribute a 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 154 of file ProductRegistry.cpp.

void stk::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:
name a std::string const reference to the product's name.
attribute a std::string const reference to the product's attribute keyword.
value a std::string const reference to the value of product's attribute.

Definition at line 163 of file ProductRegistry.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7