Workspace 6.21.5
Public Member Functions | List of all members
Memento::NoData Class Reference

Trivial class for when no memento data is needed or when memento construction fails. More...

#include <Workspace/Application/LanguageUtils/memento.h>

Inheritance diagram for Memento::NoData:
[legend]

Public Member Functions

bool isValid () const override
 
- Public Member Functions inherited from Memento::Data
virtual ~Data ()=default
 
virtual bool isValid () const
 

Additional Inherited Members

- Protected Member Functions inherited from Memento::Data
 Data ()=default
 

Detailed Description

This class returns false from its isValid() function so that clients can detect when a Memento is not valid. What "not valid" means is partly context-dependent. Normally, it means either that no memento data is needed and the caller should know this, or it means that the creation of a memento failed so the memento creator returned a NoData memento instead. In the latter case, the memento creator needs to be able to detect a NoData memento being passed to it, almost always by checking the value returned by isValid().

Member Function Documentation

◆ isValid()

bool isValid ( ) const
inlineoverridevirtual
Returns
False unconditionally. This is the whole reason for this class.

Reimplemented from Memento::Data.