Skip to content

Commit b362013

Browse files
Redefining Primitive kind property as template class
1 parent 46f165d commit b362013

16 files changed

+219
-787
lines changed

extras/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ set(TEST_UTIL_SRCS
9595

9696
set(TEST_DUT_SRCS
9797
../../src/property/Property.cpp
98+
../../src/property/types/PropertyPrimitive.cpp
9899
../../src/property/PropertyContainer.cpp
99100
../../src/cbor/CBORDecoder.cpp
100101
../../src/cbor/CBOREncoder.cpp

extras/test/src/test_CloudFloat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <CBORDecoder.h>
1212

13-
#include <property/types/CloudFloat.h>
13+
#include <property/PropertyContainer.h>
1414

1515
/**************************************************************************************
1616
TEST CODE

extras/test/src/test_addPropertyReal.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010

1111
#include <PropertyContainer.h>
1212

13-
#include <types/CloudInt.h>
14-
#include <types/CloudBool.h>
15-
#include <types/CloudFloat.h>
16-
#include <types/CloudString.h>
17-
1813
/**************************************************************************************
1914
TEST CODE
2015
**************************************************************************************/

extras/test/src/test_decode.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@
1919
#include "types/CloudWrapperInt.h"
2020
#include "types/CloudWrapperString.h"
2121
#include "types/automation/CloudColoredLight.h"
22-
#include "types/automation/CloudContactSensor.h"
2322
#include "types/automation/CloudDimmedLight.h"
24-
#include "types/automation/CloudLight.h"
25-
#include "types/automation/CloudMotionSensor.h"
26-
#include "types/automation/CloudSmartPlug.h"
27-
#include "types/automation/CloudSwitch.h"
28-
#include "types/automation/CloudTemperatureSensor.h"
2923
#include "types/automation/CloudTelevision.h"
3024

3125
using namespace Catch;

src/property/PropertyContainer.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,16 @@
3030
#undef min
3131
#include <list>
3232

33-
#include "types/CloudBool.h"
34-
#include "types/CloudFloat.h"
35-
#include "types/CloudInt.h"
36-
#include "types/CloudUnsignedInt.h"
33+
#include "types/PropertyPrimitive.h"
34+
3735
#include "types/CloudString.h"
3836
#include "types/CloudLocation.h"
3937
#include "types/CloudSchedule.h"
4038
#include "types/CloudColor.h"
4139
#include "types/CloudWrapperBase.h"
4240

4341
#include "types/automation/CloudColoredLight.h"
44-
#include "types/automation/CloudContactSensor.h"
4542
#include "types/automation/CloudDimmedLight.h"
46-
#include "types/automation/CloudLight.h"
47-
#include "types/automation/CloudMotionSensor.h"
48-
#include "types/automation/CloudSmartPlug.h"
49-
#include "types/automation/CloudSwitch.h"
50-
#include "types/automation/CloudTemperatureSensor.h"
5143
#include "types/automation/CloudTelevision.h"
5244

5345
/******************************************************************************
@@ -62,6 +54,11 @@ extern "C" unsigned long getTime();
6254

6355
typedef std::list<Property *> PropertyContainer;
6456

57+
typedef PropertyPrimitive<bool> CloudBool;
58+
typedef PropertyPrimitive<float> CloudFloat;
59+
typedef PropertyPrimitive<int> CloudInt;
60+
typedef PropertyPrimitive<unsigned int> CloudUnsignedInt;
61+
6562
typedef CloudFloat CloudEnergy;
6663
typedef CloudFloat CloudForce;
6764
typedef CloudFloat CloudTemperature;
@@ -93,6 +90,13 @@ typedef CloudInt CloudInformationContent;
9390
typedef CloudFloat CloudPercentage;
9491
typedef CloudFloat CloudRelativeHumidity;
9592

93+
typedef CloudBool CloudContactSensor;
94+
typedef CloudBool CloudLight;
95+
typedef CloudBool CloudMotionSensor;
96+
typedef CloudBool CloudSmartPlug;
97+
typedef CloudBool CloudSwitch;
98+
typedef CloudFloat CloudTemperatureSensor;
99+
96100
/******************************************************************************
97101
FUNCTION DECLARATION
98102
******************************************************************************/

src/property/types/CloudBool.h

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/property/types/CloudFloat.h

Lines changed: 0 additions & 188 deletions
This file was deleted.

0 commit comments

Comments
 (0)