Commit ca4da5bc authored by Nate Weibley's avatar Nate Weibley

Proper const correctness for Fact system read methods

parent a6da2b7d
......@@ -134,7 +134,7 @@ QString Fact::valueString(void) const
return _value.toString();
}
QVariant Fact::defaultValue(void)
QVariant Fact::defaultValue(void) const
{
if (_metaData) {
if (!_metaData->defaultValueAvailable()) {
......@@ -147,12 +147,12 @@ QVariant Fact::defaultValue(void)
}
}
FactMetaData::ValueType_t Fact::type(void)
FactMetaData::ValueType_t Fact::type(void) const
{
return _type;
}
QString Fact::shortDescription(void)
QString Fact::shortDescription(void) const
{
if (_metaData) {
return _metaData->shortDescription();
......@@ -162,7 +162,7 @@ QString Fact::shortDescription(void)
}
}
QString Fact::longDescription(void)
QString Fact::longDescription(void) const
{
if (_metaData) {
return _metaData->longDescription();
......@@ -172,7 +172,7 @@ QString Fact::longDescription(void)
}
}
QString Fact::units(void)
QString Fact::units(void) const
{
if (_metaData) {
return _metaData->units();
......@@ -182,7 +182,7 @@ QString Fact::units(void)
}
}
QVariant Fact::min(void)
QVariant Fact::min(void) const
{
if (_metaData) {
return _metaData->min();
......@@ -192,7 +192,7 @@ QVariant Fact::min(void)
}
}
QVariant Fact::max(void)
QVariant Fact::max(void) const
{
if (_metaData) {
return _metaData->max();
......@@ -202,7 +202,7 @@ QVariant Fact::max(void)
}
}
bool Fact::minIsDefaultForType(void)
bool Fact::minIsDefaultForType(void) const
{
if (_metaData) {
return _metaData->minIsDefaultForType();
......@@ -212,7 +212,7 @@ bool Fact::minIsDefaultForType(void)
}
}
bool Fact::maxIsDefaultForType(void)
bool Fact::maxIsDefaultForType(void) const
{
if (_metaData) {
return _metaData->maxIsDefaultForType();
......@@ -222,7 +222,7 @@ bool Fact::maxIsDefaultForType(void)
}
}
QString Fact::group(void)
QString Fact::group(void) const
{
if (_metaData) {
return _metaData->group();
......@@ -237,7 +237,7 @@ void Fact::setMetaData(FactMetaData* metaData)
_metaData = metaData;
}
bool Fact::valueEqualsDefault(void)
bool Fact::valueEqualsDefault(void) const
{
if (_metaData) {
if (_metaData->defaultValueAvailable()) {
......@@ -251,7 +251,7 @@ bool Fact::valueEqualsDefault(void)
}
}
bool Fact::defaultValueAvailable(void)
bool Fact::defaultValueAvailable(void) const
{
if (_metaData) {
return _metaData->defaultValueAvailable();
......
......@@ -74,18 +74,18 @@ public:
QVariant value(void) const;
QString valueString(void) const;
void setValue(const QVariant& value);
QVariant defaultValue(void);
bool defaultValueAvailable(void);
bool valueEqualsDefault(void);
FactMetaData::ValueType_t type(void);
QString shortDescription(void);
QString longDescription(void);
QString units(void);
QVariant min(void);
bool minIsDefaultForType(void);
QVariant max(void);
bool maxIsDefaultForType(void);
QString group(void);
QVariant defaultValue(void) const;
bool defaultValueAvailable(void) const;
bool valueEqualsDefault(void) const;
FactMetaData::ValueType_t type(void) const;
QString shortDescription(void) const;
QString longDescription(void) const;
QString units(void) const;
QVariant min(void) const;
bool minIsDefaultForType(void) const;
QVariant max(void) const;
bool maxIsDefaultForType(void) const;
QString group(void) const;
/// Sets and sends new value to vehicle even if value is the same
void forceSetValue(const QVariant& value);
......@@ -120,4 +120,4 @@ private:
FactMetaData* _metaData;
};
#endif
\ No newline at end of file
#endif
......@@ -80,7 +80,7 @@ const FactMetaData& FactMetaData::operator=(const FactMetaData& other)
return *this;
}
QVariant FactMetaData::defaultValue(void)
QVariant FactMetaData::defaultValue(void) const
{
if (_defaultValueAvailable) {
return _defaultValue;
......@@ -122,7 +122,7 @@ void FactMetaData::setMax(const QVariant& max)
}
}
QVariant FactMetaData::_minForType(void)
QVariant FactMetaData::_minForType(void) const
{
switch (_type) {
case valueTypeUint8:
......@@ -147,7 +147,7 @@ QVariant FactMetaData::_minForType(void)
return QVariant();
}
QVariant FactMetaData::_maxForType(void)
QVariant FactMetaData::_maxForType(void) const
{
switch (_type) {
case valueTypeUint8:
......
......@@ -57,28 +57,28 @@ public:
FactMetaData(const FactMetaData& other, QObject* parent = NULL);
const FactMetaData& operator=(const FactMetaData& other);
// Property accessors
QString name(void) { return _name; }
QString group(void) { return _group; }
ValueType_t type(void) { return _type; }
QVariant defaultValue(void);
bool defaultValueAvailable(void) { return _defaultValueAvailable; }
QString shortDescription(void) { return _shortDescription; }
QString longDescription(void) { return _longDescription;}
QString units(void) { return _units; }
QVariant min(void) { return _min; }
QVariant max(void) { return _max; }
bool minIsDefaultForType(void) { return _minIsDefaultForType; }
bool maxIsDefaultForType(void) { return _maxIsDefaultForType; }
// Property setters
// Property accessors
QString name(void) const { return _name; }
QString group(void) const { return _group; }
ValueType_t type(void) const { return _type; }
QVariant defaultValue(void) const;
bool defaultValueAvailable(void) const { return _defaultValueAvailable; }
QString shortDescription(void) const { return _shortDescription; }
QString longDescription(void) const { return _longDescription;}
QString units(void) const { return _units; }
QVariant min(void) const { return _min; }
QVariant max(void) const { return _max; }
bool minIsDefaultForType(void) const { return _minIsDefaultForType; }
bool maxIsDefaultForType(void) const { return _maxIsDefaultForType; }
// Property setters
void setName(const QString& name) { _name = name; }
void setGroup(const QString& group) { _group = group; }
void setDefaultValue(const QVariant& defaultValue);
void setShortDescription(const QString& shortDescription) { _shortDescription = shortDescription; }
void setLongDescription(const QString& longDescription) { _longDescription = longDescription;}
void setUnits(const QString& units) { _units = units; }
void setGroup(const QString& group) { _group = group; }
void setDefaultValue(const QVariant& defaultValue);
void setShortDescription(const QString& shortDescription) { _shortDescription = shortDescription; }
void setLongDescription(const QString& longDescription) { _longDescription = longDescription;}
void setUnits(const QString& units) { _units = units; }
void setMin(const QVariant& max);
void setMax(const QVariant& max);
......@@ -91,8 +91,8 @@ public:
bool convertAndValidate(const QVariant& value, bool convertOnly, QVariant& typedValue, QString& errorString);
private:
QVariant _minForType(void);
QVariant _maxForType(void);
QVariant _minForType(void) const;
QVariant _maxForType(void) const;
QString _name;
QString _group;
......@@ -108,4 +108,4 @@ private:
bool _maxIsDefaultForType;
};
#endif
\ No newline at end of file
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment