ADBC
Arrow Database Connectivity
Loading...
Searching...
No Matches
adbc::driver::ObjectBase Class Reference

Base class for private_data of AdbcDatabase, AdbcConnection, and AdbcStatement. More...

#include <base_driver.h>

Inheritance diagram for adbc::driver::ObjectBase:
adbc::driver::BaseConnection< Derived > adbc::driver::BaseDatabase< Derived > adbc::driver::BaseStatement< Derived > adbc::driver::Connection< Derived > adbc::driver::Database< Derived > adbc::driver::Statement< Derived >

Public Member Functions

virtual AdbcStatusCode Init (void *parent, AdbcError *error)
 Initialize the object.
 
virtual AdbcStatusCode Release (AdbcError *error)
 Finalize the object.
 
virtual Result< OptionGetOption (std::string_view key)
 Get an option value.
 
virtual AdbcStatusCode SetOption (std::string_view key, Option value, AdbcError *error)
 Set an option value.
 

Protected Attributes

LifecycleState lifecycle_state_
 

Private Member Functions

template<typename T >
AdbcStatusCode CSetOption (const char *key, T value, AdbcError *error)
 
AdbcStatusCode CSetOptionBytes (const char *key, const uint8_t *value, size_t length, AdbcError *error)
 
template<typename T >
AdbcStatusCode CGetOptionStringLike (const char *key, T *value, size_t *length, AdbcError *error)
 
template<typename T >
AdbcStatusCode CGetOptionNumeric (const char *key, T *value, AdbcError *error)
 

Friends

template<typename DatabaseT , typename ConnectionT , typename StatementT >
class Driver
 

Detailed Description

Base class for private_data of AdbcDatabase, AdbcConnection, and AdbcStatement.

This class handles option setting and getting.

Member Function Documentation

◆ GetOption()

virtual Result< Option > adbc::driver::ObjectBase::GetOption ( std::string_view key)
inlinevirtual

Get an option value.

Reimplemented in adbc::driver::Connection< Derived >.

◆ Init()

virtual AdbcStatusCode adbc::driver::ObjectBase::Init ( void * parent,
AdbcError * error )
inlinevirtual

Initialize the object.

Called after 0 or more SetOption calls. Generally, you won't need to override this directly. Instead, use the typed InitImpl provided by Database/Connection/Statement.

Parameters
[in]parentA pointer to the AdbcDatabase or AdbcConnection implementation as appropriate, or nullptr.

Reimplemented in adbc::driver::BaseConnection< Derived >, adbc::driver::BaseDatabase< Derived >, adbc::driver::BaseStatement< Derived >, adbc::driver::Connection< Derived >, and adbc::driver::Statement< Derived >.

◆ Release()

virtual AdbcStatusCode adbc::driver::ObjectBase::Release ( AdbcError * error)
inlinevirtual

Finalize the object.

This can be used to return an error if the object is not in a valid state (e.g. prevent closing a connection with open statements) or to clean up resources when resource cleanup could fail. Infallible resource cleanup (e.g. releasing memory) should generally be handled in the destructor.

Generally, you won't need to override this directly. Instead, use the typed ReleaseImpl provided by Database/Connection/Statement.

Reimplemented in adbc::driver::BaseConnection< Derived >, adbc::driver::BaseDatabase< Derived >, adbc::driver::BaseStatement< Derived >, adbc::driver::Connection< Derived >, and adbc::driver::Statement< Derived >.

◆ SetOption()

virtual AdbcStatusCode adbc::driver::ObjectBase::SetOption ( std::string_view key,
Option value,
AdbcError * error )
inlinevirtual

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