Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Extent.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/Extent.hh
11 /// @brief class demonstrating the Extent concept
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_core_fragment_picking_old_concepts_Extent_hh
15 #define INCLUDED_core_fragment_picking_old_concepts_Extent_hh
16 
17 // unit headers
19 
20 // type headers
21 #include <core/types.hh>
22 
23 // C++ headers
24 #include <iterator>
25 
26 
27 namespace core {
28 namespace fragment {
29 namespace picking_old {
30 namespace concepts {
31 
32 
33 /// @brief class demonstrating the Extent concept
34 /// @remarks Class is usable as a concrete implementation of Extent.
35 template< typename PageIter >
36 struct Extent {
37 
38 
39 public: // typedefs
40 
41 
42  typedef core::Size Size;
43  typedef PageIter PageIterator;
44 
45 
46 public: // convenience
47 
48 
49  /// @brief compute distance (effectively the length of the extent)
50  /// from begin -> end
51  inline
52  Size distance() const {
53  return std::distance( begin, end );
54  }
55 
56 
57 public: // data
58 
59 
60  /// @brief points to the beginning of the extent
62 
63 
64  /// @brief points just past the end of the extent
66 
67 
68  /// @brief true if extent is to be evaluated by ExtentEvaluators
69  /// during Librarian::catalog(), false if it is to be skipped
70  /// @remarks ExtentEvaluators do not need to check this flag!
71  /// Librarian will only pass valid (true) extents to an evaluator,
72  /// invalid (false) extents will be skipped.
73  bool valid;
74 
75 
76 };
77 
78 
79 } // concepts
80 } // picking_old
81 } // fragment
82 } // core
83 
84 
85 #endif /* INCLUDED_core_fragment_picking_old_concepts_Extent_HH */