25#ifndef FBCPP_SERVICE_MANAGER_H
26#define FBCPP_SERVICE_MANAGER_H
96 return serviceManagerName;
104 serviceManagerName = value;
145 const std::optional<std::string>&
getRole()
const
162 const std::vector<std::uint8_t>&
getSpb()
const
181 spb = std::move(value);
186 std::optional<std::string> server;
187 std::string serviceManagerName =
"service_mgr";
188 std::optional<std::string> userName;
189 std::optional<std::string> password;
190 std::optional<std::string> role;
191 std::vector<std::uint8_t> spb;
216 handle{std::move(o.handle)}
243 handle = std::move(o.handle);
276 return handle !=
nullptr;
301 static void addSpbInt(fb::IXpbBuilder* builder, impl::StatusWrapper* status,
unsigned char tag,
302 std::uint64_t value,
const char* what)
304 if (value >
static_cast<std::uint64_t
>(std::numeric_limits<std::int64_t>::max()))
307 if (value >
static_cast<std::uint64_t
>(std::numeric_limits<int>::max()))
308 builder->insertBigInt(status, tag,
static_cast<std::int64_t
>(value));
310 builder->insertInt(status, tag,
static_cast<int>(value));
313 void startAction(
const std::vector<std::uint8_t>& spb);
314 void waitForCompletion(
const VerboseOutput& verboseOutput = {},
bool requestStdin =
false);
321 FbRef<fb::IService> handle;
Represents a Firebird client library instance.
Base exception class for all fb-cpp exceptions.
Reference-counted smart pointer for Firebird objects using addRef/release semantics.
Represents options used when creating a ServiceManager object.
ServiceManagerOptions & setServiceManagerName(const std::string &value)
Sets the service manager name.
ServiceManagerOptions & setUserName(const std::string &value)
Sets the user name used to attach to the service manager.
const std::vector< std::uint8_t > & getSpb() const
Returns the raw service attach SPB.
ServiceManagerOptions & setSpb(const std::vector< std::uint8_t > &value)
Sets the raw service attach SPB.
const std::optional< std::string > & getServer() const
Returns the server used to attach to the service manager.
const std::string & getServiceManagerName() const
Returns the service manager name.
ServiceManagerOptions & setSpb(std::vector< std::uint8_t > &&value)
Sets the raw service attach SPB.
ServiceManagerOptions & setRole(const std::string &value)
Sets the role used to attach to the service manager.
const std::optional< std::string > & getPassword() const
Returns the password used to attach to the service manager.
const std::optional< std::string > & getUserName() const
Returns the user name used to attach to the service manager.
const std::optional< std::string > & getRole() const
Returns the role used to attach to the service manager.
ServiceManagerOptions & setPassword(const std::string &value)
Sets the password used to attach to the service manager.
ServiceManagerOptions & setServer(const std::string &value)
Sets the server used to attach to the service manager.
Represents a connection to the Firebird service manager.
Client & getClient() noexcept
Returns the Client object reference used to create this ServiceManager object.
ServiceManager & operator=(ServiceManager &&o) noexcept
Transfers ownership of another ServiceManager into this one.
ServiceManager(ServiceManager &&o) noexcept
Move constructor.
void disconnect()
Detaches from the service manager.
bool isValid() noexcept
Returns whether the ServiceManager object is valid.
std::function< void(std::string_view line)> VerboseOutput
Function invoked when a verbose service output line is available.
~ServiceManager() noexcept
Detaches from the service manager.
FbRef< fb::IService > getHandle() noexcept
Returns the internal Firebird IService handle.
@ READ_ONLY
Read-only replica.
@ READ_WRITE
Read-write replica.
@ NONE
Blobs are not allowed in the batch.