Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
specification.cpp
Go to the documentation of this file.
00001 
00002 #include <core/specification.hpp>
00003 #include <util/get_name.hpp>
00004 
00005 namespace hype{
00006    namespace core{
00007       
00008 using namespace util;
00009 
00010       ProcessingDeviceMemoryID getMemory(ProcessingDeviceID ){
00011          return ProcessingDeviceMemoryID();
00012       }
00013       
00014       
00015       std::vector<ProcessingDeviceID> getProcessingDevices(ProcessingDeviceMemoryID){
00016          return std::vector<ProcessingDeviceID>();
00017       }
00018 
00019 
00020 /************** Algorithm Specification **********/
00021 
00022    AlgorithmSpecification::AlgorithmSpecification(const std::string& alg_name,
00023                              const std::string& op_name,
00024                              StatisticalMethod stat_meth,
00025                              RecomputationHeuristic recomp_heur,
00026                              OptimizationCriterion opt_crit)
00027                               : 
00028                               alg_name_(alg_name), 
00029                               op_name_(op_name),
00030                               stat_meth_(stat_meth),
00031                               recomp_heur_(recomp_heur),
00032                               opt_crit_(opt_crit)
00033                               {
00034                                 
00035                               }
00036 
00037 const std::string& AlgorithmSpecification::getAlgorithmName() const throw()
00038 {
00039    return this->alg_name_;
00040 }
00041 
00042 const std::string& AlgorithmSpecification::getOperationName() const throw()
00043 {
00044    return this->op_name_;
00045 }
00046 
00047 const std::string AlgorithmSpecification::getOptimizationCriterionName() const throw()
00048 {
00049    return getName(this->opt_crit_);
00050 }
00051 
00052 const std::string AlgorithmSpecification::getRecomputationHeuristicName() const throw()
00053 {
00054    return getName(this->recomp_heur_);
00055 }
00056 
00057 const std::string AlgorithmSpecification::getStatisticalMethodName() const throw()
00058 {
00059    return getName(this->stat_meth_);
00060 }
00061 
00062 
00063 /************** Operator Specification **********/
00064 
00065       OperatorSpecification::OperatorSpecification(const std::string& operator_name, 
00066                             const Tuple& feature_vector,
00067                             ProcessingDeviceMemoryID location_of_input_data,
00068                             ProcessingDeviceMemoryID location_for_output_data)
00069                             :  operator_name_(operator_name), 
00070                                feature_vector_(feature_vector), 
00071                                location_of_input_data_(location_of_input_data),
00072                                location_for_output_data_(location_for_output_data)
00073                             {
00074                                
00075                             }
00076 
00077 const Tuple& OperatorSpecification::getFeatureVector() const throw()
00078 {
00079    return this->feature_vector_;
00080 }
00081 
00082 ProcessingDeviceMemoryID OperatorSpecification::getMemoryLocation() const throw()
00083 {
00084    return this->location_of_input_data_;
00085 }
00086 
00087 const std::string& OperatorSpecification::getOperatorName() const throw()
00088 {
00089    return this->operator_name_;
00090 }
00091 
00092 
00093 /************** Device Specification **********/
00094 
00095 
00096 DeviceSpecification::DeviceSpecification(ProcessingDeviceID pd,
00097                           ProcessingDeviceType pd_t,
00098                           ProcessingDeviceMemoryID pd_m) : 
00099                           pd_(pd), pd_t_(pd_t), pd_m_(pd_m)
00100                           {}
00101 
00102 ProcessingDeviceMemoryID DeviceSpecification::getMemoryID() const throw()
00103 {
00104          return this->pd_m_;
00105 }
00106 
00107 ProcessingDeviceID DeviceSpecification::getProcessingDeviceID() const throw()
00108 {
00109          return this->pd_;
00110 }
00111 
00112 ProcessingDeviceType DeviceSpecification::getDeviceType() const throw()
00113 {
00114          return this->pd_t_;     
00115 }
00116 
00117       DeviceSpecification::operator ProcessingDeviceID(){
00118          return this->pd_;
00119 } 
00120       DeviceSpecification::operator ProcessingDeviceType(){
00121          return this->pd_t_;
00122 }
00123       DeviceSpecification::operator ProcessingDeviceMemoryID(){
00124          return this->pd_m_;
00125 }
00126 
00127       bool DeviceSpecification::operator== (const DeviceSpecification& dev_spec) const{
00128          return      (this->pd_==dev_spec.pd_)
00129                   && (this->pd_t_==dev_spec.pd_t_)
00130                   && (this->pd_m_==dev_spec.pd_m_);
00131       }
00132 
00133 /************** Device Constraint **********/
00134 
00135 DeviceConstraint::DeviceConstraint(DeviceTypeConstraint dev_constr,
00136                                    ProcessingDeviceMemoryID pd_mem_constr) : dev_constr_(dev_constr), pd_mem_constr_(pd_mem_constr)
00137 {     
00138 }
00139 
00140       DeviceTypeConstraint DeviceConstraint::getDeviceTypeConstraint() const
00141       {
00142          return this->dev_constr_;
00143       }
00144 
00145       DeviceConstraint::operator DeviceTypeConstraint()
00146       {
00147          return this->dev_constr_;
00148       }
00149       DeviceConstraint::operator ProcessingDeviceMemoryID()
00150       {
00151          return this->pd_mem_constr_;
00152       }
00153       
00154       DeviceConstraint::operator DeviceTypeConstraint() const
00155       {
00156          return this->dev_constr_;
00157       }
00158       DeviceConstraint::operator ProcessingDeviceMemoryID() const
00159       {
00160          return this->pd_mem_constr_;
00161       }
00162       
00163 
00164 
00165    }; //end namespace core
00166 }; //end namespace hype
00167 
00168 
00169 
00170 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines