Skip to content

Releases: jharmer95/rpc.hpp

Alpha 2-3

13 Nov 15:49
619d9ef
Compare
Choose a tag to compare
Alpha 2-3 Pre-release
Pre-release
  • This release improves the use of pointers across RPC bounds.
    • Previously, if an array "grew" as the result of a function call, there would be a memory problem
    • Now, using a dynamically-sized array allows for a size smaller than the fixed max capacity
  • NOTE: This change breaks compatibility as there is a new serialization method for pointers:
    • Pointers are now serialized to an object with two fields:
      • c: A 64-bit unsigned integer representing the maximum possible size an array can be. This is set by the client providing a fixed-size array as a buffer
      • d: An array containing the current serialized values (there is a specialization for char[] being represented as a string)

Alpha 2-2

20 Oct 23:24
f64cb89
Compare
Choose a tag to compare
Alpha 2-2 Pre-release
Pre-release
  • Adds support for pointer parameters
    • To call functions with pointer parameters, the macro RPC_HPP_ENABLE_POINTERS must be defined
    • Pointers in your API should be avoided at all costs however as they have overhead and can still result in bounds access errors for clients and servers
  • Also improves the build experience w/ Conan and addresses the incompatibility with Catch v3

Alpha 2-1

09 Sep 20:38
8d37eb7
Compare
Choose a tag to compare
Alpha 2-1 Pre-release
Pre-release
  • Redesign provides a completely new (100% incompatible) API for clients, servers, and adapters
  • Instead of passing around serial objects internally (consuming a lot of CPU time), a single packed_func object is passed by reference to each internal function
  • Adapter for rapidjson now works
    • Adapter interface is more open to future adapters
  • NOTE: with this 0.2 version, pointers are currently NOT SUPPORTED.
    • This is something that will be looked into in the near future.
    • Passing arguments by reference is supported and preferred to pointers

Alpha 1-9

05 Jun 22:10
Compare
Choose a tag to compare
Alpha 1-9 Pre-release
Pre-release

This release includes:

  • A bugfix for const char* that tried to reassign to a const pointer, now treats it as a normal char* for reading
  • Optional helper macros for the rpc::dispatch function instantiation:
    • #include "rpc_dispatch_helper.hpp" to use

    • RPC_DEFAULT_DISPATCH takes a list of function names (no quotes) and generates the whole dispatch function, binding the functions in the list to the dispatcher

      • This macro call replaces instantiating the rpc::dispatch function, but is not customizable
      • The default behavior is to exactly match the function name to the function to call and throw an exception if none are matched
    • The following are used within the rpc::dispatch function instantiation:

      • RPC_ATTACH_FUNC attaches a single function to the dispatcher by name (no quotes)
      • RPC_ATTACH_FUNCS attaches a list of function names to the dispatcher
      • RPC_ALIAS_FUNC takes a function name and an "alias" string (no quotes) that can be used to also call that function
      • RPC_MULTI_ALIAS_FUNC takes a function name and at least one alias string (no quotes) and binds all of the aliases to call that function
    • By default, the macro only allows for 20 function to be added at one time (via RPC_DEFAULT_DISPATCH or RPC_ATTACH_FUNCS) or 20 aliases to be added at one time (via RPC_MULTI_ALIAS_FUNC), but if more are needed, a python script dispatch_gen.py can be run with the number of instances you need as a parameter and will generate the header file for you (ex: $ python dispatch_gen.py 50)

Alpha 1-8

08 Feb 05:26
Compare
Choose a tag to compare
Alpha 1-8 Pre-release
Pre-release

This release adds a few new features:

  • New API:
    • Functions like run, dispatch, run_callback, etc. now return a new class called func_result and take a new class called func_call as a parameter
      • func_result contains the return value and the value of any parameters of a function post-call
      • func_call contains the function name and the values of the parameters pre-call
    • package now returns a func_call
  • Under the hood:
    • arg_buffers can now be dynamically re-allocated if it is detected that they are too small
      • This allows for a smaller default size, and thus a smaller memory footprint unless needed
  • Some minor bug fixes/performance improvements

Alpha 1-7

07 Feb 23:14
06c5649
Compare
Choose a tag to compare
Alpha 1-7 Pre-release
Pre-release

This release includes some new features:

  • A new API:
    • run now takes a string with the function name and a variadic list of function parameters and returns a serial object representing the result of the function call
      • dispatch and run_callback have thusly also been changed to accommodate for this
    • A new function package creates a serial object representing a function call
      • This object can then be passed to run_object (probably over a connection to a server)
    • run_object and run_string are introduced to dispatch based on a serial object and string representation of a serial object, respectively
    • run functions and package can now be called asynchronously using async_run and async_package
  • Bug fix for passing a character array as a parameter
  • Ability to generate doxygen documents

Alpha 1-6

31 Jan 22:47
Compare
Choose a tag to compare
Alpha 1-6 Pre-release
Pre-release

This version includes some cleanup and reduced warnings in GCC and adds one new feature: minimal serialization.

Minimal serialization prevents the serialization in the result string for parameters that are irrelevant. These include (using int as the example type):

  • Pass-by-value (int, const int)
  • Pass-by-pointer-to-const (const int*, const int* const)
  • Pass-by-const-ref (const int&)

When using this feature, a user should be careful as there will be omissions in the "args" field, they will have to mentally remove the above mentioned parameter types from the indexing.

This feature can be enabled by putting #define RPC_HPP_SERIAL_MIN BEFORE including rpc.hpp

Alpha 1-5

21 Jan 17:53
Compare
Choose a tag to compare
Alpha 1-5 Pre-release
Pre-release

This release represents a cleaned-up, more consistent codebase with some very minor (mostly name-only) API changes.

Alpha 1-4

17 Jan 15:49
de9ed71
Compare
Choose a tag to compare
Alpha 1-4 Pre-release
Pre-release

This release fixes some bugs:

  • Returning objects with de-allocated strings
  • Only returning the first char of a char*
  • Not properly handling single-value pointers
  • Throwing exceptions for void return functions

This release also improves some performance and readability:

  • Adding noexcept where it makes sense, and a compiler-defined (NOTHROW macro) noexcept pretty much everywhere else
  • More clearly defined the interface for SerialAdapter
    • Non implemented functions now protected by static_assert rather than run-time exceptions
  • Can now call rpc::Run<>() with a string (added a string_view overload)

Alpha 1-3

09 Jan 21:02
Compare
Choose a tag to compare
Alpha 1-3 Pre-release
Pre-release

This release allows for custom serialization. The serial format is now behind a template parameter and is accessed via a SerialAdapter class.

So instead of RunFromJSON(), you call Runnlohmann::json() or whatever serialization type you are using.
You can provide the implementation of the SerialAdapter functions in a header and include it in your program.

Hopefully this is more powerful and still easy to understand.