If there is something wrong with a GlobalObjects database, or if it needs to be handled otherwise, the object of this class is the right place to go.
Here you can repair and copy over.
More...
#include <GloBaseFitter.h>
|
| BaseFitter (const BaseFitter &rT) |
|
| BaseFitter (Manager &rGloManager) |
|
virtual | ~BaseFitter () |
|
int | checkAttributeDirectorys (std::vector< AttributeID > &rMissingAttributeDirectorieVector, const SchemaInterface &rSchemaInterface, int iActions) |
|
int | checkTables (std::vector< std::tuple< unsigned long, unsigned int, std::string > > &rMissingTableClassIDVector, const SchemaInterface &rSchemaInterface, int iActions) |
|
int | compressBase (const SchemaInterface &rSchemaInterface, int iActions) |
|
BaseFitter & | operator= (const BaseFitter &rT) |
|
int | reindexBase (const SchemaInterface &rSchemaInterface, int iActions) |
|
int | repairAttributeDirectorys (const SchemaInterface &rSchemaInterface, int iActions, std::ofstream &rLogFileStream) |
|
int | repairTables (const SchemaInterface &rSchemaInterface, int iActions, std::ofstream &rLogFileStream) |
|
If there is something wrong with a GlobalObjects database, or if it needs to be handled otherwise, the object of this class is the right place to go.
Here you can repair and copy over.
- Attention
- Objects of this class are ONLY intended for the Manager.
- Author
- Helmut Jakoby
- Copyright
- © 2010 Helmut Jakoby
◆ BaseFitter() [1/3]
glo::BaseFitter::BaseFitter |
( |
| ) |
|
|
protected |
The standard constructor is not available.
◆ BaseFitter() [2/3]
glo::BaseFitter::BaseFitter |
( |
Manager & | rGloManager | ) |
|
Constructor with parameter passing.
- Parameters
-
[in] | rGloManager | Can be notified (WatchNotify). |
- Attention
- The passed Manager must not be removed from memory before an object of this class!
◆ BaseFitter() [3/3]
glo::BaseFitter::BaseFitter |
( |
const BaseFitter & | rT | ) |
|
Copy constructor.
- Parameters
-
[in] | rT | The data is copied from this object. |
◆ ~BaseFitter()
virtual glo::BaseFitter::~BaseFitter |
( |
| ) |
|
|
virtual |
◆ checkAttributeDirectorys()
int glo::BaseFitter::checkAttributeDirectorys |
( |
std::vector< AttributeID > & | rMissingAttributeDirectorieVector, |
|
|
const SchemaInterface & | rSchemaInterface, |
|
|
int | iActions ) |
It is checked whether the subdirectories of the attributes (which are stored there) of all classes from the passed SchemaInterface exist.
- Parameters
-
[in,out] | rMissingAttributeDirectorieVector | Vector with objects of type AttributeID whose attribute directories do not exist. |
[in] | rSchemaInterface | The schema interface represents the database and provides the path to the tables. |
[in] | iActions | If >= 0 is passed, this value is used as the total number of actions for Notify. If < 0, in this method the value is set to "Number of all classes". |
- Returns
- A return value < 0 indicates an error.
- Attention
- The desired will only succeed if the database is not opened by any instance.
Without previous connection (see also Base::connect() ) the method fails.
◆ checkTable()
int glo::BaseFitter::checkTable |
( |
std::vector< std::tuple< unsigned long, unsigned int, std::string > > & | rMissingTableClassIDVector, |
|
|
const SchemaInterface & | rSchemaInterface, |
|
|
ClassInfo & | rClassInfo ) |
|
protected |
It is checked whether the table of the transferred ClassInfo from transferred SchemaInterface exists and whether all fields are contained.
- Parameters
-
[in,out] | rMissingTableClassIDVector | Vector mit ClassIDs (unsigned long), deren Tabellen nicht in Ordnung ist und einem Integer (unsigned int), der bei 0 bedeutet, dass die Tabelle nicht vorhanden ist oder 1, wenn die Tabelle nicht die erwarteten Attribute aufweist. Wenn 2. Wert == 1, dann sind im 3. Wert (std::string) die aktuellen, nicht erwarteten Attribute getrennt durch g_cTableColumnDelimiter. |
[in] | rSchemaInterface | Das SchemaInterface repräsentiert die Datenbank und liefert den Pfad zu den Tabellen. |
[in] | rClassInfo | The class information with its attribute information. |
- Returns
- A return value < 0 indicates an error.
- Attention
- Without previous connection (see also Base::connect() ) the method fails.
◆ checkTables()
int glo::BaseFitter::checkTables |
( |
std::vector< std::tuple< unsigned long, unsigned int, std::string > > & | rMissingTableClassIDVector, |
|
|
const SchemaInterface & | rSchemaInterface, |
|
|
int | iActions ) |
It is checked whether the tables of all classes from the transferred SchemaInterface exist and whether all fields are contained.
- Parameters
-
[in,out] | rMissingTableClassIDVector | Vector with ClassIDs (unsigned long), whose tables are not ok and an integer (unsigned int), which means at 0 that the table does not exist or 1, if the table does not have the expected attributes. If 2nd value == 1, then the 3rd value (std::string) contains the current, not expected attributes separated by g_cTableColumnDelimiter. |
[in] | rSchemaInterface | The schema interface represents the database and provides the path to the tables. |
[in] | iActions | If >= 0 is passed, this value is used as the total number of actions for Notify. If < 0, in this method the value is set to "Number of all classes". |
- Returns
- A return value < 0 indicates an error.
- Attention
- The desired will only succeed if the database is not opened by any instance.
Without previous connection (see also Base::connect() ) the method fails.
◆ compressBase()
int glo::BaseFitter::compressBase |
( |
const SchemaInterface & | rSchemaInterface, |
|
|
int | iActions ) |
The database, represented by the passed SchemaInterface, is compressed.
- Parameters
-
[in] | rSchemaInterface | The schema interface represents the database and provides the path to the tables. |
[in] | iActions | If >= 0 is passed, this value is used as total action number for Notify. If < 0, the value is set to "Number of all classes" in this method. |
- Returns
- A return value < 0 indicates an error.
- Attention
- The database is NOT reindexed respectively the existing indexes are corrupted. The method reindexBase (...) must be executed subsequently.
-
The desired will only succeed if the database is not opened by any instance.
Without previous connection (see also Base::connect() ) the method fails.
◆ compressTable()
int glo::BaseFitter::compressTable |
( |
std::string | sTableName, |
|
|
int | iActions ) |
|
protected |
The table with the transferred full file name is compressed.
- Parameters
-
[in] | sTableName | The full file name of the table to be compressed (e.g. "D:/Bases/MyFirstBase"). |
[in] | iActions | If > 0, this value is used as the total action number for Notify. |
- Returns
- A return < 0 indicates an error.
- Note
- This method works without index. If finished without error, the index is NOT adjusted.
◆ operator=()
Assignment operator.
- Parameters
-
[in] | rT | The data is transferred from this object. |
◆ reindexBase()
int glo::BaseFitter::reindexBase |
( |
const SchemaInterface & | rSchemaInterface, |
|
|
int | iActions ) |
It will reindex the database represented by the passed SchemaInterface.
- Parameters
-
[in] | rSchemaInterface | The schema interface represents the database and provides the path to the tables. |
[in] | iActions | If >= 0 is passed, this value is used as total action number for Notify. If < 0, the value is set to the following value in this method:
-
All entries of each table are read and created into the Fdx- or Odx-indexes in memory -> number of classes in the schema.
-
All string indexes are determined and created in memory -> number of sdx indexes of all classes in the schema.
-
The Fdx and Odx files are written individually -> number of classes in the schema * 2.
-
String index files are written -> Number of sdx indexes of all classes in the schema.
|
- Returns
- A return value < 0 indicates an error.
- Attention
- The desired will only succeed if the database is not opened by any instance.
Without previous connection (see also Base::connect() ) the method fails.
- See also
- OrderMsg::eREINDEX_BASE
◆ repairAttributeDirectorys()
int glo::BaseFitter::repairAttributeDirectorys |
( |
const SchemaInterface & | rSchemaInterface, |
|
|
int | iActions, |
|
|
std::ofstream & | rLogFileStream ) |
The subdirectories of the attributes, which are located there, of all classes are created from passed SchemaInterface, if not already existing.
- Parameters
-
[in] | rSchemaInterface | The schema interface represents the database and provides the path to the tables. |
[in] | iActions | If >= 0 is passed, this value is used as the total number of actions for Notify. If < 0 is passed, the value is set to "Number of all classes" in this method. |
[in] | rLogFileStream | If a table is newly created or adapted, this is documented in the log file. |
- Returns
- A return value < 0 indicates an error.
- Attention
- The desired will only succeed if the database is not opened by any instance.
Without previous connection (see also Base::connect() ) the method fails.
◆ repairTables()
int glo::BaseFitter::repairTables |
( |
const SchemaInterface & | rSchemaInterface, |
|
|
int | iActions, |
|
|
std::ofstream & | rLogFileStream ) |
The tables of all classes from the passed SchemaInterface are created, if not already existing. If it exists, the system checks whether the fields in the tables are consistent and adjusts them if necessary; this only affects the table column (1st line) and not any existing object entries.
- Parameters
-
[in] | rSchemaInterface | The schema interface represents the database and provides the path to the tables. |
[in] | iActions | If >= 0 is passed, this value is used as the total number of actions for Notify. If < 0 is passed, the value is set to "Number of all classes" in this method. |
[in] | rLogFileStream | If a table is newly created or adapted, this is documented in the log file. |
- Returns
- A return value < 0 indicates an error.
- Attention
- The desired will only succeed if the database is not opened by any instance.
Without previous connection (see also Base::connect() ) the method fails.
◆ m_pGloManager
Manager* glo::BaseFitter::m_pGloManager |
|
private |
For notification the Manager is necessary.
The documentation for this class was generated from the following file: