Skip to content

Commit

Permalink
Implement ChainPDBSelector in header
Browse files Browse the repository at this point in the history
Move the one .cpp ChainPDBSelector method
back into the header, so that we don't have
to export the class.
  • Loading branch information
benmwebb committed Sep 29, 2023
1 parent 9b06706 commit eca4fe7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 9 additions & 1 deletion modules/atom/include/pdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,15 @@ class ChainPDBSelector : public NonAlternativePDBSelector {
(mmCIF files support multiple-character chain names) */
IMPATOM_DEPRECATED_METHOD_DECL(2.20)
ChainPDBSelector(const std::string &chains,
std::string name = "ChainPDBSelector%1%");
std::string name = "ChainPDBSelector%1%")
: NonAlternativePDBSelector(name) {
IMPATOM_DEPRECATED_METHOD_DEF(
2.20, "Pass a list of chain ID strings instead");
for (size_t i = 0; i < chains.length(); ++i) {
chains_.push_back(std::string(1, chains[i]));
}
std::sort(chains_.begin(), chains_.end());
}
#endif

private:
Expand Down
10 changes: 0 additions & 10 deletions modules/atom/src/pdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,6 @@ bool HydrogenPDBSelector::is_hydrogen(const PDBRecord &record) const {
(atom_name[0] == 'H' || atom_name[0] == 'D'));
}

ChainPDBSelector::ChainPDBSelector(const std::string &chains, std::string name)
: NonAlternativePDBSelector(name) {
IMPATOM_DEPRECATED_METHOD_DEF(
2.20, "Pass a list of chain ID strings instead");
for (size_t i = 0; i < chains.length(); ++i) {
chains_.push_back(std::string(1, chains[i]));
}
std::sort(chains_.begin(), chains_.end());
}

namespace {
std::string nicename(std::string name) {
boost::filesystem::path path(name);
Expand Down

0 comments on commit eca4fe7

Please sign in to comment.