summaryrefslogtreecommitdiffstats
path: root/testing/037_msc.cpp
blob: a3c0e4b5fb65960896631a79fa3a044c2c0da6dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// objective: test the \msc and \endmsc commands
// check: class_sender.xml
// check: class_receiver.xml
// check: 037__msc_8cpp.xml

/** \file
 * A bit more complex msc diagram, with also parallel events.
 * \msc
 * Sender_1,Receiver_1,Sender1_1,
 * Sender,Receiver,Sender1,
 * Sender_2,Receiver_2,Sender1_2;
 * 
 * Sender_1->Receiver_1 [label="Command()", URL="nref Receiver::Command()"],
 * Sender1_1<-Receiver_1 [label="Ack()", URL="nref Ack()", ID="1"];
 * 
 * Sender->Receiver [label="Command()", URL="nref Receiver::Command()"];
 * Sender1<-Receiver [label="Ack()", URL="nref Ack()", ID="1"];
 * Sender_2->Receiver_2 [label="Command()", URL="nref Receiver::Command()"],
 * Sender1_2<-Receiver_2 [label="Ack()", URL="nref Ack()", ID="1"];
 * \endmsc
 */

/** Sender class. Can be used to send a command to the server.
 *  The receiver will acknowledge the command by calling Ack().
 *  \msc
 *    Sender,Receiver;
 *    Sender->Receiver [label="Command()", URL="\ref Receiver::Command()"];
 *    Sender<-Receiver [label="Ack()", URL="\ref Ack()", ID="1"];
 *  \endmsc
 */
class Sender
{
  public:
    /** Acknowledgement from server */
    void Ack(bool ok);
};

/** Receiver class. Can be used to receive and execute commands.
 *  After execution of a command, the receiver will send an acknowledgement
 *  \msc
 *    Receiver,Sender;
 *    Receiver<-Sender [label="Command()", URL="\ref Command()"];
 *    Receiver->Sender [label="Ack()", URL="\ref Sender::Ack()", ID="1"];
 *  \endmsc
 */
class Receiver
{
  public:
    /** Executable a command on the server */
    void Command(int commandId);
};