Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SilentEnergy.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/io/silent/SilentEnergy.hh
12 ///
13 /// @brief simple class for managing energies in SilentStruct objects.
14 /// @author James Thompson
15 
16 #ifndef INCLUDED_core_io_silent_SilentEnergy_hh
17 #define INCLUDED_core_io_silent_SilentEnergy_hh
18 
19 #include <core/types.hh>
20 #include <string>
21 
22 namespace core {
23 namespace io {
24 namespace silent {
25 
26 /// @brief Helper class for silent-file classes to keep track of energy information.
27 class SilentEnergy {
28 public:
30  name_ ( "" ),
31  value_ ( 0.0 ),
32  weight_( 0.0 ),
33  width_ ( 8 ),
34  string_value_( "" )
35  {}
36 
41  int width
42  ) :
43  name_ ( name ),
44  value_ ( value ),
45  weight_( weight),
46  width_ ( width ),
47  string_value_( "" )
48  {}
49 
53  int width
54  ) :
55  name_ ( name ),
56  value_ ( 0 ),
57  weight_( 1.0 ),
58  width_ ( width ),
59  string_value_( value )
60  {}
61 
62  std::string const& name() const {
63  return name_;
64  }
65 
66  void name( std::string const & new_name ) {
67  name_ = new_name;
68  }
69 
70  core::Real value() const {
71  return value_;
72  }
73 
74  void value( core::Real const & new_value ) {
75  value_ = new_value;
76  }
77 
78  std::string const& string_value() const {
79  return string_value_;
80  }
81 
82  void value( std::string const & new_string_value ) {
83  string_value_ = new_string_value;
84  }
85 
86  core::Real weight() const {
87  return weight_;
88  }
89 
90  void weight( core::Real const & new_weight ) {
91  weight_ = new_weight;
92  }
93 
94  int width() const {
95  return width_;
96  }
97 
98  void width( int const & new_width ) {
99  width_ = new_width;
100  }
101 
102 private:
104 
107 
108  int width_;
110 }; // class SilentEnergy
111 
112 } // namespace silent
113 } // namespace io
114 } // namespace core
115 
116 #endif