44 bool load(std::istream& is)
override;
52 bool save(std::ostream& os)
override;
107 void variableEventHandler(
EEvent event,
const Variable& call_var,
Variable& link_var,
bool same_inst)
override;
116 void storeConfig(
bool save);
141 std::vector<Variable::id_type> _ids;
154 void updateConversion();
161 bool convertVariable(
const Variable& var)
const;
167 void variableEventHandler(
EEvent event,
const Variable& call_var,
Variable& link_var,
bool same_inst)
override;
177 bool _enabled{
false};
185 std::vector<std::unique_ptr<Entry>> _entries;
189 std::map<Variable::id_type, Entry*> _map;
Extended UnitConversionServer with master and slaved variables.
Definition UnitConversionServerEx.h:16
void flush()
Flushes all conversion lists from this container.
void setUnitSystem(int us) override
Overridden from base class to intercept a change.
void setEnable(bool enable)
Enables or disables the conversion on Variables that are following the master.
bool handler(UnitConversionEvent &ev) override
Overridden from base class to intercept conversion failure.
~UnitConversionServerEx() override
Destructor.
void reinitialize()
Generates a lookup table and resets the existing conversion values.
void convertVariable(const Variable &var, bool regular=false)
Converts this variable when a slave using the masters value.
bool load(std::istream &is) override
Load the conversion configuration.
bool save(std::ostream &os) override
Load the conversion configuration.
UnitConversionServerEx()
Default constructor.
void setAskHandler(const UnitConversionServerClosure &closure=UnitConversionServerClosure())
Assigns a handler for when a conversion is not provided. Calling this method with default arguments d...
static const char * getFollowersSectionName()
Gets the name of the followers section.
id_type getEnableId() const
Gets the enabled variable ID.
void setEnableId(id_type)
Sets the enabled variable ID.
Implementation of a unit conversion server using an ini-file. This conversion class installs a handle...
Definition UnitConversionServer.h:16
Base class used for giving a Variable instance access to a member functions of a derived class....
Definition VariableHandler.h:14
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
#define _GII_CLASS
Definition gii/global.h:38
Definition Application.h:10
Structure passed to handle unit conversions.
Definition UnitConversion.h:14