The unmodified publication example generated by rtiddsgen using the C++11 option for the -language flag.
- See Also
 - Publication Example
 
#include <iostream>
#include <dds/pub/ddspub.hpp>
#include <rti/util/util.hpp> 
#include "Foo.hpp"
void publisher_main(
int domain_id, 
int sample_count)
 
{
    
    
    
    MyOtherType sample;
    for (int count = 0; count < sample_count || sample_count == 0; count++) {
        
        std::cout << "Writing MyOtherType, count " << count << std::endl;
    }
}
int main(int argc, char *argv[])
{
    int sample_count = 0; 
    if (argc >= 2) {
        domain_id = atoi(argv[1]);
    }
    if (argc >= 3) {
        sample_count = atoi(argv[2]);
    }
    
    
    
    try {
        publisher_main(domain_id, sample_count);
    } catch (const std::exception& ex) {
        
        std::cerr << "Exception in publisher_main(): " << ex.what() << std::endl;
        return -1;
    }
    
    
    
    
    
    return 0;
}