MongoDB C++ Driver  legacy-1.1.2
delete_write_operation.h
1 /* Copyright 2014 MongoDB Inc.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include "mongo/client/write_operation_base.h"
19 
20 namespace mongo {
21 
23 public:
24  DeleteWriteOperation(const BSONObj& selector, int flags);
25 
26  virtual WriteOpType operationType() const;
27  virtual const char* batchName() const;
28  virtual int incrementalSize() const;
29 
30  virtual void startRequest(const std::string& ns, bool ordered, BufBuilder* builder) const;
31  virtual void appendSelfToRequest(BufBuilder* builder) const;
32 
33  virtual void startCommand(const std::string& ns, BSONObjBuilder* command) const;
34  virtual void appendSelfToCommand(BSONArrayBuilder* request) const;
35 
36  virtual void appendSelfToBSONObj(BSONObjBuilder* obj) const;
37 
38 private:
39  const BSONObj _selector;
40  int _flags;
41 };
42 
43 } // namespace mongo
virtual void appendSelfToBSONObj(BSONObjBuilder *obj) const
Appends the data represented by an instance of this class to a BSONObjBuilder.
virtual void startRequest(const std::string &ns, bool ordered, BufBuilder *builder) const
Appends the preamble for a wire protocol message into the supplied BufBuilder.
virtual WriteOpType operationType() const
Returns the MongoDB wire protocol operation type represented by an instance of this particular write ...
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
virtual void appendSelfToCommand(BSONArrayBuilder *request) const
Appends a single document that describes the write operation represented by an instance of this class...
Utility for creating a BSONObj.
Definition: bsonobjbuilder.h:53
virtual void startCommand(const std::string &ns, BSONObjBuilder *command) const
Appends the preamble for a write command into the supplied BSONObjBuilder.
virtual int incrementalSize() const
Returns the incremental size (in bytes) required to add this write operation to a batch...
Definition: write_operation_base.h:24
Definition: delete_write_operation.h:22
Definition: bsonobjbuilder.h:765
virtual const char * batchName() const
Returns the name for a batch of this type of write operation.
virtual void appendSelfToRequest(BufBuilder *builder) const
Appends a document (or documents in the case of update) which describe the write operation represente...
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary represent...
Definition: bsonobj.h:78