Skip to content

Commit d769b40

Browse files
committed
Rename property Scheduler/CloudScheduler to Schedule/CloudSchedule
1 parent 1ba7c23 commit d769b40

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

extras/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set(TEST_SRCS
3232
src/test_callback.cpp
3333
src/test_CloudColor.cpp
3434
src/test_CloudLocation.cpp
35-
src/test_CloudScheduler.cpp
35+
src/test_CloudSchedule.cpp
3636
src/test_decode.cpp
3737
src/test_encode.cpp
3838
src/test_publishEvery.cpp

extras/test/src/test_CloudScheduler.cpp renamed to extras/test/src/test_CloudSchedule.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <catch.hpp>
1010

11-
#include <property/types/CloudScheduler.h>
11+
#include <property/types/CloudSchedule.h>
1212

1313
unsigned long time_now = 1;
1414

@@ -28,11 +28,11 @@ unsigned long TimeService::getTime() {return time_now;}
2828
TEST CODE
2929
**************************************************************************************/
3030

31-
SCENARIO("Tesing cloud type 'Scheduler' Ctor", "[Scheduler::Scheduler]")
31+
SCENARIO("Tesing cloud type 'Schedule' Ctor", "[Schedule::Schedule]")
3232
{
33-
WHEN("A Scheduler(0,0,0,0) is being instantiated")
33+
WHEN("A Schedule(0,0,0,0) is being instantiated")
3434
{
35-
Scheduler schedule(0,0,0,0);
35+
Schedule schedule(0,0,0,0);
3636
THEN("The member variable 'start' should be 0") {
3737
REQUIRE(schedule.start == 0);
3838
}
@@ -50,9 +50,9 @@ SCENARIO("Tesing cloud type 'Scheduler' Ctor", "[Scheduler::Scheduler]")
5050

5151
/**************************************************************************************/
5252

53-
SCENARIO("Setup a schedule that repeats each 20 minutes and test isActive Method", "[Scheduler::isActive]")
53+
SCENARIO("Setup a schedule that repeats each 20 minutes and test isActive Method", "[Schedule::isActive]")
5454
{
55-
Scheduler schedule(1633305600, /* Start 4/10/2021 00:00:00 */
55+
Schedule schedule(1633305600, /* Start 4/10/2021 00:00:00 */
5656
1633651200, /* End 8/10/2021 00:00:00 */
5757
600, /* Duration 00:10:00 */
5858
1140850708 /* Minutes */
@@ -134,9 +134,9 @@ SCENARIO("Setup a schedule that repeats each 20 minutes and test isActive Method
134134

135135
/**************************************************************************************/
136136

137-
SCENARIO("Setup a weekly schedule and test isActive Method", "[Scheduler::isActive]")
137+
SCENARIO("Setup a weekly schedule and test isActive Method", "[Schedule::isActive]")
138138
{
139-
Scheduler schedule(1633305600, /* Start 4/10/2021 00:00:00 */
139+
Schedule schedule(1633305600, /* Start 4/10/2021 00:00:00 */
140140
1633651200, /* End 8/10/2021 00:00:00 */
141141
600, /* Duration 00:10:00 */
142142
134217798 /* Weekly */
@@ -194,9 +194,9 @@ SCENARIO("Setup a weekly schedule and test isActive Method", "[Scheduler::isActi
194194

195195
/**************************************************************************************/
196196

197-
SCENARIO("Setup a monthly schedule and test isActive Method", "[Scheduler::isActive]")
197+
SCENARIO("Setup a monthly schedule and test isActive Method", "[Schedule::isActive]")
198198
{
199-
Scheduler schedule(1633305600, /* Start 4/10/2021 00:00:00 */
199+
Schedule schedule(1633305600, /* Start 4/10/2021 00:00:00 */
200200
1664841600, /* End 4/10/2022 00:00:00 */
201201
600, /* Duration 00:10:00 */
202202
201326598 /* Monthly */
@@ -342,9 +342,9 @@ SCENARIO("Setup a monthly schedule and test isActive Method", "[Scheduler::isAct
342342

343343
/**************************************************************************************/
344344

345-
SCENARIO("Setup a yearly schedule and test isActive Method", "[Scheduler::isActive]")
345+
SCENARIO("Setup a yearly schedule and test isActive Method", "[Schedule::isActive]")
346346
{
347-
Scheduler schedule(1633305600, /* Start 4/10/2021 00:00:00 */
347+
Schedule schedule(1633305600, /* Start 4/10/2021 00:00:00 */
348348
1759536000, /* End 4/10/2025 00:00:00 */
349349
600, /* Duration 00:10:00 */
350350
268438022 /* Yearly */
@@ -426,9 +426,9 @@ SCENARIO("Setup a yearly schedule and test isActive Method", "[Scheduler::isActi
426426

427427
/**************************************************************************************/
428428

429-
SCENARIO("Setup a one shot schedule and test isActive Method", "[Scheduler::isActive]")
429+
SCENARIO("Setup a one shot schedule and test isActive Method", "[Schedule::isActive]")
430430
{
431-
Scheduler schedule(1636156800, /* Start 6/11/2021 00:00:00 */
431+
Schedule schedule(1636156800, /* Start 6/11/2021 00:00:00 */
432432
1636243199, /* End 6/11/2021 23:59:59 */
433433
600, /* Duration 00:10:00 */
434434
0 /* One shot */

src/property/PropertyContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "types/CloudUnsignedInt.h"
4141
#include "types/CloudString.h"
4242
#include "types/CloudLocation.h"
43-
#include "types/CloudScheduler.h"
43+
#include "types/CloudSchedule.h"
4444
#include "types/CloudColor.h"
4545
#include "types/CloudWrapperBase.h"
4646

src/property/types/CloudScheduler.h renamed to src/property/types/CloudSchedule.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// a commercial license, send an email to license@arduino.cc.
1616
//
1717

18-
#ifndef CLOUDSCHEDULER_H_
19-
#define CLOUDSCHEDULER_H_
18+
#ifndef CLOUDSCHEDULE_H_
19+
#define CLOUDSCHEDULE_H_
2020

2121
/******************************************************************************
2222
INCLUDE
@@ -30,10 +30,10 @@
3030
/******************************************************************************
3131
CLASS DECLARATION
3232
******************************************************************************/
33-
class Scheduler : public TimeService {
33+
class Schedule : public TimeService {
3434
public:
3535
unsigned int start, end, duration, mask;
36-
Scheduler(unsigned int s, unsigned int e, unsigned int d, unsigned int m): start(s), end(e), duration(d), mask(m) {}
36+
Schedule(unsigned int s, unsigned int e, unsigned int d, unsigned int m): start(s), end(e), duration(d), mask(m) {}
3737

3838
bool isActive() {
3939

@@ -53,20 +53,20 @@ class Scheduler : public TimeService {
5353
return false;
5454
}
5555

56-
Scheduler& operator=(Scheduler & aScheduler) {
57-
start = aScheduler.start;
58-
end = aScheduler.end;
59-
duration = aScheduler.duration;
60-
mask = aScheduler.mask;
56+
Schedule& operator=(Schedule & aSchedule) {
57+
start = aSchedule.start;
58+
end = aSchedule.end;
59+
duration = aSchedule.duration;
60+
mask = aSchedule.mask;
6161
return *this;
6262
}
6363

64-
bool operator==(Scheduler & aScheduler) {
65-
return start == aScheduler.start && end == aScheduler.end && duration == aScheduler.duration && mask == aScheduler.mask;
64+
bool operator==(Schedule & aSchedule) {
65+
return start == aSchedule.start && end == aSchedule.end && duration == aSchedule.duration && mask == aSchedule.mask;
6666
}
6767

68-
bool operator!=(Scheduler & aScheduler) {
69-
return !(operator==(aScheduler));
68+
bool operator!=(Schedule & aSchedule) {
69+
return !(operator==(aSchedule));
7070
}
7171
private:
7272
bool isScheduleOneShot(unsigned int mask) {
@@ -256,33 +256,33 @@ class Scheduler : public TimeService {
256256
}
257257
};
258258

259-
class CloudScheduler : public Property {
259+
class CloudSchedule : public Property {
260260
private:
261-
Scheduler _value,
261+
Schedule _value,
262262
_cloud_value;
263263
public:
264-
CloudScheduler() : _value(0, 0, 0, 0), _cloud_value(0, 0, 0, 0) {}
265-
CloudScheduler(unsigned int start, unsigned int end, unsigned int duration, unsigned int mask) : _value(start, end, duration, mask), _cloud_value(start, end, duration, mask) {}
264+
CloudSchedule() : _value(0, 0, 0, 0), _cloud_value(0, 0, 0, 0) {}
265+
CloudSchedule(unsigned int start, unsigned int end, unsigned int duration, unsigned int mask) : _value(start, end, duration, mask), _cloud_value(start, end, duration, mask) {}
266266

267267
virtual bool isDifferentFromCloud() {
268268

269269
return _value != _cloud_value;
270270
}
271271

272-
CloudScheduler& operator=(Scheduler aScheduler) {
273-
_value.start = aScheduler.start;
274-
_value.end = aScheduler.end;
275-
_value.duration = aScheduler.duration;
276-
_value.mask = aScheduler.mask;
272+
CloudSchedule& operator=(Schedule aSchedule) {
273+
_value.start = aSchedule.start;
274+
_value.end = aSchedule.end;
275+
_value.duration = aSchedule.duration;
276+
_value.mask = aSchedule.mask;
277277
updateLocalTimestamp();
278278
return *this;
279279
}
280280

281-
Scheduler getCloudValue() {
281+
Schedule getCloudValue() {
282282
return _cloud_value;
283283
}
284284

285-
Scheduler getValue() {
285+
Schedule getValue() {
286286
return _value;
287287
}
288288

@@ -307,4 +307,4 @@ class CloudScheduler : public Property {
307307
}
308308
};
309309

310-
#endif /* CLOUDSCHEDULER_H_ */
310+
#endif /* CLOUDSCHEDULE_H_ */

0 commit comments

Comments
 (0)