An instance of a model - knows about variables, can be calculated and can export data to various formats. More...
#include <Case.h>
Public Types | |
| enum | ErrorCode { ERROR_OK = 0 , ERROR_INVALID = -81 , ERROR_COMMUNICATION = -82 , ERROR_ARGUMENT = -83 , ERROR_SERVER = -84 } |
Public Member Functions | |
| Case (const Handle &handle) | |
| Establishes a connection to the case. More... | |
| ~Case (void) | |
| destructor More... | |
| int | setTag (const char *tag) |
| change the tag of the instance More... | |
| int | setDescription (const char *desc) |
| change the description of the instance More... | |
| int | abort (void) |
| interrupts the current calculation, sensitivity or homotopy More... | |
| int | calculate (void) |
| asynchronously calculate the case; emits a number of calculateRunning signals and the calculateFinish signal on finishing More... | |
| int | calculateSync (void) |
| synchronously calculate the case More... | |
| int | check (void) |
| internal utility function More... | |
| int | sensitivity (const SensitivityInput &sensitivityInput) |
| asynchronously performs sensitivity calculation emits N times (with N = the number of rows in the sensitivity) the intermediateSensitivityResults signal and the sensitivityFinish signal on finishing More... | |
| int | sensitivity (const std::string &jsonSensitivityInput) |
| asynchronously perform sensitivity calculation emits N times (with N = the number of rows in the sensitivity) the intermediateSensitivityResults signal and the sensitivityFinish signal on finishing More... | |
| SensitivityResult | sensitivitySync (const SensitivityInput &sensitivityInput, int &error) |
| synchronously perform sensitivity calculation More... | |
| std::string | sensitivitySync (const std::string &jsonSensitivityInput, int &error) |
| synchronously perform sensitivity calculation More... | |
| int | homotopy (const HomotopyInput &homotopyInput) |
| asynchronously perform homotopy calculation emits a number of homotopyRunning signals and the homotopyFinish signal on finishing More... | |
| int | homotopy (const std::string &jsonHomotopyInput) |
| asynchronously perform homotopy calculation emits a number of homotopyRunning signals and the homotopyFinish signal on finishing More... | |
| int | homotopySync (const HomotopyInput &homotopyInput) |
| synchronously perform homotopy calculation More... | |
| int | homotopySync (const std::string &jsonHomotopyInput) |
| synchronously perform homotopy calculation More... | |
| double | get (const std::string &path, int &error) |
| get quantity More... | |
| double | get (const std::string &path, const std::string &unit, int &error) |
| get quantity in specified units More... | |
| int | getInteger (const std::string &path, int &error) |
| get integer More... | |
| std::string | getString (const std::string &path, int &error) |
| get string More... | |
| void | setCalculateRunningCallBack (CallBack *callBack) |
| sets the call back function to be repeatedly called during the execution of calculate More... | |
| void | setCalculateFinishCallBack (CallBack *callBack) |
| sets the call back function to be called at the end of the execution of calculate More... | |
| void | setIntermediateSensitivityResultsCallBack (CallBack *callBack) |
| sets the call back function to be repeatedly called during the execution of sensitivity More... | |
| void | setSensitivityFinishCallBack (CallBack *callBack) |
| sets the call back function to be called at the end of the execution of sensitivity More... | |
| void | setHomotopyRunningCallBack (CallBack *callBack) |
| sets the call back function to be repeatedly called during the execution of homotopy More... | |
| void | setHomotopyFinishCallBack (CallBack *callBack) |
| sets the call back function to be called at the end of the execution of homotopy More... | |
| int | exportDataBase (const std::string &sqliteFileName) const |
| export database snapshot of all data related to the case instance in sqlite3 format More... | |
| int | exportTxt (const std::string &txtFileName) const |
| export text file report of all data related to the case instance More... | |
| int | exportJson (const std::string &jsonFileName) const |
| export JSON file report of all data related to the case instance More... | |
| int | exportOds (const std::string &xmlFileName) const |
| export stream table in ODF format More... | |
| int | set (const HomotopyInput &homotopyInput) |
| set one or more quantities More... | |
| int | set (const std::string &jsonHomotopyInput) |
| set one or more quantities More... | |
| std::vector< std::string > | exportSvgs (const std::string &dir, bool tiny, int &error) |
| export all objects as SVGs More... | |
| int | exportXml (const std::string &dir) |
| export to XML: recursively print all Quantities, Strings and Integers to xml files in the directory dir More... | |
| int | setTest (void) |
| enable test features: additional diagnostic and solution verification More... | |
| int | setCheck (void) |
| enable check features: additional diagnostic and verbose recalculation can be used to perform a test on the restore-from-persistency functionality More... | |
| bool | isValid (void) const |
| server-side validation More... | |
| void * | model (void) |
| internal use only ! More... | |
Static Public Member Functions | |
| static std::string | errorMessage (int error) |
Detailed Description
An instance of a model - knows about variables, can be calculated and can export data to various formats.
Member Enumeration Documentation
◆ ErrorCode
| Enumerator | |
|---|---|
| ERROR_OK | no error |
| ERROR_INVALID | Case object is not in a valid state. |
| ERROR_COMMUNICATION | communication problem |
| ERROR_ARGUMENT | supplied argument is not valid |
| ERROR_SERVER | server-side error while performing the operation |
Constructor & Destructor Documentation
◆ Case()
| Libpf::User::Case::Case | ( | const Handle & | handle | ) |
Establishes a connection to the case.
- Parameters
-
[in] handle case handle
◆ ~Case()
| Libpf::User::Case::~Case | ( | void | ) |
destructor
Member Function Documentation
◆ abort()
| int Libpf::User::Case::abort | ( | void | ) |
interrupts the current calculation, sensitivity or homotopy
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_SERVER
◆ calculate()
| int Libpf::User::Case::calculate | ( | void | ) |
asynchronously calculate the case; emits a number of calculateRunning signals and the calculateFinish signal on finishing
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION
◆ calculateSync()
| int Libpf::User::Case::calculateSync | ( | void | ) |
synchronously calculate the case
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_SERVER
- See also
- calculate
◆ check()
| int Libpf::User::Case::check | ( | void | ) |
internal utility function
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_SERVER
◆ errorMessage()
|
static |
- Parameters
-
error one of the values of the Case::ErrorCode enum
- Returns
- the textual representation of the error
◆ exportDataBase()
| int Libpf::User::Case::exportDataBase | ( | const std::string & | sqliteFileName | ) | const |
export database snapshot of all data related to the case instance in sqlite3 format
- Parameters
-
sqliteFileName full path to the sqlite database binary format file that should be written; if the file exists, it will be overwritten
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
◆ exportJson()
| int Libpf::User::Case::exportJson | ( | const std::string & | jsonFileName | ) | const |
export JSON file report of all data related to the case instance
- Parameters
-
jsonFileName full path to the file that should be written; if the file exists, it will be overwritten
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
◆ exportOds()
| int Libpf::User::Case::exportOds | ( | const std::string & | xmlFileName | ) | const |
export stream table in ODF format
- Parameters
-
xmlFileName full path to the file that should be written; if the file exists, it will be overwritten
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
◆ exportSvgs()
| std::vector< std::string > Libpf::User::Case::exportSvgs | ( | const std::string & | dir, |
| bool | tiny, | ||
| int & | error | ||
| ) |
export all objects as SVGs
- Parameters
-
[in] dir the directory to save files to [in] tiny if true, print the layout to SVG Tiny 1.1 format, else to Full SVG 1.1 format [out] error one of ERROR_OK, ERROR_INVALID, ERROR_SERVER
- Returns
- the list of filenames
◆ exportTxt()
| int Libpf::User::Case::exportTxt | ( | const std::string & | txtFileName | ) | const |
export text file report of all data related to the case instance
- Parameters
-
txtFileName full path to the file that should be written; if the file exists, it will be overwritten
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
◆ exportXml()
| int Libpf::User::Case::exportXml | ( | const std::string & | dir | ) |
export to XML: recursively print all Quantities, Strings and Integers to xml files in the directory dir
- Parameters
-
dir the directory to save files to
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
◆ get() [1/2]
| double Libpf::User::Case::get | ( | const std::string & | path, |
| const std::string & | unit, | ||
| int & | error | ||
| ) |
get quantity in specified units
- Parameters
-
[in] path the string full path to the variable, i.e. S01:Tphase.ndot [in] units the string units of measurements [out] error one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Returns
- the current value in the reqested units
◆ get() [2/2]
| double Libpf::User::Case::get | ( | const std::string & | path, |
| int & | error | ||
| ) |
get quantity
- Parameters
-
[in] path the string full path to the variable, i.e. S01:Tphase.ndot [out] error one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Returns
- the current value in SI units
◆ getInteger()
| int Libpf::User::Case::getInteger | ( | const std::string & | path, |
| int & | error | ||
| ) |
get integer
- Parameters
-
[in] path the string full path to the variable, i.e. S01:nErrors [out] error one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Returns
- the current value
◆ getString()
| std::string Libpf::User::Case::getString | ( | const std::string & | path, |
| int & | error | ||
| ) |
get string
- Parameters
-
[in] path the string full path to the variable, i.e. S01:errorMsg[0] [out] error one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Returns
- the current value
◆ homotopy() [1/2]
| int Libpf::User::Case::homotopy | ( | const HomotopyInput & | homotopyInput | ) |
asynchronously perform homotopy calculation emits a number of homotopyRunning signals and the homotopyFinish signal on finishing
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
◆ homotopy() [2/2]
| int Libpf::User::Case::homotopy | ( | const std::string & | jsonHomotopyInput | ) |
asynchronously perform homotopy calculation emits a number of homotopyRunning signals and the homotopyFinish signal on finishing
- Parameters
-
[in] jsonHomotopyInput UTF-8 encoded, JSON-serialized HomotopyInput object
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
◆ homotopySync() [1/2]
| int Libpf::User::Case::homotopySync | ( | const HomotopyInput & | homotopyInput | ) |
synchronously perform homotopy calculation
- Parameters
-
homotopyInput a data structure with the information on the changes to be applied
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- See also
- homotopy
◆ homotopySync() [2/2]
| int Libpf::User::Case::homotopySync | ( | const std::string & | jsonHomotopyInput | ) |
synchronously perform homotopy calculation
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- See also
- homotopy
◆ isValid()
| bool Libpf::User::Case::isValid | ( | void | ) | const |
server-side validation
◆ model()
| void * Libpf::User::Case::model | ( | void | ) |
internal use only !
◆ sensitivity() [1/2]
| int Libpf::User::Case::sensitivity | ( | const SensitivityInput & | sensitivityInput | ) |
asynchronously performs sensitivity calculation emits N times (with N = the number of rows in the sensitivity) the intermediateSensitivityResults signal and the sensitivityFinish signal on finishing
- Parameters
-
[in] sensitivityInput SensitivityInput object with the information on the sensitivity to perform
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
◆ sensitivity() [2/2]
| int Libpf::User::Case::sensitivity | ( | const std::string & | jsonSensitivityInput | ) |
asynchronously perform sensitivity calculation emits N times (with N = the number of rows in the sensitivity) the intermediateSensitivityResults signal and the sensitivityFinish signal on finishing
- Parameters
-
[in] jsonSensitivityInput UTF-8 encoded, JSON-serialized SensitivityInput object
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
◆ sensitivitySync() [1/2]
| SensitivityResult Libpf::User::Case::sensitivitySync | ( | const SensitivityInput & | sensitivityInput, |
| int & | error | ||
| ) |
synchronously perform sensitivity calculation
- Parameters
-
[in] sensitivityInput SensitivityInput object [out] error one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Returns
- SensitivityResult object
- See also
- sensitivity
◆ sensitivitySync() [2/2]
| std::string Libpf::User::Case::sensitivitySync | ( | const std::string & | jsonSensitivityInput, |
| int & | error | ||
| ) |
synchronously perform sensitivity calculation
- Parameters
-
[in] jsonSensitivityInput UTF-8 encoded, JSON-serialized SensitivityInput object [out] error one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Returns
- UTF-8 encoded, JSON-serialized SensitivityResult object
- See also
- sensitivity
◆ set() [1/2]
| int Libpf::User::Case::set | ( | const HomotopyInput & | homotopyInput | ) |
set one or more quantities
- Parameters
-
homotopyInput a data structure with the information on the changes to be applied
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
- Remarks
- not all fields must be filled in, basically what is required is the controlled array be non-empty and each element of the controlled array be a dictionary with at least two keys, value and end
◆ set() [2/2]
| int Libpf::User::Case::set | ( | const std::string & | jsonHomotopyInput | ) |
set one or more quantities
- Parameters
-
[in] jsonHomotopyInput UTF-8 encoded, JSON-serialized HomotopyInput object
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
- Remarks
- not all fields must be filled in, basically what is required is the controlled array be non-empty and each element of the controlled array be a dictionary with at least two keys, value and end
◆ setCalculateFinishCallBack()
| void Libpf::User::Case::setCalculateFinishCallBack | ( | CallBack * | callBack | ) |
sets the call back function to be called at the end of the execution of calculate
- Parameters
-
[in] callBack the pointer to the client-side callback implementation
◆ setCalculateRunningCallBack()
| void Libpf::User::Case::setCalculateRunningCallBack | ( | CallBack * | callBack | ) |
sets the call back function to be repeatedly called during the execution of calculate
- Parameters
-
[in] callBack the pointer to the client-side callback implementation
◆ setCheck()
| int Libpf::User::Case::setCheck | ( | void | ) |
enable check features: additional diagnostic and verbose recalculation can be used to perform a test on the restore-from-persistency functionality
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
◆ setDescription()
| int Libpf::User::Case::setDescription | ( | const char * | desc | ) |
change the description of the instance
- Parameters
-
[in] desc UTF-8 encoded string with the new description
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
◆ setHomotopyFinishCallBack()
| void Libpf::User::Case::setHomotopyFinishCallBack | ( | CallBack * | callBack | ) |
sets the call back function to be called at the end of the execution of homotopy
- Parameters
-
[in] callBack the pointer to the client-side callback implementation
◆ setHomotopyRunningCallBack()
| void Libpf::User::Case::setHomotopyRunningCallBack | ( | CallBack * | callBack | ) |
sets the call back function to be repeatedly called during the execution of homotopy
- Parameters
-
[in] callBack the pointer to the client-side callback implementation
◆ setIntermediateSensitivityResultsCallBack()
| void Libpf::User::Case::setIntermediateSensitivityResultsCallBack | ( | CallBack * | callBack | ) |
sets the call back function to be repeatedly called during the execution of sensitivity
- Parameters
-
[in] callBack the pointer to the client-side callback implementation
◆ setSensitivityFinishCallBack()
| void Libpf::User::Case::setSensitivityFinishCallBack | ( | CallBack * | callBack | ) |
sets the call back function to be called at the end of the execution of sensitivity
- Parameters
-
[in] callBack the pointer to the client-side callback implementation
◆ setTag()
| int Libpf::User::Case::setTag | ( | const char * | tag | ) |
change the tag of the instance
- Parameters
-
[in] tag UTF-8 encoded string with the new tag
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT, ERROR_SERVER
◆ setTest()
| int Libpf::User::Case::setTest | ( | void | ) |
enable test features: additional diagnostic and solution verification
- Returns
- one of ERROR_OK, ERROR_INVALID, ERROR_COMMUNICATION, ERROR_ARGUMENT
The documentation for this class was generated from the following file:
- libpf/user/Case.h