MASA-Core
FirstRow.cpp
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *
00003  * Copyright (c) 2010-2015   Edans Sandes
00004  *
00005  * This file is part of MASA-Core.
00006  * 
00007  * MASA-Core is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation, either version 3 of the License, or
00010  * (at your option) any later version.
00011  * 
00012  * MASA-Core is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with MASA-Core.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  ******************************************************************************/
00021 
00022 #include "FirstRow.hpp"
00023 #include "../../libmasa/libmasa.hpp"
00024 
00025 #define DEBUG (0)
00026 
00027 /*
00028  * @see description on header file
00029  */
00030 FirstRow::FirstRow() {
00031 //      score_params = NULL;
00032 //      firstRowGapped = false;
00033         reader = NULL;
00034         setId(0);
00035 }
00036 
00037 /*
00038  * @see description on header file
00039  */
00040 FirstRow::~FirstRow(){
00041 }
00042 
00043 /*
00044  * @see description on header file
00045  */
00046 //void FirstRow::setParams(const score_params_t* score_params, bool firstRowGapped) {
00047 //      this->score_params = score_params;
00048 //      this->firstRowGapped = firstRowGapped;
00049 //}
00050 
00051 
00052 /*
00053  * @see description on header file
00054  */
00055 void FirstRow::close() {
00056 }
00057 
00058 /*
00059  * @see description on header file
00060  */
00061 void FirstRow::truncateRow(int size) {
00062 }
00063 
00064 /*
00065  * @see description on header file
00066  */
00067 void FirstRow::initialize(bool readOnly, int length) {
00068 }
00069 
00070 /*
00071  * @see description on header file
00072  */
00073 int FirstRow::write(const cell_t* buf, int offset, int len) {
00074         return 0;
00075 }
00076 
00077 void FirstRow::setCellsReader(SeekableCellsReader* reader) {
00078         this->reader = reader;
00079 }
00080 
00081 /*
00082  * @see description on header file
00083  */
00084 int FirstRow::read(cell_t* buf, int offset, int len) {
00085         if (DEBUG) printf("FirstRow::read(%p, %d, %d)\n", buf, offset, len);
00086 //      for (int k=0; k<len; k++) {
00087 //              int ir = offset+k;
00088 //              if (firstRowGapped) {
00089 //                      buf[k].h = (ir==0) ? 0 : -ir*score_params->gap_ext-score_params->gap_open;
00090 //              } else {
00091 //                      buf[k].h = 0;
00092 //              }
00093 //              buf[k].f = -INF;
00094 //      }
00095 //      // we do not need to worry about the reverse vector, since the vector
00096 //      // will be correctly reversed in the SpecialRow class.
00097 //      return len;
00098         reader->seek(offset);
00099         return reader->read(buf, len);
00100 }
00101 
00102