MongoDB C++ Driver legacy-1.1.2
Loading...
Searching...
No Matches
wire_protocol_writer.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/dbclient_writer.h"
19
20namespace mongo {
21
22class DBClientBase;
23
25public:
26 explicit WireProtocolWriter(DBClientBase* client);
27
28 virtual void write(const StringData& ns,
29 const std::vector<WriteOperation*>& write_operations,
30 bool ordered,
31 bool bypassDocumentValidation,
32 const WriteConcern* writeConcern,
33 WriteResult* writeResult);
34
35private:
36 BSONObj _send(WriteOpType opCode,
37 const BufBuilder& builder,
38 const WriteConcern* wc,
39 const StringData& ns);
40
41 bool _batchableRequest(WriteOpType opCode, const WriteResult* const writeResult);
42 bool _fits(BufBuilder* builder, WriteOperation* operation);
43
44 DBClientBase* const _client;
45};
46
47} // namespace mongo
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
abstract class that implements the core db operations
Definition dbclientinterface.h:1422
Definition dbclient_writer.h:27
A StringData object wraps a 'const string&' or a 'const char*' without copying its contents.
Definition string_data.h:43
Definition wire_protocol_writer.h:24
Class to encapsulate client side "Write Concern" concept.
Definition write_concern.h:35
Represents a single server side write operation and encapsulates the process for encoding the operati...
Definition write_operation.h:31
Class representing the result of a write operations sent to the server.
Definition write_result.h:33
Utility functions for parsing numbers from strings.
Definition compare_numbers.h:20