1
1
/*
2
- *
3
- *
4
2
* Distributed under the OpenDDS License.
5
3
* See: http://www.opendds.org/license.html
6
4
*/
9
7
#define MESSENGER_TEST_ARGS_H
10
8
11
9
#include <dds/DCPS/transport/framework/TransportRegistry.h>
12
-
13
10
#include <dds/DCPS/transport/framework/TransportConfig.h>
14
11
#include <dds/DCPS/transport/framework/TransportInst.h>
15
12
18
15
#include <ace/Log_Msg.h>
19
16
#include <ace/OS_NS_stdlib.h>
20
17
18
+ const char * ACTOR_PUBLISHER = "Publisher" ;
19
+ const char * ACTOR_RECORDER = "Recorder" ;
20
+ const char * ACTOR_REPLAYER = "Replayer" ;
21
+ const char * ACTOR_SUBSCRIBER = "Subscriber" ;
22
+
23
+ const char * EVENT_RECORDER_JOINED = "RecorderJoined" ;
24
+ const char * EVENT_RECEIVED_ALL_SAMPLES = "ReceivedAllSamples" ;
25
+ const char * EVENT_SUBSCRIBER_JOINED = "SubscriberJoined" ;
26
+
27
+ const int NUM_SAMPLES = 10 ;
28
+
21
29
inline int
22
30
parse_args (int argc , ACE_TCHAR * argv [])
23
31
{
@@ -29,18 +37,13 @@ parse_args(int argc, ACE_TCHAR *argv[])
29
37
while ((c = get_opts ()) != -1 ) {
30
38
switch (c ) {
31
39
case 't' :
32
-
33
40
if (ACE_OS ::strcmp (get_opts .opt_arg (), ACE_TEXT ("udp" )) == 0 ) {
34
41
transport_type = "udp" ;
35
-
36
42
} else if (ACE_OS ::strcmp (get_opts .opt_arg (), ACE_TEXT ("multicast" )) == 0 ) {
37
43
transport_type = "multicast" ;
38
-
39
44
} else if (ACE_OS ::strcmp (get_opts .opt_arg (), ACE_TEXT ("tcp" )) == 0 ) {
40
45
transport_type = "tcp" ;
41
-
42
46
}
43
-
44
47
break ;
45
48
case 'p' :
46
49
thread_per_connection = true;
@@ -49,7 +52,7 @@ parse_args(int argc, ACE_TCHAR *argv[])
49
52
default :
50
53
ACE_ERROR_RETURN ((LM_ERROR ,
51
54
ACE_TEXT ("usage: %s [-t transport]\n" ), argv [0 ]),
52
- -1 );
55
+ -1 );
53
56
}
54
57
}
55
58
@@ -61,19 +64,16 @@ parse_args(int argc, ACE_TCHAR *argv[])
61
64
}
62
65
63
66
if (thread_per_connection ) {
64
- OpenDDS ::DCPS ::TransportConfig_rch config =
65
- TheTransportRegistry -> fix_empty_default ();
67
+ OpenDDS ::DCPS ::TransportConfig_rch config = TheTransportRegistry -> fix_empty_default ();
66
68
if (config .in () == 0 ) {
67
69
ACE_ERROR_RETURN ((LM_ERROR ,
68
70
ACE_TEXT ("no default config\n" ), argv [0 ]),
69
- -1 );
70
- }
71
- else if (config -> instances_ .size () < 1 ) {
71
+ -1 );
72
+ } else if (config -> instances_ .size () < 1 ) {
72
73
ACE_ERROR_RETURN ((LM_ERROR ,
73
74
ACE_TEXT ("no instances on default config\n" ), argv [0 ]),
74
- -1 );
75
- }
76
- else if (config -> instances_ .size () > 1 ) {
75
+ -1 );
76
+ } else if (config -> instances_ .size () > 1 ) {
77
77
ACE_ERROR ((LM_ERROR ,
78
78
ACE_TEXT ("too many instances on default config, using first\n" ), argv [0 ]));
79
79
}
@@ -84,5 +84,4 @@ parse_args(int argc, ACE_TCHAR *argv[])
84
84
return 0 ;
85
85
}
86
86
87
-
88
87
#endif
0 commit comments