diff options
author | Justin Dickow <jjdickow@gmail.com> | 2015-02-20 09:11:18 -0500 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2015-02-20 09:11:18 -0500 |
commit | a7c5d752cb75485baa0ded5226335d0f8eb10321 (patch) | |
tree | fbfd9251ada2cdcd5cf6a03a79887d08f6b496d7 /src/components/smart_objects/include/smart_objects/number_schema_item.h | |
parent | b2b2233d866f102d3de339afa8ccaf37d3cf2570 (diff) | |
download | sdl_core-a7c5d752cb75485baa0ded5226335d0f8eb10321.tar.gz |
Bug Fixes and ImprovementsSynchronizationCommit
Fix Empty perform iteration request
Fix type of name from string to enum
SendLocation implemented on HTML5 HMI
Fixed PI response on VR rejection due to high priority.
Fix Apps not responsive/not able to start app/apps remain listed on SYNC even after USB disconnect
Mobile API change and processing capabilities
Change perform interaction request conditions.
Fix SDL must always start 3sec timer before resuming the HMILevel of the app
Remove redundant StartSavePersistentDataTimer() call.
Change wrong predicate name to right.
Added stream request handling feature
Made streaming timeout in media manager configurable
Put navi app in LIMITED in case of phone call
Handling of audio state for applications
Add stop streaming timeout into ini file
Implement HMILevel resumption for job-1
Fix result code ABORTED when interrupts it by Voice recognition activation
Fix incorrect value parameter unexpectedDisconnect in BCOnAppUnregistered
Fix SDL send BC.OnAppUnregistered with "unexpectedDisconnect" set to "true" in case received from HMI OnExitAllApplications {"reason":"MASTER_RESET"}
Fix Update ini file for iAP1 support
Current working directory added to image path
Fix helpers to make it workable with more then 2 parameters
DCHECK() for ManageMobileCommand() replaced with log message because the latter returns false in some regular situations (e.g. TOO_MANY_PENDING_REQUESTS, see SDLAQ-CRS-10)
Remove connection after closing.
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
Diffstat (limited to 'src/components/smart_objects/include/smart_objects/number_schema_item.h')
-rw-r--r-- | src/components/smart_objects/include/smart_objects/number_schema_item.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h index f5dd8ba42b..fb4d287fe4 100644 --- a/src/components/smart_objects/include/smart_objects/number_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h @@ -85,7 +85,10 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> { TNumberSchemaItem(const TSchemaItemParameter<NumberType>& MinValue, const TSchemaItemParameter<NumberType>& MaxValue, const TSchemaItemParameter<NumberType>& DefaultValue); - bool isNumberType(SmartType type); + /** + * @brief Compares if param value type is correct + **/ + bool isValidNumberType(SmartType type); /** * @brief Minimum and Maximum allowed values. @@ -105,16 +108,27 @@ TNumberSchemaItem<NumberType>::create( } template<typename NumberType> -bool TNumberSchemaItem<NumberType>::isNumberType(SmartType type) { - return SmartType_Integer == type || SmartType_Double == type; +bool TNumberSchemaItem<NumberType>::isValidNumberType(SmartType type) { + NumberType value(0); + if ((SmartType_Double == type) && + (typeid(double) == typeid(value))) { + return true; + } else if ((SmartType_Integer == type) && + (typeid(int32_t) == typeid(value) || + typeid(uint32_t) == typeid(value) || + typeid(int64_t) == typeid(value))) { + return true; + } else { + return false; + } } template<typename NumberType> Errors::eType TNumberSchemaItem<NumberType>::validate(const SmartObject& Object) { - if (!isNumberType(Object.getType())) { + if (!isValidNumberType(Object.getType())) { return Errors::INVALID_VALUE; } - NumberType value; + NumberType value(0); if (typeid(int32_t) == typeid(value)) { value = Object.asInt(); } else if (typeid(uint32_t) == typeid(value)) { |