blob: 151a6f4fc55379bcb749718edef81e271f67428d [file] [log] [blame]
E. Scott Daniels392168d2019-11-06 15:12:38 -05001
2.. This work is licensed under a Creative Commons Attribution 4.0 International License.
3.. SPDX-License-Identifier: CC-BY-4.0
4.. CAUTION: this document is generated from source in doc/src/rtd.
5.. To make changes edit the source and recompile the document.
6.. Do NOT make changes directly to .rst or .md files.
7
8
9RMR Developer Guide
10============================================================================================
11
12The RIC Message Router (RMR) is a library which applications
13use to send and receive messages where the message routing,
14endpoint selection, is based on the message type rather than
15on traditional DNS names or IP addresses. This document
16contains information that potential developers might need to
17know in order to contribute to the project
18
19Language
20--------------------------------------------------------------------------------------------
21
22RMR is written in C, and thus a contributing developer to the
23core library should have an excellent working knowledge of C.
24There currently is one set of cross languages bindings
25supporting Python, and a developer wishing to contribute to
26the bindings source should be familiar with Python (version
273.7+) and with the Ptyhhon *ctypes* library.
28
29Code Structure
30--------------------------------------------------------------------------------------------
31
32RMR is designed to provide an insulation layer between user
33applications and the actual transport mechanism. Initially
34RMR was built on top of Nanosmg, and shortly after was ported
35to NNG (Nanomsg Next Generation). Becuase RMR presents the
36same API to the user application regardless of the underlying
37transport library, the resulting output when compiling RMR is
38a transport specific library. As an example, librmr_nng.a is
39the library generated for use with the NNG transport.
40
41As such the library source is organised into multiple
42components:
43
44
45common
46
47 Source in the common directory is agnostic to the
48 underlying transport mechanism (Nanomsg or NNG), and thus
49 can be used when generating either library.
50
51nano
52
53 Source which is tightly coupled with the underlying
54 Nanomsg library. (Nanomsg has been dreprecated, but the
55 RMR source remains as an example.)
56
57nng
58
59 Source which is tightly coupled with the underlying NNG
60 library.
61
62
63
64Internal Function Exposure
65~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66
67The decision to limit as much as practical the exposure of
68truely interal RMR functions was made, and as a result most
69of the RMR functions carry a static label. In order to
70modularlise the code as much as possible, this means that the
71primary module (e.g. rmr_nng.c) will driectly include other
72RMR modules, rather than depending on referencing the interal
73functions during linking. While this is an infrequenly used
74approach, it does mean that there are very few functions
75visible for the user application to reference, all of them
76having the prefix rmr_, while allowing internal functions to
77have shorter names while still being meaningful.
78
79Coding Style
80--------------------------------------------------------------------------------------------
81
82There is a list of coding style guidelines in the top level
83directory, and as such they are not expanded upon here. The
84general practice is to follow the style when editing an
85existing module, respect the author's choice where style
86alternatves are not frowned upon. When creating new modules,
87select a style that fits the guidelines and is easy for you
88to work with. There are a few things that are insisted on by
89the maintainers of RMR, but for the most part style is up to
90the creator of a module.
91
92Building
93--------------------------------------------------------------------------------------------
94
95RMR is constructed using CMake. While CMake's project
96description can be more cumbersome than most typical
97Makefiles, the tool provides convenience especially when it
98comes to creating packages.