pool.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2016 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. #pragma once
  15. #include <mongocxx/options/client.hpp>
  16. #include <mongocxx/config/prelude.hpp>
  17. namespace mongocxx {
  18. MONGOCXX_INLINE_NAMESPACE_BEGIN
  19. namespace options {
  20. ///
  21. /// Class representing the optional arguments to a MongoDB driver pool object. Pool options
  22. /// logically extend client options.
  23. ///
  24. class MONGOCXX_API pool {
  25. public:
  26. ///
  27. /// Constructs a new pool options object. Note that options::pool is implictly convertible from
  28. /// options::client.
  29. ///
  30. /// @param client_opts
  31. /// The client options.
  32. ///
  33. pool(client client_opts = client());
  34. ///
  35. /// The current client options.
  36. ///
  37. /// @return The client options.
  38. ///
  39. const client& client_opts() const;
  40. private:
  41. client _client_opts;
  42. };
  43. } // namespace options
  44. MONGOCXX_INLINE_NAMESPACE_END
  45. } // namespace mongocxx
  46. #include <mongocxx/config/postlude.hpp>