/// @param host Pointer to the new @c Host object being added.
virtual void add(const HostPtr& host) = 0;
+ /// @brief Return backend type
+ ///
+ /// Returns the type of the backend (e.g. "mysql", "memfile" etc.)
+ ///
+ /// @return Type of the backend.
+ virtual std::string getType() const = 0;
+
+ /// @brief Commit Transactions
+ ///
+ /// Commits all pending database operations. On databases that don't
+ /// support transactions, this is a no-op.
+ virtual void commit() {};
+
+ /// @brief Rollback Transactions
+ ///
+ /// Rolls back all pending database operations. On databases that don't
+ /// support transactions, this is a no-op.
+ virtual void rollback() {};
};
+ /// @brief HostDataSource pointer
+ typedef boost::shared_ptr<BaseHostDataSource> HostDataSourcePtr;
+
}
}
/// @param host Pointer to the new @c Host object being added.
virtual void add(const HostPtr& host);
+ /// @brief Return backend type
+ ///
+ /// Returns the type of the backend (e.g. "mysql", "memfile" etc.)
+ ///
+ /// @return Type of the backend.
+ virtual std::string getType() const {
+ return (std::string("host_mgr"));
+ }
+
+ /// @brief Returns pointer to the host data source
+ ///
+ /// May return NULL
+ /// @return pointer to the host data source (or NULL)
+ HostDataSourcePtr getHostDataSource() const {
+ return (alternate_source);
+ }
+
private:
/// @brief Private default constructor.