Skip to content

Conversation

@TysonRayJones
Copy link
Member

@TysonRayJones TysonRayJones commented May 5, 2025

Example PR A

Sub PR 1

This PR demonstrates how to add the user-facing frontend of a new function to the QuEST API. To do so:

  1. declare the function in a quest/include/ header file.
  2. write the function doc above that declaration.
  3. define the function in a corresponding quest/src/api/ file.
  4. define new validation functions as necessary.

This API function should contain only simple logic, and call other internal functions defined in quest/src/core/ files as necessary. It typically resembles

void myFunction(int a, int b) {
     validate_userInput(a, __func__);
     validate_userInput(b, __func__);

    localiser_myFunction(a, b);
}

where validate_userInput() is a function declared in validation.hpp which verifies the user's input satisfies necessary preconditions. The so-far undefined function localiser_myFunction() is the entry-point to the backend of the new function, as explained in the next PR (#608).

It is sometimes necessary to define new internal functions needed by the new API function. These will typically be added to

In this PR, it was necessary to define a new validation function in validation.cpp, and declare it in validation.hpp

@TysonRayJones TysonRayJones added the demo A demonstration of a development process label May 5, 2025
@TysonRayJones TysonRayJones changed the base branch from devel to example-pr May 6, 2025 15:19
@TysonRayJones TysonRayJones deleted the branch example-pr May 6, 2025 15:59
@TysonRayJones TysonRayJones deleted the example-pr-1 branch May 6, 2025 16:15
This was referenced May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo A demonstration of a development process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant