A client for the SmartREST protocol from Cumulocity.
Fork of MbedSmartRest by
IntegerValue.h@0:f76673e7f275, 2014-01-23 (annotated)
- Committer:
- vwochnik
- Date:
- Thu Jan 23 14:36:46 2014 +0000
- Revision:
- 0:f76673e7f275
initial commit, only abstraction
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vwochnik | 0:f76673e7f275 | 1 | /* |
vwochnik | 0:f76673e7f275 | 2 | * IntegerValue.h |
vwochnik | 0:f76673e7f275 | 3 | * |
vwochnik | 0:f76673e7f275 | 4 | * Created on: Nov 1, 2013 |
vwochnik | 0:f76673e7f275 | 5 | * * Authors: Vincent Wochnik <v.wochnik@gmail.com> |
vwochnik | 0:f76673e7f275 | 6 | * |
vwochnik | 0:f76673e7f275 | 7 | * Copyright (c) 2013 Cumulocity GmbH |
vwochnik | 0:f76673e7f275 | 8 | * |
vwochnik | 0:f76673e7f275 | 9 | * Permission is hereby granted, free of charge, to any person obtaining |
vwochnik | 0:f76673e7f275 | 10 | * a copy of this software and associated documentation files (the |
vwochnik | 0:f76673e7f275 | 11 | * "Software"), to deal in the Software without restriction, including |
vwochnik | 0:f76673e7f275 | 12 | * without limitation the rights to use, copy, modify, merge, publish, |
vwochnik | 0:f76673e7f275 | 13 | * distribute, sublicense, and/or sell copies of the Software, and to |
vwochnik | 0:f76673e7f275 | 14 | * permit persons to whom the Software is furnished to do so, subject to |
vwochnik | 0:f76673e7f275 | 15 | * the following conditions: |
vwochnik | 0:f76673e7f275 | 16 | * |
vwochnik | 0:f76673e7f275 | 17 | * The above copyright notice and this permission notice shall be |
vwochnik | 0:f76673e7f275 | 18 | * included in all copies or substantial portions of the Software. |
vwochnik | 0:f76673e7f275 | 19 | * |
vwochnik | 0:f76673e7f275 | 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
vwochnik | 0:f76673e7f275 | 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
vwochnik | 0:f76673e7f275 | 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
vwochnik | 0:f76673e7f275 | 23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
vwochnik | 0:f76673e7f275 | 24 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
vwochnik | 0:f76673e7f275 | 25 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
vwochnik | 0:f76673e7f275 | 26 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
vwochnik | 0:f76673e7f275 | 27 | */ |
vwochnik | 0:f76673e7f275 | 28 | |
vwochnik | 0:f76673e7f275 | 29 | #ifndef NUMBERVALUE_H |
vwochnik | 0:f76673e7f275 | 30 | #define NUMBERVALUE_H |
vwochnik | 0:f76673e7f275 | 31 | |
vwochnik | 0:f76673e7f275 | 32 | #include "Value.h" |
vwochnik | 0:f76673e7f275 | 33 | |
vwochnik | 0:f76673e7f275 | 34 | class IntegerValue : public Value |
vwochnik | 0:f76673e7f275 | 35 | { |
vwochnik | 0:f76673e7f275 | 36 | public: |
vwochnik | 0:f76673e7f275 | 37 | IntegerValue(long); |
vwochnik | 0:f76673e7f275 | 38 | |
vwochnik | 0:f76673e7f275 | 39 | uint8_t valueType() const; |
vwochnik | 0:f76673e7f275 | 40 | long integerValue() const; |
vwochnik | 0:f76673e7f275 | 41 | double floatValue() const; |
vwochnik | 0:f76673e7f275 | 42 | const char * characterValue() const; |
vwochnik | 0:f76673e7f275 | 43 | |
vwochnik | 0:f76673e7f275 | 44 | size_t write(AbstractDataSink&) const; |
vwochnik | 0:f76673e7f275 | 45 | size_t length() const; |
vwochnik | 0:f76673e7f275 | 46 | Value* copy() const; |
vwochnik | 0:f76673e7f275 | 47 | |
vwochnik | 0:f76673e7f275 | 48 | private: |
vwochnik | 0:f76673e7f275 | 49 | unsigned long _number; |
vwochnik | 0:f76673e7f275 | 50 | bool _negative; |
vwochnik | 0:f76673e7f275 | 51 | }; |
vwochnik | 0:f76673e7f275 | 52 | |
vwochnik | 0:f76673e7f275 | 53 | #endif |