Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Library.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/fragment/picking_old/concepts/Library.hh
11 /// @brief class demonstrating the Library concept
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_core_fragment_picking_old_concepts_Library_hh
15 #define INCLUDED_core_fragment_picking_old_concepts_Library_hh
16 
17 
18 // unit headers
20 
21 // project headers
22 #include <core/types.hh>
23 
25 
26 namespace core {
27 namespace fragment {
28 namespace picking_old {
29 namespace concepts {
30 
31 
32 /// @brief class demonstrating the Library concept
33 /// @remarks Class is useable as a concrete implementation of a Library.
34 template< typename Books >
35 class Library {
36 
37 
38 public: // typedefs
39 
40 
41  typedef core::Size Size;
42  typedef typename Books::Book Book;
43  typedef typename Books::const_iterator BookConstIterator;
44  typedef typename Books::iterator BookIterator;
45 
46 
47 public: // constructor
48 
49 
50  /// @brief default constructor
51  inline
52  Library() {}
53 
54 
55  /// @brief Books constructor
56  inline
57  Library( Books const & books ) : books_( books ) {}
58 
59 
60  /// @brief default destructor
61  inline
62  ~Library() {}
63 
64 
65 public: // iterators
66 
67 
68  /// @brief return an iterator that points to the first Book in this library
69  inline
71  return books_.begin();
72  }
73 
74 
75  /// @brief return an iterator that points to the first Book in this library
76  inline
78  return books_.begin();
79  }
80 
81 
82  /// @brief return an iterator that points beyond the last Book in this library
83  inline
85  return books_.end();
86  }
87 
88 
89  /// @brief return an iterator that points beyond the last Book in this library
90  inline
92  return books_.end();
93  }
94 
95 
96 public: // book management
97 
98 
99  /// @brief number of books in the library
100  inline
101  Size size() const {
102  return books_.size();
103  }
104 
105 
106  /// @brief clear the library
107  inline
108  void clear() {
109  books_.clear();
110  }
111 
112 
113 protected: // book management
114 
115 
116  /// @brief return the books in this library
117  inline
118  Books const & books() const {
119  return books_;
120  }
121 
122 
123  /// @brief return the books in this library
124  inline
125  Books & books() {
126  return books_;
127  }
128 
129 
130 private: // data
131 
132 
133  /// @brief all sections of lines from a fragment library
134  Books books_;
135 
136 
137 };
138 
139 // Concrete version for PyRosetta
140 class Library_VallSections: public Library<core::fragment::picking_old::vall::VallSections> {};
141 
142 
143 } // concepts
144 } // picking_old
145 } // fragment
146 } // core
147 
148 
149 #endif /* INCLUDED_core_fragment_picking_old_concepts_Library_HH */