29#include "fb-cpp-export.h"
38#if FB_CPP_USE_BOOST_DLL != 0
39#include <boost/dll.hpp>
65#if FB_CPP_USE_BOOST_DLL != 0
70 explicit Client(
const boost::dll::fs::path& fbclientLibPath,
71 boost::dll::load_mode::type loadMode = boost::dll::load_mode::append_decorations |
72 boost::dll::load_mode::search_system_folders)
73 :
Client{boost::dll::shared_library{fbclientLibPath, loadMode}}
81 explicit Client(boost::dll::shared_library fbclientLib)
82 : fbclientLib(fbclientLib)
84 const auto fbGetMasterInterface =
85 fbclientLib.get<
decltype(fb::fb_get_master_interface)>(
"fb_get_master_interface");
86 master = fbGetMasterInterface();
98 int128Util{o.int128Util},
99 decFloat16Util{o.decFloat16Util},
100 decFloat34Util{o.decFloat34Util}
101#if FB_CPP_USE_BOOST_DLL != 0
103 fbclientLib{std::move(o.fbclientLib)}
108 o.int128Util =
nullptr;
109 o.decFloat16Util =
nullptr;
110 o.decFloat34Util =
nullptr;
129 bool isValid() noexcept
131 return master !=
nullptr;
150 util = master->getUtilInterface();
158 template <std::derived_from<fb::IStatus> StatusType>
164 int128Util = getUtil()->getInt128(status);
172 template <std::derived_from<fb::IStatus> StatusType>
178 decFloat16Util = getUtil()->getDecFloat16(status);
180 return decFloat16Util;
186 template <std::derived_from<fb::IStatus> StatusType>
192 decFloat34Util = getUtil()->getDecFloat34(status);
194 return decFloat34Util;
203 return fbUnique(master->getStatus());
213 fb::IUtil* util =
nullptr;
214 fb::IInt128* int128Util =
nullptr;
215 fb::IDecFloat16* decFloat16Util =
nullptr;
216 fb::IDecFloat34* decFloat34Util =
nullptr;
217#if FB_CPP_USE_BOOST_DLL != 0
218 boost::dll::shared_library fbclientLib;
Represents a Firebird client library instance.
fb::IUtil * getUtil()
Returns a Firebird IUtil interface.
Client(fb::IMaster *master)
Constructs a Client object that uses the specified IMaster interface.
FbUniquePtr< fb::IStatus > newStatus()
Creates and returns a Firebird IStatus instance.
fb::IDecFloat16 * getDecFloat16Util(StatusType *status)
Returns a Firebird IDecFloat16 interface.
fb::IMaster * getMaster() noexcept
Returns the Firebird IMaster interface.
Client(const boost::dll::fs::path &fbclientLibPath, boost::dll::load_mode::type loadMode=boost::dll::load_mode::append_decorations|boost::dll::load_mode::search_system_folders)
Constructs a Client object that loads the Firebird client library (or embedded engine) from the speci...
Client(boost::dll::shared_library fbclientLib)
Constructs a Client object that uses the specified Boost.DLL shared_library representing the Firebird...
~Client() noexcept=default
If the Client object was created using Boost.DLL, this destructor just releases the internal boost::d...
fb::IDecFloat34 * getDecFloat34Util(StatusType *status)
Returns a Firebird IDecFloat34 interface.
fb::IInt128 * getInt128Util(StatusType *status)
Returns a Firebird IInt128 interface.
Client(Client &&o) noexcept
Move constructor.
FbUniquePtr< T > fbUnique(T *obj) noexcept
Creates a unique pointer for a Firebird disposable object.
std::unique_ptr< T, impl::FbDisposeDeleter > FbUniquePtr
Unique pointer type for Firebird disposable objects.