blob: de2bea7edaf044d153ed783c0cadbfac4c717b36 [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
E. Scott Danielsb7a4b522019-11-07 15:35:17 -0500273.7+) and with the Python *ctypes* library.
E. Scott Daniels392168d2019-11-06 15:12:38 -050028
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
E. Scott Danielsb7a4b522019-11-07 15:35:17 -050035to NNG (Nanomsg Next Generation). Because RMR presents the
E. Scott Daniels392168d2019-11-06 15:12:38 -050036same 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
E. Scott Danielsb7a4b522019-11-07 15:35:17 -050054 Nanomsg library. (Nanomsg has been deprecated, but the RMR
55 source remains as an example.)
E. Scott Daniels392168d2019-11-06 15:12:38 -050056
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
E. Scott Danielsb7a4b522019-11-07 15:35:17 -050068truely internal RMR functions was made, and as a result most
E. Scott Daniels392168d2019-11-06 15:12:38 -050069of the RMR functions carry a static label. In order to
E. Scott Danielsb7a4b522019-11-07 15:35:17 -050070modularise the code as much as possible, this means that the
71primary module (e.g. rmr_nng.c) will directly include other
72RMR modules, rather than depending on referencing the
73internal functions during linking. While this is an
74infrequently used approach, it does mean that there are very
75few functions visible for the user application to reference,
76all of them having the prefix rmr\_, while allowing internal
77functions to have shorter names while still being meaningful.
E. Scott Daniels392168d2019-11-06 15:12:38 -050078
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
E. Scott Danielsb7a4b522019-11-07 15:35:17 -050086alternatives are not frowned upon. When creating new modules,
E. Scott Daniels392168d2019-11-06 15:12:38 -050087select 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.