ARC SDK
Public Member Functions
Arc::Database Class Referenceabstract

Interface for calling database client library. More...

#include <arc/DBInterface.h>

Inheritance diagram for Arc::Database:
Arc::MySQLDatabase

Public Member Functions

 Database ()
 Default constructor. More...
 
 Database (std::string &server, int port)
 Constructor which uses the server's name(or IP address) and port as parameters. More...
 
 Database (const Database &other)
 Copy constructor. More...
 
virtual ~Database ()
 Deconstructor. More...
 
virtual bool connect (std::string &dbname, std::string &user, std::string &password)=0
 Do connection with database server. More...
 
virtual bool isconnected () const =0
 Get the connection status. More...
 
virtual void close ()=0
 Close the connection with database server. More...
 
virtual bool enable_ssl (const std::string &keyfile="", const std::string &certfile="", const std::string &cafile="", const std::string &capath="")=0
 Enable ssl communication for the connection. More...
 
virtual bool shutdown ()=0
 Ask database server to shutdown. More...
 

Detailed Description

Interface for calling database client library.

For different types of database client library, different classes should be implemented by implementing this interface.

Constructor & Destructor Documentation

◆ Database() [1/3]

Arc::Database::Database ( )
inline

Default constructor.

◆ Database() [2/3]

Arc::Database::Database ( std::string &  server,
int  port 
)
inline

Constructor which uses the server's name(or IP address) and port as parameters.

◆ Database() [3/3]

Arc::Database::Database ( const Database other)
inline

Copy constructor.

◆ ~Database()

virtual Arc::Database::~Database ( )
inlinevirtual

Deconstructor.

Member Function Documentation

◆ close()

virtual void Arc::Database::close ( )
pure virtual

Close the connection with database server.

Implemented in Arc::MySQLDatabase.

◆ connect()

virtual bool Arc::Database::connect ( std::string &  dbname,
std::string &  user,
std::string &  password 
)
pure virtual

Do connection with database server.

Parameters
dbnameThe database name which will be used.
userThe username which will be used to access database.
passwordThe password which will be used to access database.

Implemented in Arc::MySQLDatabase.

◆ enable_ssl()

virtual bool Arc::Database::enable_ssl ( const std::string &  keyfile = "",
const std::string &  certfile = "",
const std::string &  cafile = "",
const std::string &  capath = "" 
)
pure virtual

Enable ssl communication for the connection.

Parameters
keyfileThe location of key file.
certfileThe location of certificate file.
cafileThe location of ca file.
capathThe location of ca directory

Implemented in Arc::MySQLDatabase.

◆ isconnected()

virtual bool Arc::Database::isconnected ( ) const
pure virtual

Get the connection status.

Implemented in Arc::MySQLDatabase.

◆ shutdown()

virtual bool Arc::Database::shutdown ( )
pure virtual

Ask database server to shutdown.

Implemented in Arc::MySQLDatabase.


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