#include <NamingConvention.hpp>
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) | |
NamingConvention & | operator= (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) | |
AStringable & | operator= (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 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) |
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'
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:
Then the non-conditional simulation procedure generates variables such as:
MyPrefix.2 (for second simulation) ...
Then the conditional simulation procedure generates variables such as:
Ultimately, the newly created variables are assigned a locator.
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 | ) |
|
virtual |
|
static |
Construct an item of the Naming Convention Class
prefix | Name given to the prefix |
flag_varname | When TRUE, the 'varname' is included in the output names |
flag_qualifier | When TRUE, the 'qualifier' is included in the output names |
flag_locator | When TRUE, the output variables receive a 'locator' |
locatorOutType | Type of locator assigned to the output variables |
delim | Symbol used as a delimitor separating the different parts of the output names |
cleanSameLocator | When TRUE and if 'flag_locator' is TRUE, all variables assigned to the same locator are cancelled beforehand |
|
inline |
|
inline |
NamingConvention & NamingConvention::operator= | ( | const NamingConvention & | m | ) |
|
inline |
|
inline |
|
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'
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
qualifier | Optional qualifier |
nitems | Number of items |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift 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'
names | Vector of variable names |
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
qualifier | Optional qualifier |
nitems | Number of items |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift 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]"
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
names | Vector of output variable names |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift 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'
namin | variable name |
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
qualifier | Optional qualifier |
nitems | Number of items |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift 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'
dbin | Pointer to the input Db (kept for symmetry) |
names | Vector of names (from 'dbin'). If not defined, use the locator instead |
locatorInType | Locator Type of the variables in Input Db |
nvar | Number of items belonging to the locatorType (if -1, all the items available for this locator are used) |
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
qualifier | Optional qualifier |
nitems | Number of items |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift 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'
dbin | Pointer to the input Db (kept for symmetry) |
iatts | Vector of attribute indices of the variables in Input Db |
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
qualifier | Optional qualifier |
nitems | Number of items |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift 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'
dbin | Pointer to the input Db (kept for symmetry) |
iatt | Attribute index of the variables in Input Db |
dbout | Pointer to the output Db |
iattout_start | Starting attribute index |
qualifier | Optional qualifier |
nitems | Number of items |
flagSetLocator | True if the variable must be assigned the locator |
locatorShift | Shift to be applied to the locator currently defined |
|
inline |
|
overridevirtual |
AStringable Interface.
Reimplemented from AStringable.