MongoDB C++ Driver  legacy-1.1.2
dbclient.h
Go to the documentation of this file.
1 
7 /* Copyright 2009 10gen Inc.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #pragma once
23 
24 #ifdef MONGO_EXPOSE_MACROS
25 #error dbclient.h is for C++ driver consumer use only
26 #endif
27 
28 // Consumers of the MongoDB C++ client library must define STATIC_LIBMONGOCLIENT when including
29 // this header if they intend to link against the static version of the library. This is best
30 // handled by adding STATIC_LIBMONGOCLIENT to the list of definitions passed on each compile
31 // invocation.
32 #ifndef STATIC_LIBMONGOCLIENT
33 #if defined(_WIN32) && !defined(_DLL)
34 #error "The DLL build of libmongoclient requires consuming code to be built with /MD or /MDd"
35 #endif
36 #endif
37 
38 #if defined(_MSC_VER)
39 #pragma warning(push)
40 // Don't emit deprecation warnings
41 #pragma warning(disable : 4996)
42 #if defined(_DLL)
43 // Don't spam DLL consumers with warnings about STL symbol exports
44 #pragma warning(disable : 4251)
45 #pragma warning(disable : 4275)
46 #endif
47 #endif
48 
49 #if defined(_WIN32) && !defined(_WINSOCK2API_)
50 #error "You must include the windows and windows sockets headers before dbclient.h"
51 #endif
52 
53 #include "mongo/config.h"
54 
56 
57 #include "mongo/client/autolib.h"
58 
60 #include "mongo/client/dbclientcursor.h"
62 #include "mongo/client/gridfs.h"
63 #include "mongo/client/init.h"
64 #include "mongo/client/options.h"
65 #include "mongo/client/sasl_client_authenticate.h"
66 #include "mongo/geo/interface.h"
67 #include "mongo/version.h"
68 
70 
71 #if defined(_MSC_VER)
72 #pragma warning(pop)
73 #endif
remove mongo implementation macros after using
macros for mongo internals
Connect to a Replica Set, from C++.
Core MongoDB C++ driver interfaces are defined here.