Releases: jharmer95/rpc.hpp
Alpha 2-3
- 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 bufferd
: An array containing the current serialized values (there is a specialization forchar[]
being represented as a string)
- Pointers are now serialized to an object with two fields:
Alpha 2-2
- 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
- To call functions with pointer parameters, the macro
- Also improves the build experience w/ Conan and addresses the incompatibility with Catch v3
Alpha 2-1
- 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
This release includes:
- A bugfix for
const char*
that tried to reassign to a const pointer, now treats it as a normalchar*
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
- This macro call replaces instantiating the
-
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 dispatcherRPC_ALIAS_FUNC
takes a function name and an "alias" string (no quotes) that can be used to also call that functionRPC_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
orRPC_ATTACH_FUNCS
) or 20 aliases to be added at one time (viaRPC_MULTI_ALIAS_FUNC
), but if more are needed, a python scriptdispatch_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
This release adds a few new features:
- New API:
- Functions like
run
,dispatch
,run_callback
, etc. now return a new class calledfunc_result
and take a new class calledfunc_call
as a parameterfunc_result
contains the return value and the value of any parameters of a function post-callfunc_call
contains the function name and the values of the parameters pre-call
package
now returns afunc_call
- Functions like
- Under the hood:
arg_buffer
s 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
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 calldispatch
andrun_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)
- This object can then be passed to
run_object
andrun_string
are introduced to dispatch based on a serial object and string representation of a serial object, respectivelyrun
functions andpackage
can now be called asynchronously usingasync_run
andasync_package
- Bug fix for passing a character array as a parameter
- Ability to generate doxygen documents
Alpha 1-6
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
This release represents a cleaned-up, more consistent codebase with some very minor (mostly name-only) API changes.
Alpha 1-4
This release fixes some bugs:
- Returning objects with de-allocated strings
- Only returning the first
char
of achar*
- 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
- Non implemented functions now protected by
- Can now call
rpc::Run<>()
with a string (added astring_view
overload)
Alpha 1-3
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.