25 #ifndef AOSSL_MONGO_INCLUDE_MONGO_INTERFACE_H_ 26 #define AOSSL_MONGO_INCLUDE_MONGO_INTERFACE_H_ 32 #include "mongo_buffer_interface.h" 38 const char * what_str;
42 int_msg =
"Error in Mongo Request: " + msg;
43 what_str = int_msg.c_str();
50 const char *
what()
const throw() {
60 virtual std::string get_value() = 0;
61 virtual std::string get_err_msg() = 0;
84 const char * collection_name) = 0;
91 std::string collection_name) = 0;
96 virtual void delete_document(
const char * key) = 0;
98 virtual void delete_document(std::string key) = 0;
100 virtual void delete_document(
const char * key, \
101 const char * collection_name) = 0;
103 virtual void delete_document(std::string key, \
104 std::string collection_name) = 0;
112 const char * collection_name) = 0;
115 std::string collection_name) = 0;
118 virtual void save_document(
const char * doc,
const char * key) = 0;
120 virtual void save_document(std::string doc, std::string key) = 0;
122 virtual void save_document(
const char * doc,
const char * key, \
123 const char * collection_name) = 0;
125 virtual void save_document(std::string doc, std::string key, \
126 std::string collection_name) = 0;
129 const char * key) = 0;
132 std::string key) = 0;
141 const char * opts_str) = 0;
147 std::string opts_str) = 0;
153 const char * opts_str,
const char * collection_name) = 0;
159 std::string opts_str, std::string collection_name) = 0;
194 #endif // AOSSL_MONGO_INCLUDE_MONGO_INTERFACE_H_ Interface used to store Mongo Responses.
Definition: mongo_interface.h:56
Returned from Queries in order to iterate over results.
Definition: mongo_interface.h:65
Mongo Exception, used to store errors passed from Mongo.
Definition: mongo_interface.h:35
A Structure for holding a BSON Document.
Definition: mongo_buffer_interface.h:66
virtual ~MongoInterface()
Destructor.
Definition: mongo_interface.h:78
const char * what() const
Show the error message in readable format.
Definition: mongo_interface.h:50
std::string int_msg
An error message passed on initialization.
Definition: mongo_interface.h:37
MongoException(std::string msg)
Create a Mongo Exception, and store the given error message.
Definition: mongo_interface.h:41
Definition: mongo_interface.h:75