Module MessageWrapper.Untyped
Contents
Instructions: Use this module in your project
In the IDE (CLion, Visual Studio Code, Xcode, etc.) you use for your DkSDK project:
Add the following to your project's
dependencies/CMakeLists.txt:DkSDKProject_DeclareAvailable(capnp CONSTRAINT "= 3.5.0" FINDLIBS capnp capnp.unix) DkSDKProject_MakeAvailable(capnp)Add the
Findlib::capnplibrary to any desired targets insrc/*/CMakeLists.txt:target_link_libraries(YourPackage_YourLibraryName # ... existing libraries, if any ... Findlib::capnp)Click your IDE's
Buildbutton
Not using DkSDK?
FIRST, do one or all of the following:
Run:
opam install capnp.3.5.0Edit your
dune-projectand add:(package (name YourExistingPackage) (depends ; ... existing dependenices ... (capnp (>= 3.5.0))))Then run:
dune build *.opam # if this fails, run: dune buildEdit your
<package>.opamfile and add:depends: [ # ... existing dependencies ... "capnp" {>= "3.5.0"} ]Then run:
opam install . --deps-only
FINALLY, add the capnp library to any desired (library)and/or (executable) targets in your **/dune files:
(library
(name YourLibrary)
; ... existing library options ...
(libraries
; ... existing libraries ...
capnp))
(executable
(name YourExecutable)
; ... existing executable options ...
(libraries
; ... existing libraries ...
capnp))typeabstract_method_t
An untyped method. This will typically be something like
'a reader_t -> 'b StructRef.t. i.e. the result of calling an
interface's method is a promise for the future result.
valabstract_method : ``('aStructStorage.reader_t,'b)``Service.method_t->abstract_method_t
Cast a method to abstract_method_t. Typically this will be the
identity function. This is used in the generated code to ensure that all
methods have the same type for the dispatch function.
valstruct_field :'aStructRef.t->``int->'bStructRef.t
struct_field t i is a reference to the struct found at pointer index
i within the struct t. Used to implement the "_pipelined"
accessors.
valcapability_field :'aStructRef.t->``int->'bCapability.t
capability_field t i is a reference to the capability found at pointer
index i within the struct t. Used to implement the "_pipelined"
accessors.
classtypegeneric_service=object...end
vallocal :generic_service->'aCapability.t
local service is a capability reference to a local service implemented
by service#dispatch. Used by the generated functions with the same
name (but a fixed type).
valget_cap :MessageSig.attachments->Stdint.Uint32.t->'aCapability.t
Used in the generated code to get a capability from the attachments by index.
valadd_cap :MessageSig.attachments->'aCapability.t->Stdint.Uint32.t
Used in the generated code to store a capability in the attachments. Returns the new index.
valclear_cap :MessageSig.attachments->Stdint.Uint32.t->unit
Remove a capability from the attachments. Used if the interface is changed.
valunknown_interface : ``interface_id:Stdint.Uint64.t->abstract_method_t
Used to handle calls when the interface ID isn't known.
valunknown_method : ``interface_id:Stdint.Uint64.t->``method_id:int->abstract_method_t
Used to handle calls when the method ID isn't known.
