NeoPZ
Public Member Functions | Protected Attributes | List of all members
TPZGuiInterface Class Reference

This class implements a very simple interface from PZ kernel to GUI. Module: Common. More...

#include <TPZGuiInterface.h>

Inheritance diagram for TPZGuiInterface:
[legend]
Collaboration diagram for TPZGuiInterface:
[legend]

Public Member Functions

 TPZGuiInterface ()
 
virtual ~TPZGuiInterface ()
 
 TPZGuiInterface (const TPZGuiInterface &gui)
 
TPZGuiInterfaceoperator= (const TPZGuiInterface &gui)
 
int ClassId () const override
 Define the class id associated with the class. More...
 
void Read (TPZStream &buf, void *context) override
 read objects from the stream More...
 
void Write (TPZStream &buf, int withclassid) const override
 Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More...
 
virtual void Start ()
 
virtual void UpdateCaption ()
 
virtual void End ()
 
virtual void ShowErrorMessage (std::string message)
 
void SetKilled ()
 
bool AmIKilled ()
 
std::string Message ()
 
void SetMessage (const std::string &message)
 
int & ProgressBarPos ()
 
int & ProgressBarMaxPos ()
 
int & ProgressBarMinPos ()
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
virtual bool Compare (TPZSavable *copy, bool override=false)
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Protected Attributes

bool fCanceled
 
std::string fMessage
 
int fProgressBarPos
 
int fProgressBarMaxPos
 
int fProgressBarMinPos
 

Additional Inherited Members

- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 

Detailed Description

This class implements a very simple interface from PZ kernel to GUI. Module: Common.

Author
Tiago Forti
Since
2010, March 30 It implements for instance the capability of cancel the execution The GUI must define a derived class which reimplements the messages and update methods for better messages.

Definition at line 24 of file TPZGuiInterface.h.

Constructor & Destructor Documentation

◆ TPZGuiInterface() [1/2]

TPZGuiInterface::TPZGuiInterface ( )

Default constructor

Definition at line 12 of file TPZGuiInterface.cpp.

References fCanceled, fProgressBarMaxPos, fProgressBarMinPos, and fProgressBarPos.

◆ ~TPZGuiInterface()

TPZGuiInterface::~TPZGuiInterface ( )
virtual

Default destructor

Definition at line 20 of file TPZGuiInterface.cpp.

◆ TPZGuiInterface() [2/2]

TPZGuiInterface::TPZGuiInterface ( const TPZGuiInterface gui)
inline

Definition at line 45 of file TPZGuiInterface.h.

References DebugStop.

Member Function Documentation

◆ AmIKilled()

bool TPZGuiInterface::AmIKilled ( )

◆ ClassId()

int TPZGuiInterface::ClassId ( ) const
overridevirtual

Define the class id associated with the class.

This id has to be unique for all classes A non unique id is flagged at the startup of the program

Implements TPZSavable.

Definition at line 24 of file TPZGuiInterface.cpp.

References Hash().

Referenced by operator=().

◆ End()

void TPZGuiInterface::End ( )
virtual

Updates the GUI with ending messages
This method must be reimplemented in derived classes for better messages

Definition at line 70 of file TPZGuiInterface.cpp.

Referenced by operator=().

◆ Message()

std::string TPZGuiInterface::Message ( )

Message attribute for UpdateGUI method

Definition at line 54 of file TPZGuiInterface.cpp.

References fMessage.

Referenced by operator=().

◆ operator=()

TPZGuiInterface& TPZGuiInterface::operator= ( const TPZGuiInterface gui)
inline

◆ ProgressBarMaxPos()

int& TPZGuiInterface::ProgressBarMaxPos ( )
inline

Progress bar attributes for UpdateGUI method

Definition at line 102 of file TPZGuiInterface.h.

References fProgressBarMaxPos.

◆ ProgressBarMinPos()

int& TPZGuiInterface::ProgressBarMinPos ( )
inline

Progress bar attributes for UpdateGUI method

Definition at line 107 of file TPZGuiInterface.h.

References fProgressBarMinPos.

◆ ProgressBarPos()

int& TPZGuiInterface::ProgressBarPos ( )
inline

Progress bar attributes for UpdateGUI method

Definition at line 97 of file TPZGuiInterface.h.

References fProgressBarPos.

◆ Read()

void TPZGuiInterface::Read ( TPZStream buf,
void *  context 
)
overridevirtual

read objects from the stream

Reimplemented from TPZSavable.

Definition at line 28 of file TPZGuiInterface.cpp.

References fCanceled, fMessage, fProgressBarMaxPos, fProgressBarMinPos, fProgressBarPos, and TPZStream::Read().

Referenced by operator=().

◆ SetKilled()

void TPZGuiInterface::SetKilled ( )

Defines the process has been canceled

Definition at line 80 of file TPZGuiInterface.cpp.

References fCanceled.

Referenced by operator=().

◆ SetMessage()

void TPZGuiInterface::SetMessage ( const std::string &  message)

Change the message of the object

Definition at line 60 of file TPZGuiInterface.cpp.

References fMessage.

Referenced by operator=().

◆ ShowErrorMessage()

void TPZGuiInterface::ShowErrorMessage ( std::string  message)
virtual

Show an error message.
This method must be reimplemented in derived classes for better messages

Definition at line 74 of file TPZGuiInterface.cpp.

References PZError.

Referenced by operator=().

◆ Start()

void TPZGuiInterface::Start ( )
virtual

Updates the GUI with start messages
This method must be reimplemented in derived classes for better messages

Definition at line 66 of file TPZGuiInterface.cpp.

Referenced by operator=().

◆ UpdateCaption()

void TPZGuiInterface::UpdateCaption ( )
virtual

Updates the GUI
This method must be reimplemented in derived classes for better messages

Definition at line 44 of file TPZGuiInterface.cpp.

References fMessage, fProgressBarMaxPos, and fProgressBarPos.

Referenced by operator=().

◆ Write()

void TPZGuiInterface::Write ( TPZStream buf,
int  withclassid 
) const
overridevirtual

Writes this object to the TPZStream buffer. Include the classid if withclassid = true.

Writes this object to the TPZStream buffer. Include the classid if withclassid = true

Reimplemented from TPZSavable.

Definition at line 36 of file TPZGuiInterface.cpp.

References fCanceled, fMessage, fProgressBarMaxPos, fProgressBarMinPos, fProgressBarPos, and TPZStream::Write().

Referenced by operator=().

Member Data Documentation

◆ fCanceled

bool TPZGuiInterface::fCanceled
protected

Flag indicating if the thread is alive or if its canceling was requested

Definition at line 29 of file TPZGuiInterface.h.

Referenced by AmIKilled(), operator=(), Read(), SetKilled(), TPZGuiInterface(), and Write().

◆ fMessage

std::string TPZGuiInterface::fMessage
protected

Message attribute for UpdateGUI method

Definition at line 32 of file TPZGuiInterface.h.

Referenced by Message(), operator=(), Read(), SetMessage(), UpdateCaption(), and Write().

◆ fProgressBarMaxPos

int TPZGuiInterface::fProgressBarMaxPos
protected

◆ fProgressBarMinPos

int TPZGuiInterface::fProgressBarMinPos
protected

Definition at line 35 of file TPZGuiInterface.h.

Referenced by operator=(), ProgressBarMinPos(), Read(), TPZGuiInterface(), and Write().

◆ fProgressBarPos

int TPZGuiInterface::fProgressBarPos
protected

Progress bar attributes for UpdateGUI method

Definition at line 35 of file TPZGuiInterface.h.

Referenced by operator=(), ProgressBarPos(), Read(), TPZGuiInterface(), UpdateCaption(), and Write().


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