Add addNewDocument method

This commit is contained in:
fbraem 2013-02-23 17:36:10 +01:00
parent 99cd51d727
commit 382dbd5637

View File

@ -69,6 +69,12 @@ public:
/// Destructor
Document& addNewDocument();
/// Adds a new document for insertion. A reference to the empty document is
/// returned. InsertRequest is the owner of the Document and will free it
/// on destruction.
Document::Vector& documents();
/// Returns the documents to insert into the database
@ -87,6 +93,16 @@ private:
};
inline Document& InsertRequest::addNewDocument()
{
Document::Ptr doc = new Document();
_documents.push_back(doc);
return *doc;
}
inline Document::Vector& InsertRequest::documents()
{
return _documents;