Chemical Data Processing Library C++ API - Version 1.2.0
PSDPharmacophoreReader.hpp
Go to the documentation of this file.
1 /*
2  * PSDPharmacophoreReader.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_PHARM_PSDPHARMACOPHOREREADER_HPP
30 #define CDPL_PHARM_PSDPHARMACOPHOREREADER_HPP
31 
32 #include <string>
33 #include <iosfwd>
34 
35 #include "CDPL/Pharm/APIPrefix.hpp"
37 #include "CDPL/Base/DataReader.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Pharm
44  {
45 
46  class Pharmacophore;
47 
52  {
53 
54  public:
60  PSDPharmacophoreReader(std::istream& is);
61 
67  PSDPharmacophoreReader(const std::string& file_name);
68 
70 
71  PSDPharmacophoreReader& read(Pharmacophore& pharm, bool overwrite = true);
72 
73  PSDPharmacophoreReader& read(std::size_t idx, Pharmacophore& pharm, bool overwrite = true);
74 
76 
77  bool hasMoreData();
78 
79  std::size_t getRecordIndex() const;
80  void setRecordIndex(std::size_t idx);
81 
82  std::size_t getNumRecords();
83 
84  operator const void*() const;
85  bool operator!() const;
86 
87  private:
88  PSDScreeningDBAccessor accessor;
89  std::size_t recordIndex;
90  std::size_t numRecords;
91  bool state;
92  };
93  } // namespace Pharm
94 } // namespace CDPL
95 
96 #endif // CDPL_PHARM_PSDPHARMACOPHOREREADER_HPP
Definition of the class CDPL::Base::DataReader.
Definition of the class CDPL::Pharm::PSDScreeningDBAccessor.
Definition of the preprocessor macro CDPL_PHARM_API.
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
An interface for reading data objects of a given type from an arbitrary data source.
Definition: DataReader.hpp:73
A reader for pharmacophore data in the PSD-format of the CDPL.
Definition: PSDPharmacophoreReader.hpp:52
PSDPharmacophoreReader & read(std::size_t idx, Pharmacophore &pharm, bool overwrite=true)
PSDPharmacophoreReader & skip()
Skips the data record at the current record index.
std::size_t getRecordIndex() const
Returns the index of the current data record.
bool hasMoreData()
Tells if there are any data records left to read.
std::size_t getNumRecords()
Returns the total number of available data records.
PSDPharmacophoreReader & read(Pharmacophore &pharm, bool overwrite=true)
void setRecordIndex(std::size_t idx)
Sets the index of the current data record to idx.
PSDPharmacophoreReader(const std::string &file_name)
Constructs a PSDPharmacophoreReader instance that will read the pharmacophore data from the input fil...
PSDPharmacophoreReader(std::istream &is)
Constructs a PSDPharmacophoreReader instance that will read the pharmacophore data from the input str...
bool operator!() const
Tells whether the reader is in a bad state.
A class for accessing pharmacophore screening databases in the built-in optimized format.
Definition: PSDScreeningDBAccessor.hpp:50
Pharmacophore.
Definition: Pharmacophore.hpp:48
The namespace of the Chemical Data Processing Library.