RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
BaseMolecularDataSource.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Abstract base class (interface) for molecular data sources
14
15#ifndef _RBTBASEMOLECULARDATASOURCE_H_
16#define _RBTBASEMOLECULARDATASOURCE_H_
17
18#include "rxdock/Atom.h"
19#include "rxdock/Bond.h"
20#include "rxdock/Config.h"
21#include "rxdock/Variant.h"
22
23namespace rxdock {
24
26public:
28 // Constructors/destructors
29
30 // Parameterised constructor
31 // strName is a descriptive text label for the type of data source
32 // Derived classes should use this constructor to set a suitable name
33 BaseMolecularDataSource(std::string strName) : m_strName(strName) {}
34
35 virtual ~BaseMolecularDataSource() {} // Default destructor
36
38 // Public methods
40 std::string GetName() {
41 return m_strName;
42 } // Returns source identifier string
43
44 virtual bool isTitleListSupported() { return false; }
45 virtual bool isAtomListSupported() { return false; }
46 virtual bool isCoordinatesSupported() { return false; }
47 virtual bool isBondListSupported() { return false; }
48
49 // Pure virtual - derived classes must override
50
51 // Reset source so that next time it is used, a new set of atom and bond
52 // objects are created
53 virtual void Reset() = 0;
54
55 virtual int GetNumTitles() = 0;
56 virtual int GetNumAtoms() = 0;
57 virtual int GetNumBonds() = 0;
58 virtual int GetNumSegments() = 0;
59
60 virtual std::vector<std::string> GetTitleList() = 0;
61 virtual AtomList GetAtomList() = 0;
62 virtual BondList GetBondList() = 0;
63 virtual SegmentMap GetSegmentMap() = 0;
64
65 // DM 12 May 1999 - support for data records (e.g. SD file)
66 // Does source support data records (default=false)
67 virtual bool isDataSupported() { return false; }
68 // Get number of data fields
69 virtual int GetNumData() = 0;
70 // Get list of field names as string list
71 virtual std::vector<std::string> GetDataFieldList() = 0;
72 // Get all data as map of key=field name, value=variant (double,string or
73 // string list)
74 virtual StringVariantMap GetDataMap() = 0;
75 // Query as to whether a particular data field name is present
76 virtual bool isDataFieldPresent(const std::string &strDataField) = 0;
77 // Get a particular data value
78 virtual Variant GetDataValue(const std::string &strDataField) = 0;
79
80private:
82 // Private methods
84 BaseMolecularDataSource(); // Disable default constructor
86 const BaseMolecularDataSource &); // Copy constructor disabled by default
87 BaseMolecularDataSource &operator=(
88 const BaseMolecularDataSource &); // Copy assignment disabled by default
89
90private:
92 // Private data
94 std::string m_strName; // Source identifier string
95};
96
97} // namespace rxdock
98
99#endif //_RBTBASEMOLECULARDATASOURCE_H_
Definition BaseMolecularDataSource.h:25
Definition Variant.h:30