NeoPZ
|
Implements an interface to check the consistency of two implementations. Utility. More...
#include <pzcheckconsistency.h>
Public Member Functions | |
TPZCheckConsistency (const std::string &filename) | |
Constructor indicating the root filename. More... | |
void | SetOverWrite (bool flag=true) |
Set the overwrite flag. More... | |
void | SetReadMode () |
Set the read mode. No write. More... | |
void | SetWriteMode () |
Set the write mode. More... | |
bool | CheckObject (TPZSavable &obj) |
Reads or writes depending on the compiler directive. More... | |
Private Attributes | |
int | fCounter |
A counter which will be used to compose the file name. More... | |
std::string | fPath |
Path where the file will be stored. If CHECKPATH is defined then this will be used as the file path, else the current directory will be the path. More... | |
std::string | fFileName |
base file name. This name has to be unique to avoid overwrites More... | |
bool | fOverWrite |
Boolean indicating whether the objects should be overwritten or not. More... | |
bool | fWriteFlag |
Boolean indicating whether the object will write the objects to disk or read them. More... | |
Implements an interface to check the consistency of two implementations. Utility.
Definition at line 17 of file pzcheckconsistency.h.
TPZCheckConsistency::TPZCheckConsistency | ( | const std::string & | filename | ) |
Constructor indicating the root filename.
constructor indicating the root filename
Definition at line 14 of file pzcheckconsistency.cpp.
References fCounter, fFileName, stats::filename, fOverWrite, fPath, and fWriteFlag.
bool TPZCheckConsistency::CheckObject | ( | TPZSavable & | obj | ) |
Reads or writes depending on the compiler directive.
this method goes reads or writes depending on the compiler directive
when writing the method will write a binary copy of the object to a binary file
when reading the method will read an object from the binary file and compare both copies
when writing the method will write a binary copy of the object to a binary file when reading the method will read an object from the binary file and compare both copies
Definition at line 43 of file pzcheckconsistency.cpp.
References TPZPersistenceManagerNS::binary, TPZPersistenceManager::CloseWrite(), TPZSavable::Compare(), fCounter, fFileName, fOverWrite, fPath, fWriteFlag, TPZPersistenceManager::OpenRead(), TPZPersistenceManager::OpenWrite(), TPZPersistenceManager::ReadFromFile(), and TPZPersistenceManager::WriteToFile().
Referenced by SetWriteMode().
void TPZCheckConsistency::SetOverWrite | ( | bool | flag = true | ) |
Set the overwrite flag.
set the overwrite flag
Definition at line 34 of file pzcheckconsistency.cpp.
References fOverWrite.
|
inline |
Set the read mode. No write.
Definition at line 46 of file pzcheckconsistency.h.
|
inline |
Set the write mode.
Definition at line 51 of file pzcheckconsistency.h.
References CheckObject(), and test::obj.
|
private |
A counter which will be used to compose the file name.
Definition at line 20 of file pzcheckconsistency.h.
Referenced by CheckObject(), and TPZCheckConsistency().
|
private |
base file name. This name has to be unique to avoid overwrites
Definition at line 27 of file pzcheckconsistency.h.
Referenced by CheckObject(), and TPZCheckConsistency().
|
private |
Boolean indicating whether the objects should be overwritten or not.
This flag is set to false by default
Definition at line 30 of file pzcheckconsistency.h.
Referenced by CheckObject(), SetOverWrite(), and TPZCheckConsistency().
|
private |
Path where the file will be stored. If CHECKPATH is defined then this will be used as the file path, else the current directory will be the path.
Definition at line 25 of file pzcheckconsistency.h.
Referenced by CheckObject(), and TPZCheckConsistency().
|
private |
Boolean indicating whether the object will write the objects to disk or read them.
The value of this variable is set default to true or false depending on the compiler directive READCHECK or WRITECHECK
Definition at line 36 of file pzcheckconsistency.h.
Referenced by CheckObject(), and TPZCheckConsistency().