summaryrefslogtreecommitdiffstats
path: root/sigmod/Time.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-29 12:09:27 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-29 12:09:27 -0500
commit8e278873d4bd35a7cd7f3b6d9d7852fa422370b8 (patch)
tree9e97b71d30779c07c79ca166e1d704a3de4d5e4f /sigmod/Time.cpp
parente801b73a2f9cb845913cf546002c8f50eefc473c (diff)
Merged CHECK macro branch
Diffstat (limited to 'sigmod/Time.cpp')
-rw-r--r--sigmod/Time.cpp46
1 files changed, 11 insertions, 35 deletions
diff --git a/sigmod/Time.cpp b/sigmod/Time.cpp
index b4172405..f0f34486 100644
--- a/sigmod/Time.cpp
+++ b/sigmod/Time.cpp
@@ -54,8 +54,8 @@ void Sigmod::Time::validate()
TEST_BEGIN();
if (m_name.isEmpty())
emit(error("Name is empty"));
- TEST(setHour, hour);
- TEST(setMinute, minute);
+ TEST(hour);
+ TEST(minute);
TEST_END();
}
@@ -76,41 +76,17 @@ QDomElement Sigmod::Time::save() const
return xml;
}
-void Sigmod::Time::setName(const QString& name)
-{
- CHECK(name);
-}
-
-void Sigmod::Time::setHour(const int hour)
-{
- if ((hour < 0) || (24 <= hour))
- emit(error(bounds("hour", 0, 23, hour)));
- else
- CHECK(hour);
-}
+SETTER(Time, QString&, Name, name)
+SETTER(Time, int, Hour, hour)
+SETTER(Time, int, Minute, minute)
-void Sigmod::Time::setMinute(const int minute)
-{
- if ((minute < 0) || (60 <= minute))
- emit(error(bounds("minute", 0, 59, minute)));
- else
- CHECK(minute);
-}
+GETTER(Time, QString, name)
+GETTER(Time, int, hour)
+GETTER(Time, int, minute)
-QString Sigmod::Time::name() const
-{
- return m_name;
-}
-
-int Sigmod::Time::hour() const
-{
- return m_hour;
-}
-
-int Sigmod::Time::minute() const
-{
- return m_minute;
-}
+CHECK(Time, QString&, name)
+CHECK_BOUNDS(Time, int, hour, 0, 23)
+CHECK_BOUNDS(Time, int, minute, 0, 59)
Sigmod::Time& Sigmod::Time::operator=(const Time& rhs)
{