KiCad PCB EDA Suite
Loading...
Searching...
No Matches
API_TEST_CLIENT Class Reference

#include <api_e2e_utils.h>

Public Member Functions

 API_TEST_CLIENT ()
 
 ~API_TEST_CLIENT ()
 
bool Connect (const wxString &aSocketUrl)
 
const wxString & LastError () const
 
bool Ping (kiapi::common::ApiStatusCode *aStatusOut=nullptr)
 
bool GetVersion ()
 
bool OpenDocument (const wxString &aPath, kiapi::common::types::DocumentType aType, kiapi::common::types::DocumentSpecifier *aDocument=nullptr)
 
bool OpenDocument (const wxString &aPath, kiapi::common::types::DocumentSpecifier *aDocument=nullptr)
 
bool GetItemsCount (const kiapi::common::types::DocumentSpecifier &aDocument, kiapi::common::types::KiCadObjectType aType, int *aCount)
 
bool GetFirstFootprint (const kiapi::common::types::DocumentSpecifier &aDocument, FOOTPRINT *aFootprint)
 
bool CloseDocument (const kiapi::common::types::DocumentSpecifier *aDocument, kiapi::common::ApiStatusCode *aStatus=nullptr)
 
template<typename T>
bool RunJob (const T &aJobRequest, kiapi::common::types::RunJobResponse *aResponse)
 Send an arbitrary job request and receive a RunJobResponse.
 
template<typename T>
bool SendCommand (const T &aMessage, kiapi::common::ApiResponse *aResponse)
 

Private Member Functions

template<typename T>
bool sendCommand (const T &aMessage, kiapi::common::ApiResponse *aResponse)
 

Private Attributes

nng_socket m_socket
 
bool m_isOpen = false
 
bool m_isConnected = false
 
wxString m_lastError
 

Detailed Description

Definition at line 105 of file api_e2e_utils.h.

Constructor & Destructor Documentation

◆ API_TEST_CLIENT()

API_TEST_CLIENT::API_TEST_CLIENT ( )
inline

Definition at line 108 of file api_e2e_utils.h.

References m_isOpen, m_lastError, and m_socket.

◆ ~API_TEST_CLIENT()

API_TEST_CLIENT::~API_TEST_CLIENT ( )
inline

Definition at line 125 of file api_e2e_utils.h.

References m_isOpen, and m_socket.

Member Function Documentation

◆ CloseDocument()

bool API_TEST_CLIENT::CloseDocument ( const kiapi::common::types::DocumentSpecifier * aDocument,
kiapi::common::ApiStatusCode * aStatus = nullptr )
inline

Definition at line 319 of file api_e2e_utils.h.

References m_lastError, and sendCommand().

◆ Connect()

bool API_TEST_CLIENT::Connect ( const wxString & aSocketUrl)
inline

Definition at line 131 of file api_e2e_utils.h.

References m_isConnected, m_isOpen, m_lastError, and m_socket.

◆ GetFirstFootprint()

bool API_TEST_CLIENT::GetFirstFootprint ( const kiapi::common::types::DocumentSpecifier & aDocument,
FOOTPRINT * aFootprint )
inline

Definition at line 267 of file api_e2e_utils.h.

References FOOTPRINT::Deserialize(), m_lastError, and sendCommand().

◆ GetItemsCount()

bool API_TEST_CLIENT::GetItemsCount ( const kiapi::common::types::DocumentSpecifier & aDocument,
kiapi::common::types::KiCadObjectType aType,
int * aCount )
inline

Definition at line 230 of file api_e2e_utils.h.

References m_lastError, and sendCommand().

◆ GetVersion()

bool API_TEST_CLIENT::GetVersion ( )
inline

Definition at line 167 of file api_e2e_utils.h.

References m_lastError, and sendCommand().

◆ LastError()

const wxString & API_TEST_CLIENT::LastError ( ) const
inline

Definition at line 151 of file api_e2e_utils.h.

References m_lastError.

Referenced by SendGetBoardDesignRules(), and SendGetCustomDesignRules().

◆ OpenDocument() [1/2]

bool API_TEST_CLIENT::OpenDocument ( const wxString & aPath,
kiapi::common::types::DocumentSpecifier * aDocument = nullptr )
inline

Definition at line 225 of file api_e2e_utils.h.

References OpenDocument().

◆ OpenDocument() [2/2]

bool API_TEST_CLIENT::OpenDocument ( const wxString & aPath,
kiapi::common::types::DocumentType aType,
kiapi::common::types::DocumentSpecifier * aDocument = nullptr )
inline

Definition at line 192 of file api_e2e_utils.h.

References m_lastError, and sendCommand().

Referenced by OpenDocument().

◆ Ping()

bool API_TEST_CLIENT::Ping ( kiapi::common::ApiStatusCode * aStatusOut = nullptr)
inline

Definition at line 153 of file api_e2e_utils.h.

References sendCommand().

◆ RunJob()

template<typename T>
bool API_TEST_CLIENT::RunJob ( const T & aJobRequest,
kiapi::common::types::RunJobResponse * aResponse )
inline

Send an arbitrary job request and receive a RunJobResponse.

Definition at line 348 of file api_e2e_utils.h.

References m_lastError, sendCommand(), and T.

◆ SendCommand()

template<typename T>
bool API_TEST_CLIENT::SendCommand ( const T & aMessage,
kiapi::common::ApiResponse * aResponse )
inline

Definition at line 371 of file api_e2e_utils.h.

References sendCommand(), and T.

Referenced by SendGetBoardDesignRules(), and SendGetCustomDesignRules().

◆ sendCommand()

template<typename T>
bool API_TEST_CLIENT::sendCommand ( const T & aMessage,
kiapi::common::ApiResponse * aResponse )
inlineprivate

Member Data Documentation

◆ m_isConnected

bool API_TEST_CLIENT::m_isConnected = false
private

Definition at line 439 of file api_e2e_utils.h.

Referenced by Connect(), and sendCommand().

◆ m_isOpen

bool API_TEST_CLIENT::m_isOpen = false
private

Definition at line 438 of file api_e2e_utils.h.

Referenced by API_TEST_CLIENT(), Connect(), and ~API_TEST_CLIENT().

◆ m_lastError

wxString API_TEST_CLIENT::m_lastError
private

◆ m_socket

nng_socket API_TEST_CLIENT::m_socket
private

Definition at line 437 of file api_e2e_utils.h.

Referenced by API_TEST_CLIENT(), Connect(), sendCommand(), and ~API_TEST_CLIENT().


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