Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LengthGen.cc
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/vall/gen/LengthGen.cc
11 /// @brief default constant length fragment VallExtentGenerator
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 // unit headers
16 
17 #include <utility/vector1.hh>
18 
19 
20 
21 namespace core {
22 namespace fragment {
23 namespace picking_old {
24 namespace vall {
25 namespace gen {
26 
27 
28 /// @brief default constructor
30  Super()
31 {}
32 
33 
34 /// @brief fragment size constructor
35 /// @param[in] frag_size the desired length of the fragment
36 LengthGen::LengthGen( Size const frag_size ) :
37  Super(),
38  frag_size_( frag_size )
39 {}
40 
41 
42 /// @brief copy constructor
44  Super( rval ),
45  frag_size_( rval.frag_size_ )
46 {}
47 
48 
49 /// @brief default destructor
51 {}
52 
53 
54 /// @brief copy assignment
56  if ( this != &rval ) {
57  Super::operator =( rval );
58  frag_size_ = rval.frag_size_;
59  }
60  return *this;
61 }
62 
63 
64 /// @brief clone this object
66  return new LengthGen( *this );
67 }
68 
69 
70 /// @brief return the desired fragment extent w/requested fragment size
71 /// @return valid (true) extent if the end of the extent does not go past the
72 /// section_end, invalid (false) extent otherwise
73 /// @remarks we assume VallResidueIterator is a type of RandomAccessIterator, such as
74 /// those used in std::vector
76  Extent extent;
77  extent.begin = extent_begin;
78  extent.end = extent_begin + frag_size_;
79  extent.valid = ( extent.end <= section_end );
80 
81  return extent;
82 }
83 
84 
85 
86 } // namespace gen
87 } // namespace vall
88 } // namespace picking_old
89 } // namespace fragment
90 } // namespace core