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

#include <api_e2e_utils.h>

Public Member Functions

 API_TEST_CLIENT ()
 
bool Connect (const wxString &aSocketUrl)
 
void Disconnect ()
 
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 CreateDocument (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)
 
bool CloseAllDocuments ()
 
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

bool send (const google::protobuf::Message &aRequest, kiapi::common::ApiResponse &aResponse)
 

Private Attributes

KICAD_API_CLIENT m_client
 
wxString m_lastError
 

Detailed Description

Definition at line 108 of file api_e2e_utils.h.

Constructor & Destructor Documentation

◆ API_TEST_CLIENT()

API_TEST_CLIENT::API_TEST_CLIENT ( )
inline

Definition at line 111 of file api_e2e_utils.h.

References m_client.

Member Function Documentation

◆ CloseAllDocuments()

bool API_TEST_CLIENT::CloseAllDocuments ( )
inline

Definition at line 341 of file api_e2e_utils.h.

References send().

Referenced by API_SERVER_E2E_FIXTURE::~API_SERVER_E2E_FIXTURE().

◆ CloseDocument()

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

Definition at line 316 of file api_e2e_utils.h.

References m_lastError, and send().

◆ Connect()

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

Definition at line 113 of file api_e2e_utils.h.

References m_client.

◆ CreateDocument()

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

Definition at line 189 of file api_e2e_utils.h.

References m_lastError, and send().

◆ Disconnect()

void API_TEST_CLIENT::Disconnect ( )
inline

Definition at line 114 of file api_e2e_utils.h.

References m_client.

◆ GetFirstFootprint()

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

Definition at line 264 of file api_e2e_utils.h.

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

◆ GetItemsCount()

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

Definition at line 227 of file api_e2e_utils.h.

References m_lastError, and send().

◆ GetVersion()

bool API_TEST_CLIENT::GetVersion ( )
inline

Definition at line 132 of file api_e2e_utils.h.

References m_lastError, and send().

◆ LastError()

const wxString & API_TEST_CLIENT::LastError ( ) const
inline

Definition at line 116 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 222 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 157 of file api_e2e_utils.h.

References m_lastError, and send().

Referenced by OpenDocument().

◆ Ping()

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

Definition at line 118 of file api_e2e_utils.h.

References send().

◆ 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 353 of file api_e2e_utils.h.

References m_lastError, send(), and T.

◆ send()

bool API_TEST_CLIENT::send ( const google::protobuf::Message & aRequest,
kiapi::common::ApiResponse & aResponse )
inlineprivate

◆ SendCommand()

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

Definition at line 376 of file api_e2e_utils.h.

References send(), and T.

Referenced by SendGetBoardDesignRules(), and SendGetCustomDesignRules().

Member Data Documentation

◆ m_client

KICAD_API_CLIENT API_TEST_CLIENT::m_client
private

Definition at line 393 of file api_e2e_utils.h.

Referenced by API_TEST_CLIENT(), Connect(), Disconnect(), and send().

◆ m_lastError

wxString API_TEST_CLIENT::m_lastError
private

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