00001 #ifndef Impala_Core_Trec_ShotResult_h 00002 #define Impala_Core_Trec_ShotResult_h 00003 00004 namespace Impala { 00005 namespace Core { 00006 namespace Trec { 00007 00011 class ShotResult 00012 { 00013 friend std::ostream &operator<<(std::ostream &output, const ShotResult &tr) { 00014 output << tr.shotid << " (" << tr.score << ", " << tr.rank << ")"; 00015 return output; 00016 } 00017 00018 public: 00019 int shotid; 00020 int rank; 00021 Real64 score; 00022 00023 ShotResult() { 00024 shotid = -1; 00025 rank = 0; 00026 score = 0.0; 00027 } 00028 00029 ShotResult(const ShotResult ©) { 00030 shotid = copy.shotid; 00031 rank = copy.rank; 00032 score = copy.score; 00033 } 00034 00035 ~ShotResult() { 00036 00037 } 00038 00039 ShotResult &operator=(const ShotResult &o) { 00040 this->shotid = o.shotid; 00041 this->rank = o.rank; 00042 this->score = o.score; 00043 return *this; 00044 } 00045 00046 int operator==(const ShotResult &o) { 00047 if (this->shotid == o.shotid && this->shotid != -1) 00048 return 1; 00049 return 0; 00050 } 00051 00052 int operator<(const ShotResult &o) { 00053 return this->shotid < o.shotid; 00054 } 00055 }; 00056 00057 } // Trec 00058 } // Core 00059 } // Impala 00060 00061 #endif