Add user guide
[ric-plt/xapp-frame-cpp.git] / doc / src / user / example2.im
1 .if false
2 ==================================================================================
3     Copyright (c) 2020 Nokia
4     Copyright (c) 2020 AT&T Intellectual Property.
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18 .fi
19
20 &h2(Callback Receiver)
21 This sample programme implements a simple message listener which
22 registers three callback functions to process two specific
23 message types and a default callback to handle unrecognised messages.
24
25 &space
26 When a message of type 1 is received, it will send two response messages
27 back to the sender.
28 Two messages are sent in order to illustrate that it is possible to
29 send multiple responses using the same received message.
30
31 &space
32 The programme illustrates how multiple listening threads can be
33 used, but the programme is &bold(not) thread safe; to keep
34 this example as simple as possible, the counters
35 are not locked when incremented.
36
37 &space
38 &indent
39 .** pull in the code from the example directory
40 &ex_start
41 .im  j=start-example ../../../examples/xapp_t1.cpp
42 &ex_end
43 &figure( Simple callback application. )
44 &uindent
45 &space