fb-cpp 0.0.2
A modern C++ wrapper for the Firebird database API
Loading...
Searching...
No Matches
fbcpp::ServiceManager Class Reference

Represents a connection to the Firebird service manager. More...

#include <ServiceManager.h>

Inheritance diagram for fbcpp::ServiceManager:

Public Types

using VerboseOutput = std::function< void(std::string_view line)>
 Function invoked when a verbose service output line is available.
 

Public Member Functions

 ServiceManager (Client &client, const ServiceManagerOptions &options={})
 Attaches to the service manager specified by the given options.
 
 ServiceManager (ServiceManager &&o) noexcept
 Move constructor.
 
ServiceManageroperator= (ServiceManager &&o) noexcept
 Transfers ownership of another ServiceManager into this one.
 
 ServiceManager (const ServiceManager &)=delete
 
ServiceManageroperator= (const ServiceManager &)=delete
 
 ~ServiceManager () noexcept
 Detaches from the service manager.
 
bool isValid () noexcept
 Returns whether the ServiceManager object is valid.
 
ClientgetClient () noexcept
 Returns the Client object reference used to create this ServiceManager object.
 
FbRef< fb::IService > getHandle () noexcept
 Returns the internal Firebird IService handle.
 
void disconnect ()
 Detaches from the service manager.
 

Protected Member Functions

void startAction (const std::vector< std::uint8_t > &spb)
 
void waitForCompletion (const VerboseOutput &verboseOutput={}, bool requestStdin=false)
 

Static Protected Member Functions

static void addSpbInt (fb::IXpbBuilder *builder, impl::StatusWrapper *status, unsigned char tag, std::uint64_t value, const char *what)
 

Detailed Description

Represents a connection to the Firebird service manager.

Definition at line 176 of file ServiceManager.h.

Member Typedef Documentation

◆ VerboseOutput

using fbcpp::ServiceManager::VerboseOutput = std::function<void(std::string_view line)>

Function invoked when a verbose service output line is available.

Definition at line 182 of file ServiceManager.h.

Constructor & Destructor Documentation

◆ ServiceManager() [1/2]

ServiceManager::ServiceManager ( Client client,
const ServiceManagerOptions options = {} 
)
explicit

Attaches to the service manager specified by the given options.

Definition at line 56 of file ServiceManager.cpp.

◆ ServiceManager() [2/2]

fbcpp::ServiceManager::ServiceManager ( ServiceManager &&  o)
inlinenoexcept

Move constructor.

A moved ServiceManager object becomes invalid.

Definition at line 193 of file ServiceManager.h.

◆ ~ServiceManager()

fbcpp::ServiceManager::~ServiceManager ( )
inlinenoexcept

Detaches from the service manager.

Definition at line 234 of file ServiceManager.h.

Member Function Documentation

◆ addSpbInt()

static void fbcpp::ServiceManager::addSpbInt ( fb::IXpbBuilder *  builder,
impl::StatusWrapper *  status,
unsigned char  tag,
std::uint64_t  value,
const char *  what 
)
inlinestaticprotected

Definition at line 280 of file ServiceManager.h.

◆ disconnect()

void ServiceManager::disconnect ( )

Detaches from the service manager.

Definition at line 86 of file ServiceManager.cpp.

◆ getClient()

Client & fbcpp::ServiceManager::getClient ( )
inlinenoexcept

Returns the Client object reference used to create this ServiceManager object.

Definition at line 261 of file ServiceManager.h.

◆ getHandle()

FbRef< fb::IService > fbcpp::ServiceManager::getHandle ( )
inlinenoexcept

Returns the internal Firebird IService handle.

Definition at line 269 of file ServiceManager.h.

◆ isValid()

bool fbcpp::ServiceManager::isValid ( )
inlinenoexcept

Returns whether the ServiceManager object is valid.

Definition at line 253 of file ServiceManager.h.

◆ operator=()

ServiceManager & fbcpp::ServiceManager::operator= ( ServiceManager &&  o)
inlinenoexcept

Transfers ownership of another ServiceManager into this one.

The old handle is detached via disconnect(). After the assignment, this is valid (with o's handle) and o is invalid.

Definition at line 205 of file ServiceManager.h.

◆ startAction()

void ServiceManager::startAction ( const std::vector< std::uint8_t > &  spb)
protected

Definition at line 91 of file ServiceManager.cpp.

◆ waitForCompletion()

void ServiceManager::waitForCompletion ( const VerboseOutput verboseOutput = {},
bool  requestStdin = false 
)
protected

Definition at line 99 of file ServiceManager.cpp.


The documentation for this class was generated from the following files: