Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::CustomFields Class Referencefinal

#include <CustomFields.h>

Inheritance diagram for sf::CustomFields:
Collaboration diagram for sf::CustomFields:

Public Member Functions

 CustomFields (PartInspection *pi, const std::string &prefix, id_type id_offset, id_type id_range)
 Initializing constructor.
 
 ~CustomFields () override
 Virtual overridden destructor.
 
bool setExport (bool exported)
 Sets the variables to be exported.
 
bool isExported () const
 Checks if variables are exported.
 
bool isComplete () const
 Checks if during the last reading of values some are not filled in. This is always the case with new inspection or when a configuration has changed.
 
void setComplete (bool yn)
 Set or resets the complete flag.
 
int getCount () const
 Returns the amount of entries.
 
void swap (int index1, int index2)
 Swaps two entries.
 
void add ()
 Adds an empty entry to the list.
 
void add (const std::string &name, const std::string &setup)
 Adds an entry to the list.
 
void clear ()
 Flushes the list.
 
std::string getName (int index) const
 Returns the name of the field.
 
std::string getSetup (int index) const
 Returns the setup of the variable.
 
void storeConfig (IniProfile *ini, bool rd)
 Stores the configuration from the given profile.
 
void storeConfig (bool rd)
 Stores the configuration from the default module profile.
 
bool storeValues (bool rd)
 Write the custom values to the inspection file.
 
void setDefaults ()
 Gets the filed values to their default value.
 
bool isDirty () const
 Checks if a value was modified.
 
void setDirty (bool dirty)
 Sets or resets the dirty flag.
 
void getStrings (KeyValues &list)
 Gets the configuration in strings.
 
void setStrings (const KeyValues &list)
 Sets the configuration from strings.
 
- Public Member Functions inherited from sf::VariableHandler
virtual ~VariableHandler ()
 Destructor clears the link with variable instances so no errors occur when the link is destructed before the variable is.
 

Protected Member Functions

void variableEventHandler (EEvent event, const Variable &caller, Variable &link, bool same_inst) override
 Handler for the variables.
 
bool sustain (const timespec &ts)
 HAndler called by the sustain hook.
 

Additional Inherited Members

- Public Types inherited from sf::VariableTypes
enum  EEvent : int {
  veConvert = 64000 , veNewId = -32000 , veUserGlobal , veFirstLocal = 0 ,
  veFlagsChange = 1 , veValueChange = 2 , veInvalid = 3 , veConverted = 4 ,
  veUserLocal = 5 , veFirstPrivate = 16000 , veIdChanged = 16001 , veDesiredId = 16002 ,
  veRemove = 16003 , veGetOwner = 16004 , veLostOwner = 16005 , veLinked = 16006 ,
  veUnlinked = 16007 , veSetup = 16008 , veUserPrivate = 16009
}
 Events send to the handler set with sf::Variable::setHandler. More...
 
enum  EField : int {
  vfId = 0 , vfName , vfUnit , vfFlags ,
  vfDescription , vfType , vfConversionType , vfRound ,
  vfDefault , vfMinimum , vfMaximum , vfFirstState
}
 Enumeration of the order of fields in the setup string. More...
 
enum  EFlag : flags_type {
  flgReadonly = 1 << 0 , flgArchive = 1 << 1 , flgShare = 1 << 2 , flgLink = 1 << 3 ,
  flgFunction = 1 << 4 , flgParameter = 1 << 5 , flgHidden = 1 << 6 , flgExport = 1 << 7 ,
  flgWriteable = 1 << 8
}
 Enumeration type for specifying flags. More...
 
enum  EStringType : int {
  stNormal = 0 , stMulti , stPath , stDirectory ,
  stFilename , stSubdirectory
}
 Enumeration of string types used for filtering. More...
 
typedef TVector< Variable * > PtrVector
 Vector for pointers to variables.
 
typedef TVector< VariableVector
 Vector for instances of variables.
 
typedef TVector< VariableReference * > ReferenceVector
 Types for internal use.
 
- Public Types inherited from sf::InformationTypes
typedef unsigned long long id_type
 Type used for the identifying integer (64-bits).
 
typedef int32_t flags_type
 Type used for the flag integer.
 
typedef size_t size_type
 Type used for size of vectors.
 
typedef ssize_t ssize_type
 Same as size_type but a signed version.
 
typedef uintptr_t data_type
 Type used for containing a single data element which is the largest integer.
 
typedef intptr_t sdata_type
 Type used for containing a single data element which is the largest signed integer.
 
typedef TVector< id_typeIdVector
 Vector for lists of information ID's.
 
typedef TVector< InformationBase * > Vector
 Vector for containing different information base derived classes.
 
- Static Public Member Functions inherited from sf::InformationTypes
template<typename T >
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)), data_typetoDataType (T value)
 Casts any type to a data_type value.
 
template<typename T >
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)||std::is_reference_v< T >), T > fromDataType (data_type value)
 Casts a data_type value to a given type. Reference types are also possible since they are the same size as a pointer underwater.
 
- Static Public Attributes inherited from sf::InformationTypes
static constexpr size_t npos = std::numeric_limits<size_type>::max()
 Unsigned size value indicating not found or no index.
 

Constructor & Destructor Documentation

◆ CustomFields()

sf::CustomFields::CustomFields ( PartInspection pi,
const std::string &  prefix,
id_type  id_offset,
id_type  id_range 
)

Initializing constructor.

◆ ~CustomFields()

sf::CustomFields::~CustomFields ( )
override

Virtual overridden destructor.

Member Function Documentation

◆ add() [1/2]

void sf::CustomFields::add ( )

Adds an empty entry to the list.

◆ add() [2/2]

void sf::CustomFields::add ( const std::string &  name,
const std::string &  setup 
)

Adds an entry to the list.

◆ clear()

void sf::CustomFields::clear ( )

Flushes the list.

◆ getCount()

int sf::CustomFields::getCount ( ) const

Returns the amount of entries.

◆ getName()

std::string sf::CustomFields::getName ( int  index) const

Returns the name of the field.

◆ getSetup()

std::string sf::CustomFields::getSetup ( int  index) const

Returns the setup of the variable.

◆ getStrings()

void sf::CustomFields::getStrings ( KeyValues list)

Gets the configuration in strings.

◆ isComplete()

bool sf::CustomFields::isComplete ( ) const

Checks if during the last reading of values some are not filled in. This is always the case with new inspection or when a configuration has changed.

◆ isDirty()

bool sf::CustomFields::isDirty ( ) const

Checks if a value was modified.

◆ isExported()

bool sf::CustomFields::isExported ( ) const

Checks if variables are exported.

◆ setComplete()

void sf::CustomFields::setComplete ( bool  yn)

Set or resets the complete flag.

◆ setDefaults()

void sf::CustomFields::setDefaults ( )

Gets the filed values to their default value.

◆ setDirty()

void sf::CustomFields::setDirty ( bool  dirty)

Sets or resets the dirty flag.

◆ setExport()

bool sf::CustomFields::setExport ( bool  exported)

Sets the variables to be exported.

◆ setStrings()

void sf::CustomFields::setStrings ( const KeyValues list)

Sets the configuration from strings.

◆ storeConfig() [1/2]

void sf::CustomFields::storeConfig ( bool  rd)

Stores the configuration from the default module profile.

◆ storeConfig() [2/2]

void sf::CustomFields::storeConfig ( IniProfile ini,
bool  rd 
)

Stores the configuration from the given profile.

◆ storeValues()

bool sf::CustomFields::storeValues ( bool  rd)

Write the custom values to the inspection file.

◆ sustain()

bool sf::CustomFields::sustain ( const timespec &  ts)
protected

HAndler called by the sustain hook.

◆ swap()

void sf::CustomFields::swap ( int  index1,
int  index2 
)

Swaps two entries.

◆ variableEventHandler()

void sf::CustomFields::variableEventHandler ( EEvent  event,
const Variable caller,
Variable link,
bool  same_inst 
)
overrideprotectedvirtual

Handler for the variables.

Implements sf::VariableHandler.


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