MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / PrintSampleInfo

Function PrintSampleInfo

tests/DCPS/common/SampleInfo.cpp:20–96  ·  view source on GitHub ↗

* Print sample info */

Source from the content-addressed store, hash-verified

18 * Print sample info
19 */
20void PrintSampleInfo(const ::DDS::SampleInfo& si)
21{
22 std::string out;
23
24 switch (si.sample_state)
25 {
26 case ::DDS::READ_SAMPLE_STATE:
27 out = "READ_SAMPLE_STATE";
28 break;
29
30 case ::DDS::NOT_READ_SAMPLE_STATE:
31 out = "NOT_READ_SAMPLE_STATE";
32 break;
33 }
34 out = " sample_state: " + out + "\n";
35
36 std::string tmp;
37
38 switch(si.view_state)
39 {
40 case ::DDS::NEW_VIEW_STATE:
41 tmp = "NEW_VIEW_STATE";
42 break;
43
44 case ::DDS::NOT_NEW_VIEW_STATE:
45 tmp = "NOT_NEW_VIEW_STATE";
46 break;
47 }
48 out += " view_state: " + tmp + "\n";
49
50 tmp = "";
51
52 switch(si.instance_state)
53 {
54 case ::DDS::ALIVE_INSTANCE_STATE:
55 tmp = "ALIVE_INSTANCE_STATE";
56 break;
57
58 case ::DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE:
59 tmp = "NOT_ALIVE_DISPOSED_INSTANCE_STATE";
60 break;
61
62 case ::DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE:
63 tmp = "NOT_ALIVE_NO_WRITERS_INSTANCE_STATE";
64 break;
65 }
66 out += " instance_state: " + tmp + "\n";
67
68 char buf[512];
69
70 ACE_OS::snprintf(buf, sizeof buf, " source_timestamp: %d %d\n",
71 si.source_timestamp.sec, si.source_timestamp.nanosec);
72 out += buf;
73
74 ACE_OS::snprintf(buf, sizeof buf, " instance_handle: %x\n", si.instance_handle);
75 out += buf;
76
77 ACE_OS::snprintf(buf, sizeof buf, " disposed_generation_count: %d\n",

Callers 7

startMethod · 0.85
start1Method · 0.85
start2Method · 0.85
on_data_availableMethod · 0.85
readMethod · 0.85
readMethod · 0.85
SampleInfoMatchesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected