1.1.0
CCC
 
NamingConvention Class Reference

#include <NamingConvention.hpp>

Inheritance diagram for NamingConvention:
AStringable

Public Member Functions

 NamingConvention (String prefix="", bool flag_varname=true, bool flag_qualifier=true, bool flag_locator=true, const ELoc &locatorOutType=ELoc::fromKey("Z"), String delim=".", bool cleanSameLocator=true)
 
 NamingConvention (const NamingConvention &m)
 
NamingConventionoperator= (const NamingConvention &m)
 
virtual ~NamingConvention ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 AStringable Interface. More...
 
void setNamesAndLocators (Db *dbout, int iattout_start, const String &qualifier="", int nitems=1, bool flagSetLocator=true, int locatorShift=0) const
 
void setNamesAndLocators (const VectorString &names, Db *dbout, int iattout_start, const String &qualifier="", int nitems=1, bool flagSetLocator=true, int locatorShift=0) const
 
void setNamesAndLocators (Db *dbout, int iattout_start, const VectorString &names, bool flagSetLocator=true, int locatorShift=0) const
 
void setNamesAndLocators (const String &namin, Db *dbout, int iattout_start, const String &qualifier="", int nitems=1, bool flagSetLocator=true, int locatorShift=0) const
 
void setNamesAndLocators (const Db *dbin, const VectorString &names, const ELoc &locatorInType, int nvar, Db *dbout, int iattout_start, const String &qualifier="", int nitems=1, bool flagSetLocator=true, int locatorShift=0) const
 
void setNamesAndLocators (const Db *dbin, const VectorInt &iatts, Db *dbout, int iattout_start, const String &qualifier="", int nitems=1, bool flagSetLocator=true, int locatorShift=0) const
 
void setNamesAndLocators (const Db *dbin, int iatt, Db *dbout, int iattout_start, const String &qualifier="", int nitems=1, bool flagSetLocator=true, int locatorShift=0) const
 
void setDelim (const String &delim)
 
void setLocatorOutType (const ELoc &l)
 
void setPrefix (const String &prefix)
 
void setFlagClean (bool cleanSameLocator)
 
void setLocators (Db *dbout, int iattout_start, int nvar, int nitems=1, int locatorShift=0) const
 
bool isFlagQualifier () const
 
bool isFlagVarname () const
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 

Static Public Member Functions

static NamingConventioncreate (String prefix="", bool flag_varname=true, bool flag_qualifier=true, bool flag_locator=true, const ELoc &locatorOutType=ELoc::fromKey("Z"), String delim=".", bool cleanSameLocator=true)
 

Detailed Description

Naming Convention facility This class describes the way variables created within the current procedure will be named afterwards and will possibly be assigned a locator.

The generic name is generated as follows: 'prefix'.'varname'.'qualifier'.'rank'

  • prefix: string provided in the constructor of this class
  • varname: name of the (input) variable on which the procedure is performed
  • qualifier: type of element stored in the variable
  • rank: rank of the output variable (if several variables of the same type are generated)

The choice of the 'prefix' is done by the user when launching the procedure the other parameters are usually defined within the procedure.

For example, when running 'kriging' function with several variables defined in the input Db - say "Pb" abd "Zn" (they are assigned a Z-locator), using the following command: kriging( ... namconv = NamingConvention("MyPrefix") )

Then the kriging procedure generates variables such as:

  • MyPrefix.Pb.estim (estimation of Pb by CoKriging)
  • MyPrefix.Zn.estim (estimation of Zn by CoKriging)
  • MyPrefix.Pb.stdev (St. Dev. of estimation error of Pb by CoKriging)
  • MyPrefix.Zn.stdev (St. Dev. of estimation error of Zn by CoKriging)

Then the non-conditional simulation procedure generates variables such as:

  • MyPrefix.1 (for first simulation)
  • MyPrefix.2 (for second simulation) ...

    Then the conditional simulation procedure generates variables such as:

  • MyPrefix.var.1 (for first simulation)
  • MyPrefix.var.2 (for second simulation) ...

Ultimately, the newly created variables are assigned a locator.

Constructor & Destructor Documentation

NamingConvention::NamingConvention ( String  prefix = "",
bool  flag_varname = true,
bool  flag_qualifier = true,
bool  flag_locator = true,
const ELoc &  locatorOutType = ELoc::fromKey("Z"),
String  delim = ".",
bool  cleanSameLocator = true 
)
NamingConvention::NamingConvention ( const NamingConvention m)
NamingConvention::~NamingConvention ( )
virtual

Member Function Documentation

NamingConvention * NamingConvention::create ( String  prefix = "",
bool  flag_varname = true,
bool  flag_qualifier = true,
bool  flag_locator = true,
const ELoc &  locatorOutType = ELoc::fromKey("Z"),
String  delim = ".",
bool  cleanSameLocator = true 
)
static

Construct an item of the Naming Convention Class

Parameters
prefixName given to the prefix
flag_varnameWhen TRUE, the 'varname' is included in the output names
flag_qualifierWhen TRUE, the 'qualifier' is included in the output names
flag_locatorWhen TRUE, the output variables receive a 'locator'
locatorOutTypeType of locator assigned to the output variables
delimSymbol used as a delimitor separating the different parts of the output names
cleanSameLocatorWhen TRUE and if 'flag_locator' is TRUE, all variables assigned to the same locator are cancelled beforehand
Returns
bool NamingConvention::isFlagQualifier ( ) const
inline
bool NamingConvention::isFlagVarname ( ) const
inline
NamingConvention & NamingConvention::operator= ( const NamingConvention m)
void NamingConvention::setDelim ( const String delim)
inline
void NamingConvention::setFlagClean ( bool  cleanSameLocator)
inline
void NamingConvention::setLocatorOutType ( const ELoc &  l)
inline
void NamingConvention::setLocators ( Db dbout,
int  iattout_start,
int  nvar,
int  nitems = 1,
int  locatorShift = 0 
) const
void NamingConvention::setNamesAndLocators ( Db dbout,
int  iattout_start,
const String qualifier = "",
int  nitems = 1,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follows:

'prefix'.'qualifier'.'item_rank'

Parameters
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setNamesAndLocators ( const VectorString names,
Db dbout,
int  iattout_start,
const String qualifier = "",
int  nitems = 1,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follows:

'prefix'.'names[i]'.qualifier'.'item_rank'

Parameters
namesVector of variable names
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setNamesAndLocators ( Db dbout,
int  iattout_start,
const VectorString names,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follows:

"names[i]"

Parameters
dboutPointer to the output Db
iattout_startStarting attribute index
namesVector of output variable names
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setNamesAndLocators ( const String namin,
Db dbout,
int  iattout_start,
const String qualifier = "",
int  nitems = 1,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'namin'.'qualifier'.'item_rank'

Parameters
naminvariable name
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setNamesAndLocators ( const Db dbin,
const VectorString names,
const ELoc &  locatorInType,
int  nvar,
Db dbout,
int  iattout_start,
const String qualifier = "",
int  nitems = 1,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'name'.'qualifier'.'item_rank'

where 'name' stands for the name of the variable(s) in 'names' or, if absent, the name of the variable with locator 'Loc' in 'dbin'

Parameters
dbinPointer to the input Db (kept for symmetry)
namesVector of names (from 'dbin'). If not defined, use the locator instead
locatorInTypeLocator Type of the variables in Input Db
nvarNumber of items belonging to the locatorType (if -1, all the items available for this locator are used)
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setNamesAndLocators ( const Db dbin,
const VectorInt iatts,
Db dbout,
int  iattout_start,
const String qualifier = "",
int  nitems = 1,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'v[i]'.'qualifier'.'item_rank'

where v[i] is the variable with rank 'i' within 'dbin'

Parameters
dbinPointer to the input Db (kept for symmetry)
iattsVector of attribute indices of the variables in Input Db
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setNamesAndLocators ( const Db dbin,
int  iatt,
Db dbout,
int  iattout_start,
const String qualifier = "",
int  nitems = 1,
bool  flagSetLocator = true,
int  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'v[iatt]'.'qualifier'.'item_rank'

Parameters
dbinPointer to the input Db (kept for symmetry)
iattAttribute index of the variables in Input Db
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined
void NamingConvention::setPrefix ( const String prefix)
inline
String NamingConvention::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

AStringable Interface.

Reimplemented from AStringable.


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