QDMI Devices v0.1
Quantum Device Management Interface Devices
Loading...
Searching...
No Matches
DCDB_QDMI_Device_Session_impl_d Struct Reference

The implementation of the encapsulated type QDMI_Device_Session on the device-side. More...

#include <session.h>

Public Member Functions

void setHostnameAndPort (const std::string &baseUrl)
 Public function to set hostname and port number for the DCDB server.
 
void setUsername (const std::string &new_username)
 Set the username for authentication.
 
void setPassword (const std::string &new_password)
 Set the password for authentication.
 
DCDB::Connection * getConnection ()
 Get function for the underlying connection object.
 
int connect ()
 Public function to connect to the DCDB server.
 
void disconnect ()
 Disconnect and clean up the session.
 
void setStatus (DCDB_QDMI_DEVICE_SESSION_STATUS _status)
 Set the session's status.
 
DCDB_QDMI_DEVICE_SESSION_STATUS getStatus ()
 Get function for the current session status.
 
 ~DCDB_QDMI_Device_Session_impl_d ()
 Destructor.
 

Private Member Functions

int connect (std::string hostname, uint16_t port, std::string username, std::string password)
 Internal connection method using provided parameters.
 
void setHostname (const std::string &new_hostname)
 Set a hostname for the session.
 
void setPort (const uint16_t new_port)
 Set a port for the session.
 

Private Attributes

std::string hostname = "stor"
 Hostname of the DCDB server.
 
uint16_t port = 9042
 Port number of the DCDB server.
 
std::string username = ""
 Username used for authentication.
 
std::string password = ""
 Password used for authentication.
 
DCDB::Connection * connection = nullptr
 Pointer to the underlying DCDB connection object.
 
DCDB_QDMI_DEVICE_SESSION_STATUS status
 Current status of the session.
 

Detailed Description

The implementation of the encapsulated type QDMI_Device_Session on the device-side.

Implemented to hold all the required configuration and functions to connect the DCDB host at LRZ.

Note
QDMI_Device_Session is encapsulated in the QDMI Device Session Interface to allow the device implement the type as needed.

Member Function Documentation

◆ connect() [1/2]

int DCDB_QDMI_Device_Session_impl_d::connect ( std::string hostname,
uint16_t port,
std::string username,
std::string password )
private

Internal connection method using provided parameters.

Parameters
[in]hostnameThe base url to be connected
[in]portThe port to be connected
[in]usernameThe username to be used for authentication
[in]passwordThe password to be used for authentication
Returns
QDMI_SUCCESS if the connection established successfully.
QDMI_ERROR_FATAL if the connection is failed to established.

◆ setHostname()

void DCDB_QDMI_Device_Session_impl_d::setHostname ( const std::string & new_hostname)
inlineprivate

Set a hostname for the session.

Parameters
[in]new_hostnameThe hostname to be set

◆ setPort()

void DCDB_QDMI_Device_Session_impl_d::setPort ( const uint16_t new_port)
inlineprivate

Set a port for the session.

Parameters
[in]new_portThe port to be set

◆ setHostnameAndPort()

void DCDB_QDMI_Device_Session_impl_d::setHostnameAndPort ( const std::string & baseUrl)

Public function to set hostname and port number for the DCDB server.

This function calls privated functions setHostname and setPort. Set values are used to connect to the DCDB server using DCDB_QDMI_Device_Session_impl_d::connect

Parameters
[in]baseUrlThe base url to be set, i.e, example:8080

◆ setUsername()

void DCDB_QDMI_Device_Session_impl_d::setUsername ( const std::string & new_username)
inline

Set the username for authentication.

Parameters
[in]new_usernameThe username to be set, i.e, admin

◆ setPassword()

void DCDB_QDMI_Device_Session_impl_d::setPassword ( const std::string & new_password)
inline

Set the password for authentication.

Parameters
[in]new_passwordThe password to be set.

◆ getConnection()

DCDB::Connection * DCDB_QDMI_Device_Session_impl_d::getConnection ( )
inline

Get function for the underlying connection object.

Returns
the underlying connection object

◆ connect() [2/2]

int DCDB_QDMI_Device_Session_impl_d::connect ( )
inline

Public function to connect to the DCDB server.

This function calls the privated function DCDB_QDMI_Device_Session_impl_d::connect with set parameters using the DCDB_QDMI_device_session_set_parameter

Returns
QDMI_SUCCESS if the connection established successfully.
QDMI_ERROR_FATAL if
  • connection is not NULL,
  • connection is failed to established.

◆ setStatus()

void DCDB_QDMI_Device_Session_impl_d::setStatus ( DCDB_QDMI_DEVICE_SESSION_STATUS _status)
inline

Set the session's status.

Parameters
[in]_statusThe status to be set.

◆ getStatus()

DCDB_QDMI_DEVICE_SESSION_STATUS DCDB_QDMI_Device_Session_impl_d::getStatus ( )
inline

Get function for the current session status.

Returns
The current session status

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