src/cpsp/HCoreDatabaseFILE.hh
Go to the documentation of this file.00001 /* 00002 * Main authors: 00003 * Martin Mann http://www.bioinf.uni-freiburg.de/~mmann/ 00004 * 00005 * Contributing authors: 00006 * Sebastian Will http://www.bioinf.uni-freiburg.de/~will/ 00007 * 00008 * Copyright: 00009 * Martin Mann, 2007 00010 * 00011 * This file is part of the CPSP-tools package: 00012 * http://www.bioinf.uni-freiburg.de/sw/cpsp/ 00013 * 00014 * See the file "LICENSE" for information on usage and 00015 * redistribution of this file, and for a 00016 * DISCLAIMER OF ALL WARRANTIES. 00017 * 00018 */ 00019 00020 #ifndef HCOREDATABASEXML_HH_ 00021 #define HCOREDATABASEXML_HH_ 00022 00023 00024 #include "cpsp/HCoreDatabase.hh" 00025 #include <string> 00026 #include <fstream> 00027 00028 00029 namespace cpsp 00030 { 00031 00032 typedef std::vector<int> intVec; 00033 00040 class HCoreDatabaseFILE : public HCoreDatabase 00041 { 00042 protected: 00043 00044 unsigned int coreSize; 00045 unsigned int minHH, maxHH; 00046 const std::string DBROOTPATH; 00047 00048 intVec actHHcontacts; 00049 std::ifstream *actFile; 00050 std::string actFileNamePref; 00051 int actFileHHcontInd; 00052 00053 // Exception Klassen 00054 class ExcEOF {}; 00055 00056 public: 00057 00058 HCoreDatabaseFILE(const std::string& dbRootPath); 00059 HCoreDatabaseFILE(const HCoreDatabaseFILE& toCopy); 00060 virtual ~HCoreDatabaseFILE(); 00061 00065 virtual bool initCoreAccess( const biu::LatticeDescriptor& latDescr, 00066 const unsigned int size, 00067 const unsigned int minContacts=0, 00068 const unsigned int maxContacts=UINT_MAX-2); 00069 00076 virtual bool getNextCore(HCore& toFill); 00077 00080 virtual unsigned int getActCoreSize() { return coreSize; } 00081 00084 virtual unsigned int getActMinHHcontacts() { return minHH; } 00085 00088 virtual void setActMinHHcontacts(const unsigned int minContacts) { 00089 minHH = minContacts; 00090 } 00091 00094 virtual unsigned int getActMaxHHcontacts() { return maxHH; } 00095 00098 virtual bool isConnected() const { return true; } 00099 00100 }; 00101 00102 } // namespace cpsp 00103 00104 #endif /*HCoreDatabaseFILE_HH_*/