Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DatabaseEntryWorkUnit.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 DatabaseEntryWorkUnit.cc
11 ///
12 /// @brief A work unit base class that can serialize and deserialize a map representing a database row (keys are column names, values are column values)
13 /// and a string representing a query to be executed by the master node upon completion of the workunit. This work unit should be treated as a
14 /// pure virtual since no run() function is implemented.
15 
16 /// @author Tim Jacobs
17 
18 #ifndef INCLUDED_protocols_wum_DatabaseEntryWorkUnit_hh
19 #define INCLUDED_protocols_wum_DatabaseEntryWorkUnit_hh
20 
21 //Unit
24 
25 //Utility and basic
26 #include <basic/database/sql_utils.hh>
27 #include <utility/sql_database/DatabaseSessionManager.hh>
28 
29 //C++
30 #include <string>
31 #include <map>
32 
33 namespace protocols{
34 namespace wum{
35 
37 public:
38 
39  DatabaseEntryWorkUnit(utility::sql_database::sessionOP db_session);
40 
41  DatabaseEntryWorkUnit( std::map<std::string,std::string> row_map );
42 
44 
46  return new DatabaseEntryWorkUnit( *this );
47  }
48 
49  /// @brief Accessor for database query string
51 
52 protected:
53 // void set_defaults();
54 
55  /// @brief Serialize the row_map_
56  virtual void serialize();
57 
58  /// @brief Deserialize the row_map_
59  virtual void deserialize();
60 
61 protected:
62 
63  /// @brief The database connection
64  utility::sql_database::sessionOP db_session_;
65 
66  /// @brief map that represents a database row - keys are columns, values are values
67  std::map<std::string,std::string> row_map_;
68 
69  /// @brief A string that stores the database query you want to run when finished with the work unit
71 
72 };
73 
74 }//namespace wum
75 }//namespace protocols
76 
77 #endif