Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MMAtomTypeSet.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/chemical/MMAtomTypeSet.hh
11 /// @author P. Douglas Renfrew (renfrew@unc.edu)
12 
13 
14 #ifndef INCLUDED_core_chemical_MMAtomTypeSet_hh
15 #define INCLUDED_core_chemical_MMAtomTypeSet_hh
16 
17 
18 // Unit headers
20 
21 // Project headers
22 // AUTO-REMOVED #include <core/chemical/MMAtomType.hh>
23 
24 // Utility headers
25 // AUTO-REMOVED #include <utility/vector1.hh>
26 #include <utility/exit.hh>
27 #include <utility/pointer/ReferenceCount.hh>
28 
29 // C++ headers
30 // Commented by inclean daemon #include <string>
31 #include <map>
32 
34 #include <utility/vector1_bool.hh>
35 
36 
37 
38 namespace core {
39 namespace chemical {
40 
41 
42 /// @brief A set of MMAtomTypes
43 ///
44 /// @details This class contains a vector of pointers each of which points to an
45 /// MMAtomType and the vector index is looked up by an atom_name string
46 /// in a map.
47 ///
49 
50 public:
51  MMAtomTypeSet();
52  virtual ~MMAtomTypeSet();
53 
54  /// @brief Number of MM atom types in the set
55  Size
56  n_atomtypes() const
57  {
58  return atoms_.size();
59  }
60 
61 
62  /// @brief Check if there is an atom_type associated with an atom_type_name string
63  bool
64  contains_atom_type( std::string const & atom_type_name ) const
65  {
66  std::map< std::string, int >::const_iterator
67  iter( atom_type_index_.find( atom_type_name ) );
68  return iter != atom_type_index_.end();
69  }
70 
71 
72  /// @brief Lookup the atom_type by the atom_type_name string
73  int
74  atom_type_index( std::string const & atom_type_name ) const
75  {
76  std::map< std::string, int >::const_iterator
77  iter( atom_type_index_.find( atom_type_name ) );
78  if ( iter == atom_type_index_.end() ) {
79  utility_exit_with_message("unrecognized mm_atom_type_name "+atom_type_name);
80  }
81  return iter->second;
82  }
83 
84 
85  /// @brief Lookup an MMAtomType by 1-based indexing
86  MMAtomType const &
87  operator[] ( Size const index ) const
88  {
89  return *( atoms_[ index ] );
90  }
91 
92 
93  /// @brief Load the MMAtomTypeSet from a file
94  void
95  read_file( std::string const & filename );
96 
97  /// @brief Print all of the names of all of the MMAtomTypes in the set. Usefull for debuging.
98  void
100 
101 
102  // data
103 private:
104 
105  /// @brief atom_type_index_ lookup map
106  ///
107  /// @details atom_type_index_ allows lookup of the atom type index by a string
108  std::map< std::string, int > atom_type_index_;
109 
110  /// @brief a collection of MMAtomTypes,
111  ///
112  /// @details MMAtomType has data of atom properties, and it can be
113  /// looked up by atom_type_index.
115 
116 };
117 
118 } // chemical
119 } // core
120 
121 #endif // INCLUDED_core_chemical_MMAtomTypeSet_HH