00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _DATABASE_TASK_H_
00038 #define _DATABASE_TASK_H_
00039
00040 #include <database_interface/db_class.h>
00041
00042 namespace household_objects_database {
00043
00045
00049 class DatabaseTaskID : public database_interface::DBClass
00050 {
00051 public:
00052 database_interface::DBField<int> id_;
00053
00054 DatabaseTaskID() :
00055 id_(database_interface::DBFieldBase::TEXT, this, "get_mark_next_dbase_task", "get_mark_next_dbase_task()", false)
00056 {
00057 primary_key_field_ = &id_;
00058 id_.setWriteToDatabase(false);
00059 }
00060 };
00061
00062 class DatabaseTask : public database_interface::DBClass
00063 {
00064 private:
00065 public:
00066
00067 database_interface::DBField<int> id_;
00068
00069 database_interface::DBField<int> type_;
00070 database_interface::DBField<std::string> outcome_name_;
00071
00072 DatabaseTask() :
00073 id_(database_interface::DBFieldBase::TEXT, this, "dbase_task_id", "dbase_task", true),
00074 type_(database_interface::DBFieldBase::TEXT, this, "dbase_task_type", "dbase_task", true),
00075 outcome_name_(database_interface::DBFieldBase::TEXT, this, "dbase_task_outcome_name", "dbase_task", true)
00076 {
00077 primary_key_field_ = &id_;
00078 fields_.push_back(&type_);
00079 fields_.push_back(&outcome_name_);
00080
00081 setAllFieldsReadFromDatabase(true);
00082 setAllFieldsWriteToDatabase(true);
00083
00084 id_.setSequenceName("task_id_seq");
00085 id_.setWriteToDatabase(false);
00086 }
00087 };
00088
00090 class DatabasePlanningTask : public database_interface::DBClass
00091 {
00092 public:
00093
00094 database_interface::DBField<int> id_;
00095
00096 database_interface::DBField<int> scaled_model_id_;
00097 database_interface::DBField<std::string> hand_name_;
00098 database_interface::DBField<int> time_;
00099
00100 DatabasePlanningTask() :
00101 id_(database_interface::DBFieldBase::TEXT, this, "dbase_task_id", "planning_task", true),
00102 scaled_model_id_(database_interface::DBFieldBase::TEXT, this, "scaled_model_id", "planning_task", true),
00103 hand_name_(database_interface::DBFieldBase::TEXT, this, "hand_name", "planning_task", true),
00104 time_(database_interface::DBFieldBase::TEXT, this, "task_time", "planning_task", true)
00105 {
00106 primary_key_field_ = &id_;
00107 fields_.push_back(&scaled_model_id_);
00108 fields_.push_back(&hand_name_);
00109 fields_.push_back(&time_);
00110
00111 setAllFieldsReadFromDatabase(true);
00112 setAllFieldsWriteToDatabase(true);
00113 }
00114
00115 };
00116
00117 class DatabaseOptimizationTask : public database_interface::DBClass
00118 {
00119 public:
00120
00121 database_interface::DBField<int> dbase_task_id_;
00122
00123 database_interface::DBField<std::string> hand_name_;
00124 database_interface::DBField< std::vector<double> > parameters_;
00125
00126 DatabaseOptimizationTask() :
00127 dbase_task_id_(database_interface::DBFieldBase::TEXT, this, "dbase_task_id", "optimization_task", true),
00128 hand_name_(database_interface::DBFieldBase::TEXT, this, "hand_name", "optimization_task", true),
00129 parameters_(database_interface::DBFieldBase::TEXT, this, "optimization_task_parameters", "optimization_task", true)
00130 {
00131 primary_key_field_ = &dbase_task_id_;
00132 fields_.push_back(&hand_name_);
00133 fields_.push_back(¶meters_);
00134
00135 setAllFieldsReadFromDatabase(true);
00136 setAllFieldsWriteToDatabase(true);
00137 }
00138 };
00139
00140 class DatabaseOptimizationResult : public database_interface::DBClass
00141 {
00142 public:
00143 database_interface::DBField<int> id_;
00144 database_interface::DBField<int> dbase_task_id_;
00145 database_interface::DBField<std::string> hand_name_;
00146 database_interface::DBField< std::vector<double> > parameters_;
00147 database_interface::DBField< std::vector<double> > results_;
00148
00149 DatabaseOptimizationResult() :
00150 id_(database_interface::DBFieldBase::TEXT, this,
00151 "optimization_result_id", "optimization_result", true),
00152 dbase_task_id_(database_interface::DBFieldBase::TEXT, this,
00153 "dbase_task_id", "optimization_result", true),
00154 hand_name_(database_interface::DBFieldBase::TEXT, this,
00155 "hand_name", "optimization_result", true),
00156 parameters_(database_interface::DBFieldBase::TEXT, this,
00157 "optimization_result_parameters", "optimization_result", true),
00158 results_(database_interface::DBFieldBase::TEXT, this,
00159 "optimization_result_results", "optimization_result", true)
00160 {
00161 primary_key_field_ = &id_;
00162 fields_.push_back(&dbase_task_id_);
00163 fields_.push_back(&hand_name_);
00164 fields_.push_back(¶meters_);
00165 fields_.push_back(&results_);
00166
00167 setAllFieldsReadFromDatabase(true);
00168 setAllFieldsWriteToDatabase(true);
00169
00170 id_.setSequenceName("optimization_result_id_seq");
00171 id_.setWriteToDatabase(false);
00172 }
00173 };
00174
00175 }
00176
00177 #endif