Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions examples/connext_dds/asynchronous_publication/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void run_publisher_application(
std::cout << "Writing async, count " << samples_written << std::endl;

// Send count as data
instance.x(samples_written);
instance.x = samples_written;

// Send it, if using instance_handle:
// writer.write(instance, instance_handle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int process_data(dds::sub::DataReader<async> reader)
double elapsed_ticks = clock() - InitTime;
double elapsed_secs = elapsed_ticks / CLOCKS_PER_SEC;
std::cout << "@ t=" << elapsed_secs << "s"
<< ", got x = " << sample.data().x() << std::endl;
<< ", got x = " << sample.data().x << std::endl;
} else {
std::cout << "Instance state changed to "
<< sample.info().state().instance_state() << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ AwsPublisher::AwsPublisher(
dds::pub::Publisher(participant),
topic);
// set sample key value:
sample_.key(publisher_id);
sample_.key = publisher_id;


// Send condition: to generate application-driven events to send samples
Expand All @@ -107,8 +107,8 @@ void AwsPublisher::generate_send_event()

void AwsPublisher::send_sample()
{
std::cout << "Send Sample: " << sample_.number() << std::endl;
sample_.number(sample_.number() + 1);
std::cout << "Send Sample: " << sample_.number << std::endl;
sample_.number = sample_.number + 1;
sender_.write(sample_);
}

Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/asyncwaitset/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
17 changes: 17 additions & 0 deletions examples/connext_dds/batching/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive CMakeLists.txt script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void run_publisher_application(
!application::shutdown_requested && samples_written < sample_count;
samples_written++) {
// Modify the data to be written here
sample.x(samples_written);
sample.x = samples_written;

std::cout << "Writing batch_data, count " << samples_written
<< std::endl;
Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/builtin_qos_profiles/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void run_publisher_application(int domain_id, int sample_count)
!application::shutdown_requested && samples_written < sample_count;
samples_written++) {
// Modify the data to be written here
instance.msg("Hello World!");
instance.msg = "Hello World!";

std::cout << "Writing HelloWord, count " << samples_written
<< std::endl;
Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/builtin_topics/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void run_publisher_application(
std::cout << "Writing msg, count " << samples_written << std::endl;

// Send count as data
instance.x(samples_written);
instance.x = samples_written;

// Send it, if using instance_handle:
// writer.write(instance, instance_handle);
Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/coherent_presentation/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void run_publisher_application(
dds::pub::DataWriter<coherent> writer(publisher, topic, writer_qos);

coherent sample;
sample.id(0);
sample.id = 0;
dds::core::InstanceHandle handle = writer.register_instance(sample);

int num_samples = 7;
Expand All @@ -65,10 +65,10 @@ void run_publisher_application(
for (int i = 0; i < num_samples; i++, count++) {
rti::util::sleep(dds::core::Duration(1));

sample.field('a' + i);
sample.value((int) (rand() / (RAND_MAX / 10.0)));
std::cout << "\tUpdating instance, " << sample.field() << "->"
<< sample.value() << std::endl;
sample.field = 'a' + i;
sample.value = (int) (rand() / (RAND_MAX / 10.0));
std::cout << "\tUpdating instance, " << sample.field << "->"
<< sample.value << std::endl;
writer.write(sample, handle);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int process_data(dds::sub::DataReader<coherent> reader)
rti::sub::valid_samples(samples.end()),
std::inserter(values, values.begin()),
[](const coherent &data) {
return std::make_pair(data.field(), data.value());
return std::make_pair(data.field, data.value);
});
std::cout << std::endl;

Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/compression/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ void run_publisher_application(
std::string new_line;
while (!std::getline(fileToCompress, new_line).eof()) {
StringLine new_sample;
new_sample.str(new_line);
new_sample.str = new_line;
samples.push_back(new_sample);
}
} else {
// Create a sample fill with 1024 zeros to send if no file has been
// provided
StringLine new_sample;
new_sample.str(std::string(1024, '0'));
new_sample.str = std::string(1024, '0');
samples.push_back(new_sample);
}

Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/content_filtered_topic/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ void run_publisher_application(
// reset the x counter to 0 every time we send 10 samples (x=0,1,..,9).
// Using the value of count, we can get set x to the appropriate value
// applying % 10 operation to it.
instance.count(samples_written);
instance.x(samples_written % 10);
instance.count = samples_written;
instance.x = samples_written % 10;

std::cout << "Writing cft, count " << instance.count() << "\t"
<< "x=" << instance.x() << std::endl;
std::cout << "Writing cft, count " << instance.count << "\t"
<< "x=" << instance.x << std::endl;

writer.write(instance, instance_handle);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ void run_publisher_application(
std::cout << "Writing cft, count " << samples_written << std::endl;

// Modify sample data
sample.count(samples_written);
sample.count = samples_written;
if (samples_written % 2 == 1) {
sample.name("ODD");
sample.name = "ODD";
} else {
sample.name("EVEN");
sample.name = "EVEN";
}

writer.write(sample);
Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/custom_content_filter/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void run_publisher_application(
!application::shutdown_requested && samples_written < sample_count;
samples_written++) {
std::cout << "Writing ccf, count " << samples_written << std::endl;
instance.x(samples_written);
instance.x = samples_written;
writer.write(instance);

rti::util::sleep(dds::core::Duration(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CustomFilterType
const Foo &sample,
const rti::topic::FilterSampleInfo &meta_data)
{
return compile_data.eval_func(sample.x(), compile_data.param);
return compile_data.eval_func(sample.x, compile_data.param);
}

virtual void finalize(CustomCompileData &compile_data)
Expand Down
17 changes: 17 additions & 0 deletions examples/connext_dds/custom_flow_controller/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,20 @@ using CMake, please refer to the
[hello_world](../../../connext_dds/build_systems/cmake/) example, which includes
a comprehensive `CMakeLists.txt` script with all the steps and instructions
described in detail.


## Troubleshooting

### Compilation fails accessing struct field

If the code compilation fails with errors such as "reference to non-static member
function must be called" for code such as `my_sample.my_field = value` or
`value = my_sample.my_field` this means that the rtiddsgen version you are using
doesn't have the IDL4 C++ mapping enabled by default.

To fix it, upgrade your Connext version to 7.6+ or check out the branch for the
Connext version you're using, e.g.

```sh
git checkout release/7.3.0
```
Loading
Loading