feisty meow concerns codebase  2.140
configuration::system_values Class Reference

This class provides a way to look up generated values used in the code base. More...

#include <system_values.h>

Inheritance diagram for configuration::system_values:
Collaboration diagram for configuration::system_values:

Public Member Functions

 system_values (const basis::astring &section_tag)
 provides a lookup on values found in the section named "section_tag". More...
 
virtual ~system_values ()
 
 DEFINE_CLASS_NAME ("system_values")
 
bool use_other_manifest (const basis::astring &manifest_file)
 supports using a different manifest file than the default. More...
 
virtual basis::astring text_form () const
 shows all items in the table. More...
 
bool lookup (int value, basis::astring &symbolic_name, basis::astring &description, basis::astring &file_location)
 locates a "value" and finds its name, description and location. More...
 
bool lookup (const basis::astring &symbolic_name, int &value, basis::astring &description, basis::astring &file_location)
 similar to the above lookup, but seeks on the "symbolic_name". More...
 
int elements () const
 returns how many items are listed for the types of values specified. More...
 
bool get (int index, basis::astring &symbolic_name, int &value, basis::astring &description, basis::astring &file_location)
 accesses the "index"th item in the list. More...
 

Static Public Member Functions

static const char * OUTCOME_VALUES ()
 values that define the outcomes of operations. More...
 
static const char * FILTER_VALUES ()
 values that define filters used in logging. More...
 
static const char * EVENT_VALUES ()
 values that define event objects used in the program. More...
 

Static Public Attributes

static const char * DEFAULT_MANIFEST = "manifest.txt"
 the default manifest file. More...
 

Detailed Description

This class provides a way to look up generated values used in the code base.

The type of value here includes outcomes, events and filters so far. These items are reported in the build manifest that is included with every release of the compiled software. The system_values class provides a lookup interface to the extensible system of unique identifiers which is mapped by the manifest file. The manifest file is processed like an initialization file to retrieve the descriptions and names of symbols when given their numerical identifiers.

Definition at line 38 of file system_values.h.

Constructor & Destructor Documentation

◆ system_values()

configuration::system_values::system_values ( const basis::astring section_tag)

provides a lookup on values found in the section named "section_tag".

the "section_tag" indicates what kind of asset is being looked up in the manifest. it is always assumed that the manifest file is the main one defined here in DEFAULT_MANIFEST. it must be a file created by the value_tagger during the indexing of all value assets defined in the build. the valid values for the section names so far are "DEFINE_ OUTCOME", "DEFINE_ FILTER" and "DEFINE_ EVENT" (with no spaces), but it is better to use the defined "VALUES" methods below (such as OUTCOME_VALUES()). outcomes are used by functions to describe how the operation completed. filters are used to enable different types of logging. events are sent between information source and sink to indicate the occurrence of an activity.

Definition at line 82 of file system_values.cpp.

References FUNCDEF.

◆ ~system_values()

configuration::system_values::~system_values ( )
virtual

Definition at line 91 of file system_values.cpp.

References basis::WHACK().

Member Function Documentation

◆ DEFINE_CLASS_NAME()

configuration::system_values::DEFINE_CLASS_NAME ( "system_values"  )

◆ elements()

int configuration::system_values::elements ( ) const

returns how many items are listed for the types of values specified.

Definition at line 195 of file system_values.cpp.

◆ EVENT_VALUES()

const char * configuration::system_values::EVENT_VALUES ( )
static

values that define event objects used in the program.

Definition at line 112 of file system_values.cpp.

◆ FILTER_VALUES()

const char * configuration::system_values::FILTER_VALUES ( )
static

values that define filters used in logging.

Definition at line 110 of file system_values.cpp.

◆ get()

bool configuration::system_values::get ( int  index,
basis::astring symbolic_name,
int &  value,
basis::astring description,
basis::astring file_location 
)

accesses the "index"th item in the list.

Definition at line 197 of file system_values.cpp.

References bounds_return, and lookup().

◆ lookup() [1/2]

bool configuration::system_values::lookup ( const basis::astring symbolic_name,
int &  value,
basis::astring description,
basis::astring file_location 
)

similar to the above lookup, but seeks on the "symbolic_name".

this lookup tries to associate from the textual name of the value in order to find the integer actual "value" of it. the textual "description" and "file_location" for that item are also included.

Definition at line 185 of file system_values.cpp.

◆ lookup() [2/2]

bool configuration::system_values::lookup ( int  value,
basis::astring symbolic_name,
basis::astring description,
basis::astring file_location 
)

locates a "value" and finds its name, description and location.

this looks up one of the enumerated values defined for our type of value. true is returned if the value is meaningful. the "symbolic_name" is set to the item's name as used inside the source code (i.e., its enum member's name), the "description" is set to the full textual description of what that value means, and the "file_location" is set to the name of the source file that defines the value.

Definition at line 174 of file system_values.cpp.

Referenced by get().

◆ OUTCOME_VALUES()

const char * configuration::system_values::OUTCOME_VALUES ( )
static

values that define the outcomes of operations.

Definition at line 108 of file system_values.cpp.

◆ text_form()

astring configuration::system_values::text_form ( ) const
virtual

◆ use_other_manifest()

bool configuration::system_values::use_other_manifest ( const basis::astring manifest_file)

supports using a different manifest file than the default.

the values will now come from the "manifest_file" instead of the default manifest name shipped with the software release.

Definition at line 102 of file system_values.cpp.

Member Data Documentation

◆ DEFAULT_MANIFEST

const char * configuration::system_values::DEFAULT_MANIFEST = "manifest.txt"
static

the default manifest file.

it is expected to live in the folder where the applications are.

Definition at line 70 of file system_values.h.


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