task.cpp
Go to the documentation of this file.
00001 #include "rqt_mrta/config/application/task.h"
00002 
00003 namespace rqt_mrta
00004 {
00005 namespace config
00006 {
00007 namespace application
00008 {
00009 Task::Task(QObject* parent) : AbstractConfig(parent) {}
00010 
00011 Task::~Task() {}
00012 
00013 QString Task::getId() const { return id_; }
00014 
00015 void Task::setId(const QString& id)
00016 {
00017   if (id != id_)
00018   {
00019     id_ = id;
00020     emit idChanged(id);
00021     emit changed();
00022   }
00023 }
00024 
00025 void Task::save(QSettings& settings) const { settings.setValue("id", id_); }
00026 
00027 void Task::load(QSettings& settings) { setId(settings.value("id").toString()); }
00028 
00029 void Task::reset() { setId(""); }
00030 
00031 void Task::write(QDataStream& stream) const { stream << id_; }
00032 
00033 void Task::read(QDataStream& stream)
00034 {
00035   QString id;
00036   stream >> id;
00037   setId(id);
00038 }
00039 
00040 Task& Task::operator=(const Task& config)
00041 {
00042   setId(config.id_);
00043   return *this;
00044 }
00045 
00046 QString Task::validate() const
00047 {
00048   if (id_.isEmpty())
00049   {
00050     return "The task id must not be empty.";
00051   }
00052   if (id_.contains(' '))
00053   {
00054     return "The task id must not contain <space>.";
00055   }
00056   return "";
00057 }
00058 }
00059 }
00060 }


rqt_mrta
Author(s): Adriano Henrique Rossette Leite
autogenerated on Thu Jun 6 2019 18:50:52