SPH
Classes | Public Types | Public Member Functions | List of all members
IVirtualEntry Class Referenceabstract

Represents a virtual entry in the settings. More...

#include <VirtualSettings.h>

Inheritance diagram for IVirtualEntry:
Polymorphic EntryControl IntervalEntry< TEnum > Detail::SettingsEntry< TValue, TEnum, TEnabler > Detail::SettingsEntry< Path, TEnum > Detail::SettingsEntry< TValue, TEnum, std::enable_if_t< FlagsTraits< TValue >::isFlags > > Detail::ValueEntry< TValue, typename > Detail::ValueEntry< TValue, std::enable_if_t< FlagsTraits< TValue >::isFlags > >

Classes

struct  FileFormat
 

Public Types

enum class  Type {
  BOOL , INT , FLOAT , VECTOR ,
  INTERVAL , STRING , PATH , ENUM ,
  EXTRA , FLAGS
}
 
enum class  PathType { DIRECTORY , INPUT_FILE , OUTPUT_FILE }
 
using Value = Variant< bool, int, Float, Vector, Interval, std::string, Path, EnumWrapper, ExtraEntry >
 

Public Member Functions

virtual bool enabled () const =0
 Returns if this entry is currently enabled. More...
 
virtual bool set (const Value &value)=0
 Modifies the current value of the entry. More...
 
virtual Value get () const =0
 Returns the currently stored value. More...
 
virtual bool isValid (const Value &value) const =0
 Checks if the given value is a valid input for this entry. More...
 
virtual Type getType () const =0
 Returns the type of this entry. More...
 
virtual std::string getName () const =0
 Returns a descriptive name of the entry. More...
 
virtual std::string getTooltip () const
 Returns an optional description of the entry. More...
 
virtual bool hasSideEffect () const
 Returns true if the entry can modify multiple values simultaneously. More...
 
virtual Optional< PathTypegetPathType () const
 Returns the type of the path. More...
 
virtual Array< FileFormatgetFileFormats () const
 Returns the allowed file format for this file entry. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Represents a virtual entry in the settings.

This entry may be connected to a single reference, an entry in Settings object or other user-defined value. It provides an abstraction through which state of jobs can be queried and modified.

Definition at line 64 of file VirtualSettings.h.

Member Typedef Documentation

◆ Value

Definition at line 68 of file VirtualSettings.h.

Member Enumeration Documentation

◆ PathType

Enumerator
DIRECTORY 
INPUT_FILE 
OUTPUT_FILE 

Definition at line 113 of file VirtualSettings.h.

◆ Type

enum IVirtualEntry::Type
strong
Enumerator
BOOL 
INT 
FLOAT 
VECTOR 
INTERVAL 
STRING 
PATH 
ENUM 
EXTRA 
FLAGS 

Definition at line 66 of file VirtualSettings.h.

Member Function Documentation

◆ enabled()

virtual bool IVirtualEntry::enabled ( ) const
pure virtual

Returns if this entry is currently enabled.

Implementation may return false if the entry does not have any effect for current setup of the job, for example if the entry is associated with a parameter of a solver which is not being used.

Implemented in EntryControl, and IntervalEntry< TEnum >.

◆ get()

virtual Value IVirtualEntry::get ( ) const
pure virtual

◆ getFileFormats()

virtual Array<FileFormat> IVirtualEntry::getFileFormats ( ) const
inlinevirtual

Returns the allowed file format for this file entry.

Used only for file entry (i.e. getPathType returns INPUT_FILE or OUTPUT_FILE). The returned array contains pairs of the file format description and the corresponding extension (i.e. 'txt').

Reimplemented in EntryControl.

Definition at line 135 of file VirtualSettings.h.

◆ getName()

virtual std::string IVirtualEntry::getName ( ) const
pure virtual

Returns a descriptive name of the entry.

This name is intended to be presented to the user (in UI, printed in log, etc.). It may be the same as the key associated with an entry, although the key is only used as an unique identifier and does not have to be human-readable.

Implemented in Detail::SettingsEntry< Path, TEnum >, Detail::SettingsEntry< TValue, TEnum, std::enable_if_t< FlagsTraits< TValue >::isFlags > >, Detail::SettingsEntry< TValue, TEnum, TEnabler >, Detail::ValueEntry< TValue, std::enable_if_t< FlagsTraits< TValue >::isFlags > >, Detail::ValueEntry< TValue, typename >, and IntervalEntry< TEnum >.

◆ getPathType()

virtual Optional<PathType> IVirtualEntry::getPathType ( ) const
inlinevirtual

Returns the type of the path.

Used only if type of the entry is PATH, otherwise returns NOTHING.

Reimplemented in EntryControl.

Definition at line 122 of file VirtualSettings.h.

◆ getTooltip()

virtual std::string IVirtualEntry::getTooltip ( ) const
inlinevirtual

Returns an optional description of the entry.

Reimplemented in EntryControl.

Definition at line 100 of file VirtualSettings.h.

◆ getType()

virtual Type IVirtualEntry::getType ( ) const
pure virtual

◆ hasSideEffect()

virtual bool IVirtualEntry::hasSideEffect ( ) const
inlinevirtual

Returns true if the entry can modify multiple values simultaneously.

Usually, there is a 1-1 correspondence between entries and values (stored either in Settings or directly in the job). However, an entry can modify other values as well, in which case it should signal this by returning true from this function.

Reimplemented in EntryControl.

Definition at line 109 of file VirtualSettings.h.

◆ isValid()

virtual bool IVirtualEntry::isValid ( const Value value) const
pure virtual

Checks if the given value is a valid input for this entry.

Implemented in EntryControl.

◆ set()

virtual bool IVirtualEntry::set ( const Value value)
pure virtual

Modifies the current value of the entry.

Function shall throw Exception (or derived type) if the type of the value differs from type of the entry.

Returns
True if the value was changed, false if it was rejected.

Implemented in IntervalEntry< TEnum >.


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