Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DnaDesignDef.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
11 /// @brief
12 /// @author ashworth
13 
15 
16 #include <core/types.hh>
17 
18 #include <utility/vector1.hh>
19 #include <utility/string_util.hh>
20 using utility::string_split;
21 
22 #include <sstream>
23 #include <string>
24 
25 namespace protocols {
26 namespace dna {
27 
28 using namespace core;
29 
31 
33  : utility::pointer::ReferenceCount()
34 {
35  // command-line dna_defs are of the format "C.501.ADE"
36  // split on '.'
37  utility::vector1< std::string > parts( string_split( strdef, '.' ) );
39  chain = (*(part++))[0];
40  std::istringstream inum_stream( *(part++) );
41  inum_stream >> pdbpos;
42  if ( part == parts.end() ) return;
43  name3 = *part;
44 }
45 
46 std::ostream & operator << ( std::ostream & os, DnaDesignDef const & def )
47 {
48  os << def.chain << "." << def.pdbpos << "." << def.name3;
49  return os;
50 }
51 
52 std::ostream & operator << ( std::ostream & os, DnaDesignDefs const & defs )
53 {
54  for ( DnaDesignDefs::const_iterator def( defs.begin() ), end( defs.end() );
55  def != end; ++def ) {
56  if ( def != defs.begin() ) os << " ";
57  os << *def;
58  }
59  return os;
60 }
61 
62 std::ostream & operator << ( std::ostream & os, DnaDesignDefOPs const & defs )
63 {
64  for ( DnaDesignDefOPs::const_iterator def( defs.begin() ), end( defs.end() );
65  def != end; ++def ) {
66  if ( def != defs.begin() ) os << " ";
67  os << **def;
68  }
69  return os;
70 }
71 
72 } // namespace dna
73 } // namespace protocols