Issue 10763: In section 3.2.3.5 Code example, several typos (data-distribution-rtf) Source: PrismTech (Mr. Erik Hendriks, erik.hendriks(at)prismtech.com) Nature: Uncategorized Issue Severity: Summary: Problem: In section 3.2.3.5 Code example on page 3-74 and 3-75 several typos can be found. It talks about a DLRL module, which should be DDS in the definition of the CacheFactory variable and Cache variable. The create_cache operation is missing a parameter (cache name). The home objects should have their default constructors called. The create_object operations sometimes has a - as seperator instead of a _. The create_object should take a cache access as parameter instead of the cache, this cache access should also be created. The write operation should be performed on the created cache access, not on the cache. The closing }; should also be removed, as it is never opened. The setter operation for the operations are also incorrect. They should be set_x, not x. And the relation has a put operation which does not exist. The first setter for the a_radar attribute should operate on t1, not t2. Solution: Replace: DDS::DomainParticipant_var dp; DLRL::CacheFactory_var cf; /* * Init phase */ DLRL::Cache_var c = cf->create_cache (WRITE_ONLY, dp); RadarHome_var rh; TrackHome_var th; Track3DHome_var t3dh; c->register_home (rh); c->register_home (th); c->register_home (t3dh); c->register_all_for_pubsub(); // some QoS settings if needed c->enable_all_for_pubsub(); /* * Creation, modifications and publication */ Radar_var r1 = rh->create_object(c); Track_var t1 = th->create-object (c); Track3D_var t2 = t3dh->create-object (c); t1->w(12);// setting of a pure local attribute t1->x(1000.0);// some DLRL attributes settings t1->y(2000.0); t2->a_radar->put(r1);// modifies r1->tracks accordingly t2->x(1000.0); t2->y(2000.0); t2->z(3000.0); t2->a_radar->put(r1);// modifies r1->tracks accordingly c->write();// all modifications are published }; With: DDS::DomainParticipant_var dp; DDS::CacheFactory_var cf; /* * Init phase */ DDS::Cache_var c = cf->create_cache ("a_cache", WRITE_ONLY, dp); RadarHome_var rh = new RadarHome(); TrackHome_var th = new TrackHome(); Track3DHome_var t3dh = new Track3DHome(); c->register_home (rh); c->register_home (th); c->register_home (t3dh); c->register_all_for_pubsub(); // some QoS settings if needed c->enable_all_for_pubsub(); /* * Creation, modifications and publication */ DDS:CacheAccess_var ca = c->create_access(WRITE_ONLY); Radar_var r1 = rh->create_object(ca); Track_var t1 = th->create_object (ca); Track3D_var t2 = t3dh->create_object (ca); t1->w(12);// setting of a pure local attribute t1->set_x(1000.0);// some DLRL attributes settings t1->set_y(2000.0); t1->set_a_radar(r1);// modifies r1->tracks accordingly t2->set_x(1000.0); t2->set_y(2000.0); t2->set_z(3000.0); t2->set_a_radar(r1);// modifies r1->tracks accordingly ca->write();// all modifications are published Resolution: Revised Text: Actions taken: February 14, 2007: received issue Discussion: End of Annotations:===== iler: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Wed, 14 Feb 2007 13:02:02 -0500 To: issues@omg.org, data-distribution-rtf@omg.org From: Juergen Boldt Subject: issue 10763 -- DDS RTF issue X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at omg.org This is issue # 10763 From: "Erik Hendriks" In section 3.2.3.5 Code example, several typos Problem: In section 3.2.3.5 Code example on page 3-74 and 3-75 several typos can be found. It talks about a DLRL module, which should be DDS in the definition of the CacheFactory variable and Cache variable. The create_cache operation is missing a parameter (cache name). The home objects should have their default constructors called. The create_object operations sometimes has a - as seperator instead of a _. The create_object should take a cache access as parameter instead of the cache, this cache access should also be created. The write operation should be performed on the created cache access, not on the cache. The closing }; should also be removed, as it is never opened. The setter operation for the operations are also incorrect. They should be set_x, not x. And the relation has a put operation which does not exist. The first setter for the a_radar attribute should operate on t1, not t2. Solution: Replace: DDS::DomainParticipant_var dp; DLRL::CacheFactory_var cf; /* * Init phase */ DLRL::Cache_var c = cf->create_cache (WRITE_ONLY, dp); RadarHome_var rh; TrackHome_var th; Track3DHome_var t3dh; c->register_home (rh); c->register_home (th); c->register_home (t3dh); c->register_all_for_pubsub(); // some QoS settings if needed c->enable_all_for_pubsub(); /* * Creation, modifications and publication */ Radar_var r1 = rh->create_object(c); Track_var t1 = th->create-object (c); Track3D_var t2 = t3dh->create-object (c); t1->w(12);// setting of a pure local attribute t1->x(1000.0);// some DLRL attributes settings t1->y(2000.0); t2->a_radar->put(r1);// modifies r1->tracks accordingly t2->x(1000.0); t2->y(2000.0); t2->z(3000.0); t2->a_radar->put(r1);// modifies r1->tracks accordingly c->write();// all modifications are published }; With: DDS::DomainParticipant_var dp; DDS::CacheFactory_var cf; /* * Init phase */ DDS::Cache_var c = cf->create_cache ("a_cache", WRITE_ONLY, dp); RadarHome_var rh = new RadarHome(); TrackHome_var th = new TrackHome(); Track3DHome_var t3dh = new Track3DHome(); c->register_home (rh); c->register_home (th); c->register_home (t3dh); c->register_all_for_pubsub(); // some QoS settings if needed c->enable_all_for_pubsub(); /* * Creation, modifications and publication */ DDS:CacheAccess_var ca = c->create_access(WRITE_ONLY); Radar_var r1 = rh->create_object(ca); Track_var t1 = th->create_object (ca); Track3D_var t2 = t3dh->create_object (ca); t1->w(12);// setting of a pure local attribute t1->set_x(1000.0);// some DLRL attributes settings t1->set_y(2000.0); t1->set_a_radar(r1);// modifies r1->tracks accordingly t2->set_x(1000.0); t2->set_y(2000.0); t2->set_z(3000.0); t2->set_a_radar(r1);// modifies r1->tracks accordingly ca->write();// all modifications are published Juergen Boldt Director, Member Services Object Management Group 140 Kendrick St Building A Suite 300 Needham, MA 02494 USA tel: +1 781 444 0404 x 132 fax: +1 781 444 0320 email: juergen@omg.org www.omg.org