1 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/all_cosnotify_clients.cc omniNotify-2.1.new/examples/all_cosnotify_clients.cc
2 --- omniNotify-2.1.orig/examples/all_cosnotify_clients.cc 2003-10-23 08:39:11.000000000 +0400
3 +++ omniNotify-2.1.new/examples/all_cosnotify_clients.cc 2009-06-28 17:19:34.000000000 +0400
5 num_con_events = 6 * num_events;
7 // (2) Obtain reference to notification channel
8 - if (verbose) cout << "Obtaining reference to notification channel" << endl;
9 + if (verbose) std::cout << "Obtaining reference to notification channel" << std::endl;
10 CosNA::EventChannel_ptr channel = getchan_from_ns(orb, channel_name, verbose);
11 if (CORBA::is_nil(channel)) { // name service lookup failed
12 channel = getchan_from_iorfile(orb, ior_file, verbose);
16 // (3) Create all 12 CosNotify-style clients
17 - if (verbose) cout << "Creating 12 clients" << endl;
18 + if (verbose) std::cout << "Creating 12 clients" << std::endl;
20 // (3.1) any_push_consumer
21 PushConsumer_i* a_push_c =
23 "", "", sample_consume_any_fn, sample_offer_change_fn,
24 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
26 - cerr << "Constructing any_push_consumer failed" << endl;
27 + std::cerr << "Constructing any_push_consumer failed" << std::endl;
28 goto error_return; // failed to create a client
30 CosNotifyComm::PushConsumer_var my_a_push_c = a_push_c->_this();
32 "", "", sample_consume_structured_fn, sample_offer_change_fn,
33 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
35 - cerr << "Constructing struct_push_consumer failed" << endl;
36 + std::cerr << "Constructing struct_push_consumer failed" << std::endl;
37 goto error_return; // failed to create a client
39 CosNotifyComm::StructuredPushConsumer_var my_s_push_c = s_push_c->_this();
41 "", "", sample_consume_batch_fn, sample_offer_change_fn,
42 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
44 - cerr << "Constructing batch_push_consumer failed" << endl;
45 + std::cerr << "Constructing batch_push_consumer failed" << std::endl;
46 goto error_return; // failed to create a client
48 CosNotifyComm::SequencePushConsumer_var my_b_push_c = b_push_c->_this();
50 "", "", sample_consume_any_fn, sample_offer_change_fn,
51 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
53 - cerr << "Constructing any_pull_consumer failed" << endl;
54 + std::cerr << "Constructing any_pull_consumer failed" << std::endl;
55 goto error_return; // failed to create a client
57 CosNotifyComm::PullConsumer_var my_a_pull_c = a_pull_c->_this();
59 "", "", sample_consume_structured_fn, sample_offer_change_fn,
60 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
62 - cerr << "Constructing struct_pull_consumer failed" << endl;
63 + std::cerr << "Constructing struct_pull_consumer failed" << std::endl;
64 goto error_return; // failed to create a client
66 CosNotifyComm::StructuredPullConsumer_var my_s_pull_c = s_pull_c->_this();
68 "", "", sample_consume_batch_fn, sample_offer_change_fn,
69 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
71 - cerr << "Constructing batch_pull_consumer failed" << endl;
72 + std::cerr << "Constructing batch_pull_consumer failed" << std::endl;
73 goto error_return; // failed to create a client
75 CosNotifyComm::SequencePullConsumer_var my_b_pull_c = b_pull_c->_this();
77 "", "", sample_supply_any_fn, sample_subscription_change_fn,
78 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
80 - cerr << "Constructing any_push_supplier failed" << endl;
81 + std::cerr << "Constructing any_push_supplier failed" << std::endl;
82 goto error_return; // failed to create a client
84 CosNotifyComm::PushSupplier_var my_a_push_s = a_push_s->_this();
86 "", "", sample_supply_structured_fn, sample_subscription_change_fn,
87 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
89 - cerr << "Constructing struct_push_supplier failed" << endl;
90 + std::cerr << "Constructing struct_push_supplier failed" << std::endl;
91 goto error_return; // failed to create a client
93 CosNotifyComm::StructuredPushSupplier_var my_s_push_s = s_push_s->_this();
95 "", "", sample_supply_batch_fn, sample_subscription_change_fn,
96 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
98 - cerr << "Constructing batch_push_supplier failed" << endl;
99 + std::cerr << "Constructing batch_push_supplier failed" << std::endl;
100 goto error_return; // failed to create a client
102 CosNotifyComm::SequencePushSupplier_var my_b_push_s = b_push_s->_this();
104 "", "", sample_supply_any_fn, sample_subscription_change_fn,
105 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
107 - cerr << "Constructing any_pull_supplier failed" << endl;
108 + std::cerr << "Constructing any_pull_supplier failed" << std::endl;
109 goto error_return; // failed to create a client
111 CosNotifyComm::PullSupplier_var my_a_pull_s = a_pull_s->_this();
113 "", "", sample_supply_structured_fn, sample_subscription_change_fn,
114 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
116 - cerr << "Constructing struct_pull_supplier failed" << endl;
117 + std::cerr << "Constructing struct_pull_supplier failed" << std::endl;
118 goto error_return; // failed to create a client
120 CosNotifyComm::StructuredPullSupplier_var my_s_pull_s = s_pull_s->_this();
121 @@ -191,75 +191,75 @@
122 "", "", sample_supply_batch_fn, sample_subscription_change_fn,
123 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
125 - cerr << "Constructing batch_pull_supplier failed" << endl;
126 + std::cerr << "Constructing batch_pull_supplier failed" << std::endl;
127 goto error_return; // failed to create a client
129 CosNotifyComm::SequencePullSupplier_var my_b_pull_s = b_pull_s->_this();
130 b_pull_s->_remove_ref(); // enables POA cleanup of servant
132 // (4) Tell POA we are ready to go
133 - if (verbose) cout << "Activating POA manager" << endl;
134 + if (verbose) std::cout << "Activating POA manager" << std::endl;
135 PortableServer::POAManager_var pman = poa->the_POAManager();
138 // (5) Connect clients to their proxies -- consumers first
139 - if (verbose) cout << "Connecting consumer clients to proxies" << endl;
140 + if (verbose) std::cout << "Connecting consumer clients to proxies" << std::endl;
142 if (a_push_c->connect()) {
143 - cerr << "Connecting any_push_consumer failed" << endl;
144 + std::cerr << "Connecting any_push_consumer failed" << std::endl;
147 if (s_push_c->connect()) {
148 - cerr << "Connecting struct_push_consumer failed" << endl;
149 + std::cerr << "Connecting struct_push_consumer failed" << std::endl;
152 if (b_push_c->connect()) {
153 - cerr << "Connecting batch_push_consumer failed" << endl;
154 + std::cerr << "Connecting batch_push_consumer failed" << std::endl;
158 if (a_pull_c->connect()) {
159 - cerr << "Connecting any_pull_consumer failed" << endl;
160 + std::cerr << "Connecting any_pull_consumer failed" << std::endl;
163 if (s_pull_c->connect()) {
164 - cerr << "Connecting struct_pull_consumer failed" << endl;
165 + std::cerr << "Connecting struct_pull_consumer failed" << std::endl;
168 if (b_pull_c->connect()) {
169 - cerr << "Connecting batch_pull_consumer failed" << endl;
170 + std::cerr << "Connecting batch_pull_consumer failed" << std::endl;
174 - if (verbose) cout << "Connecting supplier clients to proxies" << endl;
175 + if (verbose) std::cout << "Connecting supplier clients to proxies" << std::endl;
177 if (a_push_s->connect()) {
178 - cerr << "Connecting any_push_supplier failed" << endl;
179 + std::cerr << "Connecting any_push_supplier failed" << std::endl;
182 if (s_push_s->connect()) {
183 - cerr << "Connecting struct_push_supplier failed" << endl;
184 + std::cerr << "Connecting struct_push_supplier failed" << std::endl;
187 if (b_push_s->connect()) {
188 - cerr << "Connecting batch_push_supplier failed" << endl;
189 + std::cerr << "Connecting batch_push_supplier failed" << std::endl;
193 if (a_pull_s->connect()) {
194 - cerr << "Connecting any_pull_supplier failed" << endl;
195 + std::cerr << "Connecting any_pull_supplier failed" << std::endl;
198 if (s_pull_s->connect()) {
199 - cerr << "Connecting struct_pull_supplier failed" << endl;
200 + std::cerr << "Connecting struct_pull_supplier failed" << std::endl;
203 if (b_pull_s->connect()) {
204 - cerr << "Connecting batch_pull_supplier failed" << endl;
205 + std::cerr << "Connecting batch_pull_supplier failed" << std::endl;
209 - if (verbose) cout << "Waiting for all 12 clients to finish" << endl;
210 + if (verbose) std::cout << "Waiting for all 12 clients to finish" << std::endl;
211 CORBA::Boolean a_push_c_err = a_push_c->wait_done();
212 CORBA::Boolean s_push_c_err = s_push_c->wait_done();
213 CORBA::Boolean b_push_c_err = b_push_c->wait_done();
214 @@ -291,10 +291,10 @@
217 if (com_err && (num_events > 0)) {
218 - if (verbose) cout << "Communication error -- probably did not process desired # of events" << endl;
219 + if (verbose) std::cout << "Communication error -- probably did not process desired # of events" << std::endl;
222 - if (verbose) cout << "Cleaning up" << endl;
223 + if (verbose) std::cout << "Cleaning up" << std::endl;
225 if (!a_push_c_err) { a_push_c->cleanup(); }
226 if (!s_push_c_err) { s_push_c->cleanup(); }
227 @@ -315,25 +315,25 @@
230 catch(CORBA::SystemException&) {
231 - cerr << "main caught CORBA::SystemException." << endl;
232 + std::cerr << "main caught CORBA::SystemException." << std::endl;
234 catch(CORBA::Exception&) {
235 - cerr << "main caught CORBA::Exception." << endl;
236 + std::cerr << "main caught CORBA::Exception." << std::endl;
238 #if defined(__OMNIORB3__) || defined(__OMNIORB4__)
239 catch(omniORB::fatalException& fe) {
240 - cerr << "main caught omniORB::fatalException:" << endl;
241 - cerr << " file: " << fe.file() << endl;
242 - cerr << " line: " << fe.line() << endl;
243 - cerr << " mesg: " << fe.errmsg() << endl;
244 + std::cerr << "main caught omniORB::fatalException:" << std::endl;
245 + std::cerr << " file: " << fe.file() << std::endl;
246 + std::cerr << " line: " << fe.line() << std::endl;
247 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
251 // nameclt comment says it is a bad idea to report an error here
253 - cerr << "main caught an exception." << endl;
254 + std::cerr << "main caught an exception." << std::endl;
256 - cerr << "QUITTING due to error" << endl;
257 + std::cerr << "QUITTING due to error" << std::endl;
261 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/demo_add_filter.cc omniNotify-2.1.new/examples/demo_add_filter.cc
262 --- omniNotify-2.1.orig/examples/demo_add_filter.cc 2003-10-12 22:51:18.000000000 +0400
263 +++ omniNotify-2.1.new/examples/demo_add_filter.cc 2009-06-28 17:20:35.000000000 +0400
266 -#include <iostream.h>
270 #include "CosNotifyShorthands.h"
272 CORBA::Boolean verbose);
274 void usage(char* pname) {
275 - cerr << "Usage: " << pname << " [-n name] [-f file] -p file" << endl << endl;
276 - cout << " -n name : channel name" << endl;
277 - cout << " => use event service to lookup this name" << endl;
278 - cout << " -f file : file containing channel IOR" << endl;
279 - cout << " => use string_to_object on the IOR" << endl;
280 - cout << " -p file : file with stringified IOR of proxy to be" << endl;
281 - cout << " sent add_filter messages (REQUIRED)" << endl;
282 - cout << "(The channel is needed to obtain its default filter factory)" << endl;
283 + std::cerr << "Usage: " << pname << " [-n name] [-f file] -p file" << std::endl << std::endl;
284 + std::cout << " -n name : channel name" << std::endl;
285 + std::cout << " => use event service to lookup this name" << std::endl;
286 + std::cout << " -f file : file containing channel IOR" << std::endl;
287 + std::cout << " => use string_to_object on the IOR" << std::endl;
288 + std::cout << " -p file : file with stringified IOR of proxy to be" << std::endl;
289 + std::cout << " sent add_filter messages (REQUIRED)" << std::endl;
290 + std::cout << "(The channel is needed to obtain its default filter factory)" << std::endl;
297 if (! (ifile = fopen(proxy_ior_file, "r")) ) {
298 - cerr << "Failed to open file " << proxy_ior_file << " for reading" << endl;
299 + std::cerr << "Failed to open file " << proxy_ior_file << " for reading" << std::endl;
302 if (fscanf(ifile, "%s", buf) != 1) {
303 - cerr << "Failed to get an IOR from file " << proxy_ior_file << endl;
304 + std::cerr << "Failed to get an IOR from file " << proxy_ior_file << std::endl;
310 CORBA::Object_var proxy_ref = orb->string_to_object(buf);
311 if ( CORBA::is_nil(proxy_ref) ) {
312 - cerr << "Failed to turn IOR in file " << proxy_ior_file << " into object" << endl;
313 + std::cerr << "Failed to turn IOR in file " << proxy_ior_file << " into object" << std::endl;
316 proxy = CosNF::FilterAdmin::_narrow(proxy_ref);
317 if ( CORBA::is_nil(proxy) ) {
318 - cerr << "Failed to narrow object from IOR in file " << proxy_ior_file << endl;
319 + std::cerr << "Failed to narrow object from IOR in file " << proxy_ior_file << std::endl;
323 - cerr << "Failed to convert to object from IOR in file " << proxy_ior_file << endl;
324 + std::cerr << "Failed to convert to object from IOR in file " << proxy_ior_file << std::endl;
328 CosNF::Filter_ptr filter = CosNF::Filter::_nil();
330 - cout << endl << "Enter a constraint ('exit' to quit, 'remove' to remove all filters): " << endl << flush;
331 + std::cout << std::endl << "Enter a constraint ('exit' to quit, 'remove' to remove all filters): " << std::endl << std::flush;
332 if (!(fgets(buf, 8090, stdin))) break;
333 if (strlen(buf) < 2) continue; // skip empty lines
334 buf[strlen(buf)-1] = '\0'; // strip newline from end
335 if (strcmp(buf, "exit") == 0) {
338 - cout << "Calling remove_all_filters on the proxy" << endl;
339 + std::cout << "Calling remove_all_filters on the proxy" << std::endl;
340 proxy->remove_all_filters();
341 if (!CORBA::is_nil(filter)) {
342 - cout << "Destroying the previous filter, which is no longer in use" << endl;
343 + std::cout << "Destroying the previous filter, which is no longer in use" << std::endl;
345 filter = CosNF::Filter::_nil();
347 @@ -134,27 +134,27 @@
349 sample_add_filter(channel, proxy, evs, buf, "demo_add_filter", filter, 1);
351 - cout << endl << "---------------------------------------------------------" << endl;
352 + std::cout << std::endl << "---------------------------------------------------------" << std::endl;
357 catch(CORBA::SystemException&) {
358 - cerr << "Caught CORBA::SystemException." << endl;
359 + std::cerr << "Caught CORBA::SystemException." << std::endl;
361 catch(CORBA::Exception&) {
362 - cerr << "Caught CORBA::Exception." << endl;
363 + std::cerr << "Caught CORBA::Exception." << std::endl;
365 #if defined(__OMNIORB3__) || defined(__OMNIORB4__)
366 catch(omniORB::fatalException& fe) {
367 - cerr << "Caught omniORB::fatalException:" << endl;
368 - cerr << " file: " << fe.file() << endl;
369 - cerr << " line: " << fe.line() << endl;
370 - cerr << " mesg: " << fe.errmsg() << endl;
371 + std::cerr << "Caught omniORB::fatalException:" << std::endl;
372 + std::cerr << " file: " << fe.file() << std::endl;
373 + std::cerr << " line: " << fe.line() << std::endl;
374 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
378 - cerr << "Caught unknown exception." << endl;
379 + std::cerr << "Caught unknown exception." << std::endl;
383 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/demo_offer_change.cc omniNotify-2.1.new/examples/demo_offer_change.cc
384 --- omniNotify-2.1.orig/examples/demo_offer_change.cc 2003-10-12 22:51:18.000000000 +0400
385 +++ omniNotify-2.1.new/examples/demo_offer_change.cc 2009-06-28 17:21:48.000000000 +0400
388 -#include <iostream.h>
392 #include "CosNotifyShorthands.h"
396 void usage(char* pname) {
397 - cerr << "Usage: " << pname << " -p file" << endl << endl;
398 - cout << " -p file : file with stringified IOR of proxy to be" << endl;
399 - cout << " sent offer_change messages (REQUIRED)" << endl;
400 + std::cerr << "Usage: " << pname << " -p file" << std::endl << std::endl;
401 + std::cout << " -p file : file with stringified IOR of proxy to be" << std::endl;
402 + std::cout << " sent offer_change messages (REQUIRED)" << std::endl;
405 int main(int argc, char** argv)
409 if (! (ifile = fopen(proxy_ior_file, "r")) ) {
410 - cerr << "Failed to open file " << proxy_ior_file << " for reading" << endl;
411 + std::cerr << "Failed to open file " << proxy_ior_file << " for reading" << std::endl;
414 if (fscanf(ifile, "%s", buf) != 1) {
415 - cerr << "Failed to get an IOR from file " << proxy_ior_file << endl;
416 + std::cerr << "Failed to get an IOR from file " << proxy_ior_file << std::endl;
420 @@ -109,69 +109,69 @@
422 CORBA::Object_var proxy_ref = orb->string_to_object(buf);
423 if ( CORBA::is_nil(proxy_ref) ) {
424 - cerr << "Failed to turn IOR in file " << proxy_ior_file << " into object" << endl;
425 + std::cerr << "Failed to turn IOR in file " << proxy_ior_file << " into object" << std::endl;
428 proxy = CosNC::NotifyPublish::_narrow(proxy_ref);
429 if ( CORBA::is_nil(proxy) ) {
430 - cerr << "Failed to narrow object from IOR in file " << proxy_ior_file << endl;
431 + std::cerr << "Failed to narrow object from IOR in file " << proxy_ior_file << std::endl;
435 - cerr << "Failed to convert to object from IOR in file " << proxy_ior_file << endl;
436 + std::cerr << "Failed to convert to object from IOR in file " << proxy_ior_file << std::endl;
443 - cout << endl << "Enter list of removals (or empty for none): " << endl << flush;
444 + std::cout << std::endl << "Enter list of removals (or empty for none): " << std::endl << std::flush;
445 if (!(fgets(buf, 8090, stdin))) break;
446 if (strlen(buf) < 1) break;
447 buf[strlen(buf)-1] = '\0'; // strip newline from end
448 if (strcmp(buf, "exit") == 0) break;
450 if (parse_etype_list(buf, deled)) {
451 - cerr << "Failed to parse the input as an event type list" << endl;
452 + std::cerr << "Failed to parse the input as an event type list" << std::endl;
457 - cout << endl << "Enter list of additions (or empty for none): " << endl << flush;
458 + std::cout << std::endl << "Enter list of additions (or empty for none): " << std::endl << std::flush;
459 if (!(fgets(buf2, 8090, stdin))) break;
460 if (strlen(buf2) < 1) break;
461 buf2[strlen(buf2)-1] = '\0'; // strip newline from end
462 if (strcmp(buf2, "exit") == 0) break;
464 if (parse_etype_list(buf2, added)) {
465 - cerr << "Failed to parse the input as an event type list" << endl;
466 + std::cerr << "Failed to parse the input as an event type list" << std::endl;
471 - cout << "Calling offer_change on the proxy" << endl;
472 + std::cout << "Calling offer_change on the proxy" << std::endl;
473 proxy->offer_change(added, deled);
474 - cout << endl << "---------------------------------------------------------" << endl;
475 + std::cout << std::endl << "---------------------------------------------------------" << std::endl;
480 catch(CORBA::SystemException&) {
481 - cerr << "Caught CORBA::SystemException." << endl;
482 + std::cerr << "Caught CORBA::SystemException." << std::endl;
484 catch(CORBA::Exception&) {
485 - cerr << "Caught CORBA::Exception." << endl;
486 + std::cerr << "Caught CORBA::Exception." << std::endl;
488 #if defined(__OMNIORB3__) || defined(__OMNIORB4__)
489 catch(omniORB::fatalException& fe) {
490 - cerr << "Caught omniORB::fatalException:" << endl;
491 - cerr << " file: " << fe.file() << endl;
492 - cerr << " line: " << fe.line() << endl;
493 - cerr << " mesg: " << fe.errmsg() << endl;
494 + std::cerr << "Caught omniORB::fatalException:" << std::endl;
495 + std::cerr << " file: " << fe.file() << std::endl;
496 + std::cerr << " line: " << fe.line() << std::endl;
497 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
501 - cerr << "Caught unknown exception." << endl;
502 + std::cerr << "Caught unknown exception." << std::endl;
506 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/demo_subscription_change.cc omniNotify-2.1.new/examples/demo_subscription_change.cc
507 --- omniNotify-2.1.orig/examples/demo_subscription_change.cc 2003-10-12 22:51:18.000000000 +0400
508 +++ omniNotify-2.1.new/examples/demo_subscription_change.cc 2009-06-28 17:23:49.000000000 +0400
511 -#include <iostream.h>
515 #include "CosNotifyShorthands.h"
519 void usage(char* pname) {
520 - cerr << "Usage: " << pname << " -p file" << endl << endl;
521 - cout << " -p file : file with stringified IOR of proxy to be" << endl;
522 - cout << " sent subscription_change messages (REQUIRED)" << endl;
523 + std::cerr << "Usage: " << pname << " -p file" << std::endl << std::endl;
524 + std::cout << " -p file : file with stringified IOR of proxy to be" << std::endl;
525 + std::cout << " sent subscription_change messages (REQUIRED)" << std::endl;
528 int main(int argc, char** argv)
532 if (! (ifile = fopen(proxy_ior_file, "r")) ) {
533 - cerr << "Failed to open file " << proxy_ior_file << " for reading" << endl;
534 + std::cerr << "Failed to open file " << proxy_ior_file << " for reading" << std::endl;
537 if (fscanf(ifile, "%s", buf) != 1) {
538 - cerr << "Failed to get an IOR from file " << proxy_ior_file << endl;
539 + std::cerr << "Failed to get an IOR from file " << proxy_ior_file << std::endl;
543 @@ -109,69 +109,69 @@
545 CORBA::Object_var proxy_ref = orb->string_to_object(buf);
546 if ( CORBA::is_nil(proxy_ref) ) {
547 - cerr << "Failed to turn IOR in file " << proxy_ior_file << " into object" << endl;
548 + std::cerr << "Failed to turn IOR in file " << proxy_ior_file << " into object" << std::endl;
551 proxy = CosNC::NotifySubscribe::_narrow(proxy_ref);
552 if ( CORBA::is_nil(proxy) ) {
553 - cerr << "Failed to narrow object from IOR in file " << proxy_ior_file << endl;
554 + std::cerr << "Failed to narrow object from IOR in file " << proxy_ior_file << std::endl;
558 - cerr << "Failed to convert to object from IOR in file " << proxy_ior_file << endl;
559 + std::cerr << "Failed to convert to object from IOR in file " << proxy_ior_file << std::endl;
566 - cout << endl << "Enter list of removals (or empty for none): " << endl << flush;
567 + std::cout << std::endl << "Enter list of removals (or empty for none): " << std::endl << std::flush;
568 if (!(fgets(buf, 8090, stdin))) break;
569 if (strlen(buf) < 1) break;
570 buf[strlen(buf)-1] = '\0'; // strip newline from end
571 if (strcmp(buf, "exit") == 0) break;
573 if (parse_etype_list(buf, deled)) {
574 - cerr << "Failed to parse the input as an event type list" << endl;
575 + std::cerr << "Failed to parse the input as an event type list" << std::endl;
580 - cout << endl << "Enter list of additions (or empty for none): " << endl << flush;
581 + std::cout << std::endl << "Enter list of additions (or empty for none): " << std::endl << std::flush;
582 if (!(fgets(buf2, 8090, stdin))) break;
583 if (strlen(buf2) < 1) break;
584 buf2[strlen(buf2)-1] = '\0'; // strip newline from end
585 if (strcmp(buf2, "exit") == 0) break;
587 if (parse_etype_list(buf2, added)) {
588 - cerr << "Failed to parse the input as an event type list" << endl;
589 + std::cerr << "Failed to parse the input as an event type list" << std::endl;
594 - cout << "Calling subscription_change on the proxy" << endl;
595 + std::cout << "Calling subscription_change on the proxy" << std::endl;
596 proxy->subscription_change(added, deled);
597 - cout << endl << "---------------------------------------------------------" << endl;
598 + std::cout << std::endl << "---------------------------------------------------------" << std::endl;
603 catch(CORBA::SystemException&) {
604 - cerr << "Caught CORBA::SystemException." << endl;
605 + std::cerr << "Caught CORBA::SystemException." << std::endl;
607 catch(CORBA::Exception&) {
608 - cerr << "Caught CORBA::Exception." << endl;
609 + std::cerr << "Caught CORBA::Exception." << std::endl;
611 #if defined(__OMNIORB3__) || defined(__OMNIORB4__)
612 catch(omniORB::fatalException& fe) {
613 - cerr << "Caught omniORB::fatalException:" << endl;
614 - cerr << " file: " << fe.file() << endl;
615 - cerr << " line: " << fe.line() << endl;
616 - cerr << " mesg: " << fe.errmsg() << endl;
617 + std::cerr << "Caught omniORB::fatalException:" << std::endl;
618 + std::cerr << " file: " << fe.file() << std::endl;
619 + std::cerr << " line: " << fe.line() << std::endl;
620 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
624 - cerr << "Caught unknown exception." << endl;
625 + std::cerr << "Caught unknown exception." << std::endl;
629 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/get_channel.h omniNotify-2.1.new/examples/get_channel.h
630 --- omniNotify-2.1.orig/examples/get_channel.h 2003-10-23 08:39:11.000000000 +0400
631 +++ omniNotify-2.1.new/examples/get_channel.h 2009-06-28 17:10:29.000000000 +0400
633 CosNA::EventChannel_ptr channel = CosNA::EventChannel::_nil();
634 if (!ior_file || strlen(ior_file) == 0) return channel; // empty string -- ignore
635 if (! (ifile = fopen(ior_file, "r")) ) {
636 - cerr << "Failed to open file " << ior_file << " for reading" << endl;
637 + std::cerr << "Failed to open file " << ior_file << " for reading" << std::endl;
638 return channel; // failure
640 if (fscanf(ifile, "%s", buf) != 1) {
641 - cerr << "Failed to get an IOR from file " << ior_file << endl;
642 + std::cerr << "Failed to get an IOR from file " << ior_file << std::endl;
644 return channel; // failure
648 CORBA::Object_var channel_ref = orb->string_to_object(buf);
649 if ( CORBA::is_nil(channel_ref) ) {
650 - cerr << "Failed to turn IOR in file " << ior_file << " into object" << endl;
651 + std::cerr << "Failed to turn IOR in file " << ior_file << " into object" << std::endl;
652 return channel; // failure
654 channel = CosNA::EventChannel::_narrow(channel_ref);
655 if ( CORBA::is_nil(channel) ) {
656 - cerr << "Failed to narrow object from IOR in file " << ior_file <<
657 - " to type CosNotifyChannelAdmin::EventChannel" << endl;
658 + std::cerr << "Failed to narrow object from IOR in file " << ior_file <<
659 + " to type CosNotifyChannelAdmin::EventChannel" << std::endl;
660 return channel; // failure
663 - cerr << "Failed to convert IOR in file " << ior_file << " to object" << endl;
664 + std::cerr << "Failed to convert IOR in file " << ior_file << " to object" << std::endl;
665 return channel; // failure
668 - cout << "Found valid channel reference" << endl;
669 + std::cout << "Found valid channel reference" << std::endl;
670 return channel; // success
674 if (!channel_name || strlen(channel_name) == 0) return channel; // empty string -- ignore
677 - cout << "Obtaining naming service reference" << endl;
678 + std::cout << "Obtaining naming service reference" << std::endl;
680 CORBA::Object_var name_service;
681 name_service = orb->resolve_initial_references("NameService");
682 name_context = CosNaming::NamingContext::_narrow(name_service);
683 if ( CORBA::is_nil(name_context) ) {
684 - cerr << "Failed to obtain context for NameService" << endl;
685 + std::cerr << "Failed to obtain context for NameService" << std::endl;
686 return channel; // failure
689 catch(CORBA::ORB::InvalidName& ex) {
690 - cerr << "Service required is invalid [does not exist]" << endl;
691 + std::cerr << "Service required is invalid [does not exist]" << std::endl;
692 return channel; // failure
693 } catch (CORBA::COMM_FAILURE& ex) {
694 - cerr << "Caught system exception COMM_FAILURE" << endl;
695 + std::cerr << "Caught system exception COMM_FAILURE" << std::endl;
696 return channel; // failure
698 - cerr << "Caught exception while resolving the naming service" << endl;
699 + std::cerr << "Caught exception while resolving the naming service" << std::endl;
700 return channel; // failure
704 - cout << "Looking up channel name " << channel_name << " . " << channel_name << endl;
705 + std::cout << "Looking up channel name " << channel_name << " . " << channel_name << std::endl;
708 name[0].id = CORBA::string_dup((const char*)channel_name);
710 CORBA::Object_var channel_ref = name_context->resolve(name);
711 channel = CosNA::EventChannel::_narrow(channel_ref);
712 if ( CORBA::is_nil(channel) ) {
713 - cerr << "Failed to narrow object found in naming service " <<
714 - " to type CosNotifyChannelAdmin::EventChannel" << endl;
715 + std::cerr << "Failed to narrow object found in naming service " <<
716 + " to type CosNotifyChannelAdmin::EventChannel" << std::endl;
717 return channel; // failure
720 catch(CORBA::ORB::InvalidName& ex) {
721 - cerr << "Invalid name" << endl;
722 + std::cerr << "Invalid name" << std::endl;
723 return channel; // failure
724 } catch (CORBA::COMM_FAILURE& ex) {
725 - cerr << "Caught system exception COMM_FAILURE while resolving event channel name" << endl;
726 + std::cerr << "Caught system exception COMM_FAILURE while resolving event channel name" << std::endl;
727 return channel; // failure
729 - cerr << "Caught exception while resolving event channel name" << endl;
730 + std::cerr << "Caught exception while resolving event channel name" << std::endl;
731 return channel; // failure
734 - cout << "Found valid channel reference" << endl;
735 + std::cout << "Found valid channel reference" << std::endl;
736 return channel; // success
739 @@ -121,30 +121,30 @@
740 CosNaming::Name name;
743 - cout << "Obtaining naming service reference" << endl;
744 + std::cout << "Obtaining naming service reference" << std::endl;
745 if (!factory_name || strlen(factory_name) == 0) return channel; // empty string -- ignore
747 CORBA::Object_var name_service;
748 name_service = orb->resolve_initial_references("NameService");
749 name_context = CosNaming::NamingContext::_narrow(name_service);
750 if ( CORBA::is_nil(name_context) ) {
751 - cerr << "Failed to obtain context for NameService" << endl;
752 + std::cerr << "Failed to obtain context for NameService" << std::endl;
753 return channel; // failure
756 catch(CORBA::ORB::InvalidName& ex) {
757 - cerr << "Service required is invalid [does not exist]" << endl;
758 + std::cerr << "Service required is invalid [does not exist]" << std::endl;
759 return channel; // failure
760 } catch (CORBA::COMM_FAILURE& ex) {
761 - cerr << "Caught system exception COMM_FAILURE" << endl;
762 + std::cerr << "Caught system exception COMM_FAILURE" << std::endl;
763 return channel; // failure
765 - cerr << "Caught exception while resolving the naming service" << endl;
766 + std::cerr << "Caught exception while resolving the naming service" << std::endl;
767 return channel; // failure
771 - cout << "Looking up channel factory name " << factory_name << " . " << factory_name << endl;
772 + std::cout << "Looking up channel factory name " << factory_name << " . " << factory_name << std::endl;
775 name[0].id = CORBA::string_dup((const char*)factory_name);
776 @@ -154,41 +154,41 @@
777 CORBA::Object_var factory_ref = name_context->resolve(name);
778 factory = CosNA::EventChannelFactory::_narrow(factory_ref);
779 if ( CORBA::is_nil(factory) ) {
780 - cerr << "Failed to narrow object found in naming service " <<
781 - " to type CosNotifyChannelAdmin::EventChannelFactory" << endl;
782 + std::cerr << "Failed to narrow object found in naming service " <<
783 + " to type CosNotifyChannelAdmin::EventChannelFactory" << std::endl;
784 return channel; // failure
787 catch(CORBA::ORB::InvalidName& ex) {
788 - cerr << "Invalid name" << endl;
789 + std::cerr << "Invalid name" << std::endl;
790 return channel; // failure
791 } catch (CORBA::COMM_FAILURE& ex) {
792 - cerr << "Caught system exception COMM_FAILURE while resolving event channel factory name" << endl;
793 + std::cerr << "Caught system exception COMM_FAILURE while resolving event channel factory name" << std::endl;
794 return channel; // failure
796 - cerr << "Caught exception while resolving event channel factory name" << endl;
797 + std::cerr << "Caught exception while resolving event channel factory name" << std::endl;
798 return channel; // failure
801 - cout << "Found valid channel factory reference" << endl;
802 - cout << "Looking up channel id " << chan_id << endl;
803 + std::cout << "Found valid channel factory reference" << std::endl;
804 + std::cout << "Looking up channel id " << chan_id << std::endl;
808 channel = factory->get_event_channel( chan_id );
809 if ( CORBA::is_nil(channel) ) {
810 - cerr << "Failed to find channel id " << chan_id << endl;
811 + std::cerr << "Failed to find channel id " << chan_id << std::endl;
812 return channel; // failure
814 } catch (CORBA::COMM_FAILURE& ex) {
815 - cerr << "Caught system exception COMM_FAILURE while invoking get_event_channel" << endl;
816 + std::cerr << "Caught system exception COMM_FAILURE while invoking get_event_channel" << std::endl;
817 return channel; // failure
819 - cerr << "Caught exception while invoking get_event_channel" << endl;
820 + std::cerr << "Caught exception while invoking get_event_channel" << std::endl;
821 return channel; // failure
824 - cout << "Found valid channel reference" << endl;
825 + std::cout << "Found valid channel reference" << std::endl;
826 return channel; // success
829 @@ -201,30 +201,30 @@
830 CosNaming::Name name;
833 - cout << "Obtaining naming service reference" << endl;
834 + std::cout << "Obtaining naming service reference" << std::endl;
835 if (!factory_name || strlen(factory_name) == 0) return channel; // empty string -- ignore
837 CORBA::Object_var name_service;
838 name_service = orb->resolve_initial_references("NameService");
839 name_context = CosNaming::NamingContext::_narrow(name_service);
840 if ( CORBA::is_nil(name_context) ) {
841 - cerr << "Failed to obtain context for NameService" << endl;
842 + std::cerr << "Failed to obtain context for NameService" << std::endl;
843 return channel; // failure
846 catch(CORBA::ORB::InvalidName& ex) {
847 - cerr << "Service required is invalid [does not exist]" << endl;
848 + std::cerr << "Service required is invalid [does not exist]" << std::endl;
849 return channel; // failure
850 } catch (CORBA::COMM_FAILURE& ex) {
851 - cerr << "Caught system exception COMM_FAILURE" << endl;
852 + std::cerr << "Caught system exception COMM_FAILURE" << std::endl;
853 return channel; // failure
855 - cerr << "Caught exception while resolving the naming service" << endl;
856 + std::cerr << "Caught exception while resolving the naming service" << std::endl;
857 return channel; // failure
861 - cout << "Looking up channel factory name " << factory_name << " . " << factory_name << endl;
862 + std::cout << "Looking up channel factory name " << factory_name << " . " << factory_name << std::endl;
865 name[0].id = CORBA::string_dup((const char*)factory_name);
866 @@ -234,24 +234,24 @@
867 CORBA::Object_var factory_ref = name_context->resolve(name);
868 factory = CosNA::EventChannelFactory::_narrow(factory_ref);
869 if ( CORBA::is_nil(factory) ) {
870 - cerr << "Failed to narrow object found in naming service " <<
871 - " to type CosNotifyChannelAdmin::EventChannelFactory" << endl;
872 + std::cerr << "Failed to narrow object found in naming service " <<
873 + " to type CosNotifyChannelAdmin::EventChannelFactory" << std::endl;
874 return channel; // failure
877 catch(CORBA::ORB::InvalidName& ex) {
878 - cerr << "Invalid name" << endl;
879 + std::cerr << "Invalid name" << std::endl;
880 return channel; // failure
881 } catch (CORBA::COMM_FAILURE& ex) {
882 - cerr << "Caught system exception COMM_FAILURE while resolving event channel factory name" << endl;
883 + std::cerr << "Caught system exception COMM_FAILURE while resolving event channel factory name" << std::endl;
884 return channel; // failure
886 - cerr << "Caught exception while resolving event channel factory name" << endl;
887 + std::cerr << "Caught exception while resolving event channel factory name" << std::endl;
888 return channel; // failure
891 - cout << "Found valid channel factory reference" << endl;
892 - cout << "Creating new channel" << endl;
893 + std::cout << "Found valid channel factory reference" << std::endl;
894 + std::cout << "Creating new channel" << std::endl;
897 CosNA::ChannelID chan_id;
898 @@ -264,18 +264,18 @@
900 channel = factory->create_channel(qosP, admP, chan_id);
901 if ( CORBA::is_nil(channel) ) {
902 - cerr << "Failed to create new channel" << endl;
903 + std::cerr << "Failed to create new channel" << std::endl;
904 return channel; // failure
906 } catch (CORBA::COMM_FAILURE& ex) {
907 - cerr << "Caught system exception COMM_FAILURE while invoking create_channel" << endl;
908 + std::cerr << "Caught system exception COMM_FAILURE while invoking create_channel" << std::endl;
909 return channel; // failure
911 - cerr << "Caught exception while invoking create_channel" << endl;
912 + std::cerr << "Caught exception while invoking create_channel" << std::endl;
913 return channel; // failure
916 - cout << "Created a new channel with channel ID " << chan_id << endl;
917 + std::cout << "Created a new channel with channel ID " << chan_id << std::endl;
918 return channel; // success
921 @@ -289,11 +289,11 @@
923 if (!ior_file || strlen(ior_file) == 0) return channel; // empty string -- ignore
924 if (! (ifile = fopen(ior_file, "r")) ) {
925 - cerr << "Failed to open file " << ior_file << " for reading" << endl;
926 + std::cerr << "Failed to open file " << ior_file << " for reading" << std::endl;
927 return channel; // failure
929 if (fscanf(ifile, "%s", buf) != 1) {
930 - cerr << "Failed to get an IOR from file " << ior_file << endl;
931 + std::cerr << "Failed to get an IOR from file " << ior_file << std::endl;
933 return channel; // failure
935 @@ -301,22 +301,22 @@
937 CORBA::Object_var fact_ref = orb->string_to_object(buf);
938 if ( CORBA::is_nil(fact_ref) ) {
939 - cerr << "Failed to turn IOR in file " << ior_file << " into object" << endl;
940 + std::cerr << "Failed to turn IOR in file " << ior_file << " into object" << std::endl;
941 return channel; // failure
943 factory = CosNA::EventChannelFactory::_narrow(fact_ref);
944 if ( CORBA::is_nil(factory) ) {
945 - cerr << "Failed to narrow object from IOR in file " << ior_file <<
946 - " to type CosNotifyChannelAdmin::EventChannelFactory" << endl;
947 + std::cerr << "Failed to narrow object from IOR in file " << ior_file <<
948 + " to type CosNotifyChannelAdmin::EventChannelFactory" << std::endl;
949 return channel; // failure
952 - cerr << "Failed to convert IOR in file " << ior_file << " to object" << endl;
953 + std::cerr << "Failed to convert IOR in file " << ior_file << " to object" << std::endl;
954 return channel; // failure
957 - cout << "Found valid channel factory reference" << endl;
958 - cout << "Creating new channel" << endl;
959 + std::cout << "Found valid channel factory reference" << std::endl;
960 + std::cout << "Creating new channel" << std::endl;
963 CosNA::ChannelID chan_id;
964 @@ -329,18 +329,18 @@
966 channel = factory->create_channel(qosP, admP, chan_id);
967 if ( CORBA::is_nil(channel) ) {
968 - cerr << "Failed to create new channel" << endl;
969 + std::cerr << "Failed to create new channel" << std::endl;
970 return channel; // failure
972 } catch (CORBA::COMM_FAILURE& ex) {
973 - cerr << "Caught system exception COMM_FAILURE while invoking create_channel" << endl;
974 + std::cerr << "Caught system exception COMM_FAILURE while invoking create_channel" << std::endl;
975 return channel; // failure
977 - cerr << "Caught exception while invoking create_channel" << endl;
978 + std::cerr << "Caught exception while invoking create_channel" << std::endl;
979 return channel; // failure
982 - cout << "Created a new channel with channel ID " << chan_id << endl;
983 + std::cout << "Created a new channel with channel ID " << chan_id << std::endl;
984 return channel; // success
987 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/legacy_clients.cc omniNotify-2.1.new/examples/legacy_clients.cc
988 --- omniNotify-2.1.orig/examples/legacy_clients.cc 2003-10-23 08:39:11.000000000 +0400
989 +++ omniNotify-2.1.new/examples/legacy_clients.cc 2009-06-28 17:19:01.000000000 +0400
991 // See legacy_clients.h
992 // -------------------------------------------------------------- //
994 -#include <iostream.h>
995 -#include <iomanip.h>
998 #include "thread_wrappers.h"
1000 #include "CosNotifyShorthands.h"
1003 admin = channel->for_consumers();
1004 if ( CORBA::is_nil(admin) ) {
1005 - cerr << "Failed to obtain admin" << endl;
1006 + std::cerr << "Failed to obtain admin" << std::endl;
1007 return 0; // failure
1010 - cerr << "Failed to obtain admin" << endl;
1011 + std::cerr << "Failed to obtain admin" << std::endl;
1012 return 0; // failure
1014 - if (verbose) cout << "Obtained admin from the channel" << endl;
1015 + if (verbose) std::cout << "Obtained admin from the channel" << std::endl;
1017 proxy = admin->obtain_push_supplier();
1019 if ( CORBA::is_nil(proxy) ) {
1020 - cerr << "Failed to obtain proxy" << endl;
1021 + std::cerr << "Failed to obtain proxy" << std::endl;
1024 - if (verbose) cout << "Obtained proxy from admin" << endl;
1025 + if (verbose) std::cout << "Obtained proxy from admin" << std::endl;
1027 // Construct a client
1028 LegacyPushConsumer_i* client =
1031 _my_proxy->connect_push_consumer(_this());
1032 } catch (CORBA::BAD_PARAM& ex) {
1033 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
1034 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
1036 } catch (CosEA::AlreadyConnected& ex) {
1037 - cerr << _obj_name << ": Already connected" << endl;
1038 + std::cerr << _obj_name << ": Already connected" << std::endl;
1041 - cerr << _obj_name << ": Failed to connect" << endl;
1042 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
1045 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
1046 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
1047 // if _millisecs is set, spawn a thread to ping the proxy
1049 _worker = new GenericBoundWorkerThread(this);
1051 { // introduce lock scope
1052 TW_SCOPE_LOCK(lock, _oplock, "LegacyPushConsumer", "LegacyPushConsumer_i::cleanup");
1053 if (_worker || (!_done)) {
1054 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
1055 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
1058 // this method takes sole ownership of _my_proxy ref
1060 { // introduce lock scope
1061 TW_SCOPE_LOCK(lock, _oplock, "LegacyPushConsumer", "LegacyPushConsumer_i::start_working");
1063 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
1064 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
1065 // invariant: _oplock held at top of loop
1067 if (_done || (_millisecs == 0)) break;
1069 continue; // continue ping loop
1072 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using connect_push_consumer" << endl;
1073 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using connect_push_consumer" << std::endl;
1075 _finish.broadcast();
1077 @@ -158,16 +158,16 @@
1080 (*_consume_fn)(data, _obj_name, _num_events, _verbose);
1081 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
1082 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
1083 if (_max_events && (_num_events >= _max_events)) {
1084 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
1085 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
1087 _finish.broadcast();
1089 if (!_done && _delay_millisecs) {
1090 unsigned long d_secs = _delay_millisecs / 1000;
1091 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
1092 - if (_verbose) cout << _obj_name << ": delaying push response for " << _delay_millisecs << " millisecs" << endl;
1093 + if (_verbose) std::cout << _obj_name << ": delaying push response for " << _delay_millisecs << " millisecs" << std::endl;
1094 unsigned long t_secs, t_nanosecs;
1095 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
1096 _finish.timedwait(t_secs, t_nanosecs);
1099 TW_SCOPE_LOCK(lock, _oplock, "LegacyPushConsumer", "LegacyPushConsumer_i::diconnect_push_consumer");
1101 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
1102 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
1104 _finish.broadcast();
1106 @@ -231,22 +231,22 @@
1108 admin = channel->for_consumers();
1109 if ( CORBA::is_nil(admin) ) {
1110 - cerr << "Failed to obtain admin" << endl;
1111 + std::cerr << "Failed to obtain admin" << std::endl;
1112 return 0; // failure
1115 - cerr << "Failed to obtain admin" << endl;
1116 + std::cerr << "Failed to obtain admin" << std::endl;
1117 return 0; // failure
1119 - if (verbose) cout << "Obtained admin from the channel" << endl;
1120 + if (verbose) std::cout << "Obtained admin from the channel" << std::endl;
1122 proxy = admin->obtain_pull_supplier();
1124 if ( CORBA::is_nil(proxy) ) {
1125 - cerr << "Failed to obtain proxy" << endl;
1126 + std::cerr << "Failed to obtain proxy" << std::endl;
1129 - if (verbose) cout << "Obtained proxy from admin" << endl;
1130 + if (verbose) std::cout << "Obtained proxy from admin" << std::endl;
1132 // Construct a client
1133 LegacyPullConsumer_i* client =
1134 @@ -261,17 +261,17 @@
1136 _my_proxy->connect_pull_consumer(_this());
1137 } catch (CORBA::BAD_PARAM& ex) {
1138 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
1139 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
1141 } catch (CosEA::AlreadyConnected& ex) {
1142 - cerr << _obj_name << ": Already connected" << endl;
1143 + std::cerr << _obj_name << ": Already connected" << std::endl;
1146 - cerr << _obj_name << ": Failed to connect" << endl;
1147 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
1150 // spawn a thread to do pulling
1151 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
1152 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
1153 _worker = new GenericBoundWorkerThread(this);
1157 { // introduce lock scope
1158 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullConsumer", "LegacyPullConsumer_i::cleanup");
1159 if (_worker || (!_done)) {
1160 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
1161 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
1164 // this method takes sole ownership of _my_proxy ref
1166 { // introduce lock scope
1167 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullConsumer", "LegacyPullConsumer_i::start_working");
1169 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main pull loop" << endl;
1170 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main pull loop" << std::endl;
1172 if (_done) break; // must have disconnected
1173 { // introduce temporary lock release scope; do not hold oplock across pull
1175 } // end temporary lock release scope
1176 if (_done) break; // must have disconnected during pull
1178 - if (_verbose) cout << _obj_name << ": strange failure: pull() returned nil" << endl;
1179 + if (_verbose) std::cout << _obj_name << ": strange failure: pull() returned nil" << std::endl;
1181 break; // break from while loop -- done
1183 @@ -330,11 +330,11 @@
1186 (*_consume_fn)(*data, _obj_name, _num_events, _verbose);
1187 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
1188 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
1191 if (_max_events && (_num_events >= _max_events)) {
1192 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
1193 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
1196 if (_millisecs) { // sleep for specified interval
1198 continue; // continue pulling
1201 - if (_verbose) cout << _obj_name << ": communication error while calling pull()" << endl;
1202 + if (_verbose) std::cout << _obj_name << ": communication error while calling pull()" << std::endl;
1204 break; // break from while loop -- done
1208 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullConsumer", "LegacyPullConsumer_i::disconnect_pull_consumer");
1210 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
1211 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
1213 _finish.broadcast();
1215 @@ -422,22 +422,22 @@
1217 admin = channel->for_suppliers();
1218 if ( CORBA::is_nil(admin) ) {
1219 - cerr << "Failed to obtain admin" << endl;
1220 + std::cerr << "Failed to obtain admin" << std::endl;
1221 return 0; // failure
1224 - cerr << "Failed to obtain admin" << endl;
1225 + std::cerr << "Failed to obtain admin" << std::endl;
1226 return 0; // failure
1228 - if (verbose) cout << "Obtained admin from the channel" << endl;
1229 + if (verbose) std::cout << "Obtained admin from the channel" << std::endl;
1231 proxy = admin->obtain_push_consumer();
1233 if ( CORBA::is_nil(proxy) ) {
1234 - cerr << "Failed to obtain proxy" << endl;
1235 + std::cerr << "Failed to obtain proxy" << std::endl;
1236 return 0; // failure
1238 - if (verbose) cout << "Obtained proxy from admin" << endl;
1239 + if (verbose) std::cout << "Obtained proxy from admin" << std::endl;
1241 // Construct a client
1242 LegacyPushSupplier_i* client =
1243 @@ -452,17 +452,17 @@
1245 _my_proxy->connect_push_supplier(_this());
1246 } catch (CORBA::BAD_PARAM& ex) {
1247 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
1248 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
1250 } catch (CosEA::AlreadyConnected& ex) {
1251 - cerr << _obj_name << ": Already connected" << endl;
1252 + std::cerr << _obj_name << ": Already connected" << std::endl;
1255 - cerr << _obj_name << ": Failed to connect" << endl;
1256 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
1259 // spawn a thread to do pushing
1260 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
1261 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
1262 _worker = new GenericBoundWorkerThread(this);
1266 { // introduce lock scope
1267 TW_SCOPE_LOCK(lock, _oplock, "LegacyPushSupplier", "LegacyPushSupplier_i::cleanup");
1268 if (_worker || (!_done)) {
1269 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
1270 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
1273 // this method takes sole ownership of _my_proxy ref
1275 { // introduce lock scope
1276 TW_SCOPE_LOCK(lock, _oplock, "LegacyPushSupplier", "LegacyPushSupplier_i::start_working");
1278 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main push loop" << endl;
1279 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main push loop" << std::endl;
1281 if (_done) break; // must have disconnected
1282 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
1284 if (_done) break; // must have disconnected during push
1286 // [rather than doing the following we let supply_fn report if it wants to]
1287 - // if (_verbose) cout << _obj_name << ": Pushed an event, event count = " << _num_events << endl;
1288 + // if (_verbose) std::cout << _obj_name << ": Pushed an event, event count = " << _num_events << std::endl;
1289 if (_max_events && (_num_events >= _max_events)) {
1290 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
1291 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
1296 continue; // continue pushing
1298 if (_done) break; // must have disconnected during push
1299 - if (_verbose) cout << _obj_name << ": communication error while calling push()" << endl;
1300 + if (_verbose) std::cout << _obj_name << ": communication error while calling push()" << std::endl;
1302 break; // break from while loop -- done
1306 TW_SCOPE_LOCK(lock, _oplock, "LegacyPushSupplier", "LegacyPushSupplier_i::disconnect_push_supplier");
1308 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
1309 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
1311 _finish.broadcast();
1313 @@ -606,22 +606,22 @@
1315 admin = channel->for_suppliers();
1316 if ( CORBA::is_nil(admin) ) {
1317 - cerr << "Failed to obtain admin" << endl;
1318 + std::cerr << "Failed to obtain admin" << std::endl;
1319 return 0; // failure
1322 - cerr << "Failed to obtain admin" << endl;
1323 + std::cerr << "Failed to obtain admin" << std::endl;
1324 return 0; // failure
1326 - if (verbose) cout << "Obtained admin from the channel" << endl;
1327 + if (verbose) std::cout << "Obtained admin from the channel" << std::endl;
1329 proxy = admin->obtain_pull_consumer();
1331 if ( CORBA::is_nil(proxy) ) {
1332 - cerr << "Failed to obtain proxy" << endl;
1333 + std::cerr << "Failed to obtain proxy" << std::endl;
1334 return 0; // failure
1336 - if (verbose) cout << "Obtained proxy from admin" << endl;
1337 + if (verbose) std::cout << "Obtained proxy from admin" << std::endl;
1339 // Construct a client
1340 LegacyPullSupplier_i* client =
1341 @@ -636,16 +636,16 @@
1343 _my_proxy->connect_pull_supplier(_this());
1344 } catch (CORBA::BAD_PARAM& ex) {
1345 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
1346 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
1348 } catch (CosEA::AlreadyConnected& ex) {
1349 - cerr << _obj_name << ": Already connected" << endl;
1350 + std::cerr << _obj_name << ": Already connected" << std::endl;
1353 - cerr << _obj_name << ": Failed to connect" << endl;
1354 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
1357 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
1358 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
1359 // if _millisecs is set, spawn a thread to ping the proxy
1361 _worker = new GenericBoundWorkerThread(this);
1363 { // introduce lock scope
1364 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullSupplier", "LegacyPullSupplier_i::cleanup");
1365 if (_worker || (!_done)) {
1366 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
1367 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
1370 // this method takes sole ownership of _my_proxy ref
1373 { // introduce lock scope
1374 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullSupplier", "LegacyPullSupplier_i::start_working");
1375 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
1376 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
1377 // invariant: _oplock held at top of loop
1379 if (_done || (_millisecs == 0)) break;
1381 continue; // continue ping loop
1384 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using connect_pull_supplier" << endl;
1385 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using connect_pull_supplier" << std::endl;
1387 _finish.broadcast();
1391 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullSupplier", "LegacyPullSupplier_i::try_pull");
1392 if (_done) return data;
1393 - if (_verbose) cout << _obj_name << ": Channel called try_pull" << endl;
1394 + if (_verbose) std::cout << _obj_name << ": Channel called try_pull" << std::endl;
1396 // If we reached done point during last try_pull, it is broadcast now
1397 // and we return from this try_pull call without an event.
1398 @@ -730,10 +730,10 @@
1399 // processed the previous try_pull (the final supplied event) before
1400 // we disconnect this supplier.
1401 if (_max_events && (_num_events >= _max_events)) {
1402 - if (_verbose) cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << endl;
1403 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << std::endl;
1405 _finish.broadcast();
1406 - if (_verbose) cout << _obj_name << ": NOT returning an event" << endl;
1407 + if (_verbose) std::cout << _obj_name << ": NOT returning an event" << std::endl;
1411 @@ -741,14 +741,14 @@
1414 // [rather than doing the following we let supply_fn report if it wants to]
1415 - // if (_verbose) cout << _obj_name << ": Returning an event, event count = " << _num_events << endl;
1416 + // if (_verbose) std::cout << _obj_name << ": Returning an event, event count = " << _num_events << std::endl;
1418 - if (_verbose) cout << _obj_name << ": NOT returning an event" << endl;
1419 + if (_verbose) std::cout << _obj_name << ": NOT returning an event" << std::endl;
1421 if (!_done && _delay_millisecs) {
1422 unsigned long d_secs = _delay_millisecs / 1000;
1423 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
1424 - if (_verbose) cout << _obj_name << ": delaying try_pull response for " << _delay_millisecs << " millisecs" << endl;
1425 + if (_verbose) std::cout << _obj_name << ": delaying try_pull response for " << _delay_millisecs << " millisecs" << std::endl;
1426 unsigned long t_secs, t_nanosecs;
1427 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
1428 _finish.timedwait(t_secs, t_nanosecs);
1430 { // introduce lock scope
1431 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullSupplier", "LegacyPullSupplier_i::pull");
1433 - if (_verbose && (!_done)) cout << _obj_name << ": Channel called pull" << endl;
1434 + if (_verbose && (!_done)) std::cout << _obj_name << ": Channel called pull" << std::endl;
1435 // invariants: _oplock is held entering top of loop and
1436 // also whenever we break out of loop
1439 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
1441 // [rather than doing the following we let supply_fn report if it wants to]
1442 - // if (_verbose) cout << _obj_name << ": Returning an event, event count = " << _num_events << endl;
1443 + // if (_verbose) std::cout << _obj_name << ": Returning an event, event count = " << _num_events << std::endl;
1444 if (_max_events && (_num_events >= _max_events)) {
1445 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
1446 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
1448 _finish.broadcast();
1451 if (!_done && _delay_millisecs) {
1452 unsigned long d_secs = _delay_millisecs / 1000;
1453 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
1454 - if (_verbose) cout << _obj_name << ": delaying pull response for " << _delay_millisecs << " millisecs" << endl;
1455 + if (_verbose) std::cout << _obj_name << ": delaying pull response for " << _delay_millisecs << " millisecs" << std::endl;
1456 unsigned long t_secs, t_nanosecs;
1457 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
1458 _finish.timedwait(t_secs, t_nanosecs);
1461 TW_SCOPE_LOCK(lock, _oplock, "LegacyPullSupplier", "LegacyPullSupplier_i::discconnect_pull_supplier");
1463 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
1464 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
1466 _finish.broadcast();
1468 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/main_program.h omniNotify-2.1.new/examples/main_program.h
1469 --- omniNotify-2.1.orig/examples/main_program.h 2004-03-19 00:39:20.000000000 +0300
1470 +++ omniNotify-2.1.new/examples/main_program.h 2009-06-28 17:24:41.000000000 +0400
1473 #ifndef CREATE_CHANNEL
1474 // (2) Obtain reference to notification channel
1475 - if (verbose) cout << "Obtaining reference to notification channel" << endl;
1476 + if (verbose) std::cout << "Obtaining reference to notification channel" << std::endl;
1477 CosNA::EventChannel_ptr channel = getchan_from_ns(orb, channel_name, verbose);
1478 if (CORBA::is_nil(channel)) { // name service lookup failed
1479 channel = getchan_from_iorfile(orb, ior_file, verbose);
1483 // (2) Create a new notification channel
1484 - if (verbose) cout << "Creating a new notification channel" << endl;
1485 + if (verbose) std::cout << "Creating a new notification channel" << std::endl;
1486 CosNA::EventChannel_ptr channel = getnewchan_use_ns(orb, cfact_name, verbose);
1487 if (CORBA::is_nil(channel)) { // name service lookup failed
1488 channel = getnewchan_use_iorfile(orb, cfact_ior_file, verbose);
1492 // (3) Create a client
1493 - if (verbose) cout << "Creating client" << endl;
1494 + if (verbose) std::cout << "Creating client" << std::endl;
1495 #ifndef LEGACY_CLIENT
1496 CLIENT_IMPL_CLASS* client =
1497 CLIENT_IMPL_CLASS::create(orb, channel, num_events, batch_size, CLIENT_NAME, proxy_ior_file, admin_ior_file,
1499 goto error_return; // failed to create client
1501 // Obtain reference to the external client object
1502 - if (verbose) cout << "Obtaining CORBA object ref to client" << endl;
1503 + if (verbose) std::cout << "Obtaining CORBA object ref to client" << std::endl;
1504 CLIENT_CLASS_VAR myref = client->_this(); // implicit activation
1505 client->_remove_ref(); // enables POA cleanup of servant
1507 // (4) Tell POA we are ready to go
1508 - if (verbose) cout << "Activating POA manager" << endl;
1509 + if (verbose) std::cout << "Activating POA manager" << std::endl;
1510 PortableServer::POAManager_var pman = poa->the_POAManager();
1513 // (5) Connect client to its proxy, wait for desired # of events
1514 - if (verbose) cout << "Connecting client to its proxy" << endl;
1515 + if (verbose) std::cout << "Connecting client to its proxy" << std::endl;
1516 if (client->connect()) {
1517 // an immediate error occurred
1519 - if (verbose) cout << "Waiting for desired # of events" << endl;
1520 + if (verbose) std::cout << "Waiting for desired # of events" << std::endl;
1521 // Wait until num_events has been reached
1522 CORBA::Boolean communication_error = client->wait_done();
1523 if (communication_error && (num_events > 0)) {
1524 - if (verbose) cout << "Communication error -- probably did not process desired # of events" << endl;
1525 + if (verbose) std::cout << "Communication error -- probably did not process desired # of events" << std::endl;
1527 - if (verbose) cout << "Cleaning up" << endl;
1528 + if (verbose) std::cout << "Cleaning up" << std::endl;
1533 catch(CORBA::SystemException&) {
1534 - cerr << "main caught CORBA::SystemException." << endl;
1535 + std::cerr << "main caught CORBA::SystemException." << std::endl;
1537 catch(CORBA::Exception&) {
1538 - cerr << "main caught CORBA::Exception." << endl;
1539 + std::cerr << "main caught CORBA::Exception." << std::endl;
1541 #if defined(__OMNIORB3__) || defined(__OMNIORB4__)
1542 catch(omniORB::fatalException& fe) {
1543 - cerr << "main caught omniORB::fatalException:" << endl;
1544 - cerr << " file: " << fe.file() << endl;
1545 - cerr << " line: " << fe.line() << endl;
1546 - cerr << " mesg: " << fe.errmsg() << endl;
1547 + std::cerr << "main caught omniORB::fatalException:" << std::endl;
1548 + std::cerr << " file: " << fe.file() << std::endl;
1549 + std::cerr << " line: " << fe.line() << std::endl;
1550 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
1554 // nameclt comment says it is a bad idea to report an error here
1556 - cerr << "main caught an exception." << endl;
1557 + std::cerr << "main caught an exception." << std::endl;
1559 #ifdef CREATE_CHANNEL
1560 #ifdef DESTROY_CHANNEL
1562 if (!CORBA::is_nil(channel)) {
1563 - if (verbose) cout << "Destroying the channel we created" << endl;
1564 + if (verbose) std::cout << "Destroying the channel we created" << std::endl;
1569 #ifdef DESTROY_CHANNEL
1571 if (!CORBA::is_nil(channel)) {
1572 - if (verbose) cout << "Destroying the channel we created" << endl;
1573 + if (verbose) std::cout << "Destroying the channel we created" << std::endl;
1577 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/ndadmin.cc omniNotify-2.1.new/examples/ndadmin.cc
1578 --- omniNotify-2.1.orig/examples/ndadmin.cc 2003-10-12 22:51:18.000000000 +0400
1579 +++ omniNotify-2.1.new/examples/ndadmin.cc 2009-06-28 17:09:16.000000000 +0400
1581 #error COS_USES_BOA should not be set for this example
1584 -#include <iostream.h>
1585 +#include <iostream>
1587 #include "orb_init_name.h"
1588 #include "get_channel.h"
1591 static void usage(const char* pname)
1593 - cout << "Usage: " << pname << " [-n name] [-f file] [-v]" << endl;
1594 - cout << " -n name : channel name" << endl;
1595 - cout << " => use event service to lookup this name" << endl;
1596 - cout << " -f file : file containing channel IOR" << endl;
1597 - cout << " => use string_to_object on the IOR" << endl;
1598 - cout << " -v : verbose output" << endl;
1599 - cout << "NOTE: The server has a default channel; " << pname << " finds this channel" << endl;
1600 - cout << " and then goes 'UP' to find the notifd server" << endl;
1602 + std::cout << "Usage: " << pname << " [-n name] [-f file] [-v]" << std::endl;
1603 + std::cout << " -n name : channel name" << std::endl;
1604 + std::cout << " => use event service to lookup this name" << std::endl;
1605 + std::cout << " -f file : file containing channel IOR" << std::endl;
1606 + std::cout << " => use string_to_object on the IOR" << std::endl;
1607 + std::cout << " -v : verbose output" << std::endl;
1608 + std::cout << "NOTE: The server has a default channel; " << pname << " finds this channel" << std::endl;
1609 + std::cout << " and then goes 'UP' to find the notifd server" << std::endl;
1610 + std::cout << std::endl;
1613 int main(int argc, char** argv) {
1617 // (2) Obtain reference to notification channel
1618 - if (verbose) cout << "Obtaining reference to notification channel" << endl;
1619 + if (verbose) std::cout << "Obtaining reference to notification channel" << std::endl;
1620 channel = getchan_from_ns(orb, channel_name, verbose);
1621 if (CORBA::is_nil(channel)) { // name service lookup failed
1622 channel = getchan_from_iorfile(orb, ior_file, verbose);
1623 if (CORBA::is_nil(channel)) {
1624 - if (verbose) cout << "Could not find server's default channel" << endl;
1625 + if (verbose) std::cout << "Could not find server's default channel" << std::endl;
1626 goto err_return; // both methods failed
1630 catch ( CORBA::OBJECT_NOT_EXIST& e ) { docmd_problem = 1; } \
1631 catch ( CORBA::COMM_FAILURE& e ) { docmd_problem = 1; }
1632 if (!success || !target_changed || docmd_problem) {
1633 - if (verbose) cout << "Could not find server's default channel" << endl;
1634 + if (verbose) std::cout << "Could not find server's default channel" << std::endl;
1637 target = next_target;
1639 catch ( CORBA::OBJECT_NOT_EXIST& e ) { docmd_problem = 1; } \
1640 catch ( CORBA::COMM_FAILURE& e ) { docmd_problem = 1; }
1641 if (!success || !target_changed || docmd_problem) {
1642 - if (verbose) cout << "Could not find server's default channel" << endl;
1643 + if (verbose) std::cout << "Could not find server's default channel" << std::endl;
1646 target = AttN::Interactive::_duplicate(next_target);
1647 @@ -119,23 +119,23 @@
1650 catch(CORBA::SystemException&) {
1651 - cerr << pname << " main caught CORBA::SystemException." << endl;
1652 + std::cerr << pname << " main caught CORBA::SystemException." << std::endl;
1654 catch(CORBA::Exception&) {
1655 - cerr << pname << " main caught CORBA::Exception." << endl;
1656 + std::cerr << pname << " main caught CORBA::Exception." << std::endl;
1658 catch(omniORB::fatalException& fe) {
1659 - cerr << "main caught omniORB::fatalException:" << endl;
1660 - cerr << " file: " << fe.file() << endl;
1661 - cerr << " line: " << fe.line() << endl;
1662 - cerr << " mesg: " << fe.errmsg() << endl;
1663 + std::cerr << "main caught omniORB::fatalException:" << std::endl;
1664 + std::cerr << " file: " << fe.file() << std::endl;
1665 + std::cerr << " line: " << fe.line() << std::endl;
1666 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
1669 // nameclt comment says it is a bad idea to report an error here
1671 - cerr << "main caught an exception." << endl;
1672 + std::cerr << "main caught an exception." << std::endl;
1674 - cerr << "QUITTING due to error" << endl;
1675 + std::cerr << "QUITTING due to error" << std::endl;
1679 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/parse_cmd_line.h omniNotify-2.1.new/examples/parse_cmd_line.h
1680 --- omniNotify-2.1.orig/examples/parse_cmd_line.h 2003-10-23 08:39:11.000000000 +0400
1681 +++ omniNotify-2.1.new/examples/parse_cmd_line.h 2009-06-28 17:13:49.000000000 +0400
1683 #define _PARSE_CMD_LINE_H
1686 -#include <iostream.h>
1687 +#include <iostream>
1689 #include "CosNotifyShorthands.h"
1693 static void usage(const char* pname, CORBA::Boolean supports_filters)
1695 - cout << "Usage: " << pname << " [-d #] [-b #] [-m #] [-M #] [-n name] [-f file] [-N name] [-F file] [-p file] [-a file] [-v]";
1696 + std::cout << "Usage: " << pname << " [-d #] [-b #] [-m #] [-M #] [-n name] [-f file] [-N name] [-F file] [-p file] [-a file] [-v]";
1697 if (supports_filters) {
1698 - cout << " [-t types] [-e expr]" << endl;
1699 + std::cout << " [-t types] [-e expr]" << std::endl;
1702 + std::cout << std::endl;
1704 - cout << " -d # : disconnect after # events [default 0 means never disconnect]" << endl;
1705 - cout << " -b # : batch size (only relevant for batch supplier programs) [default 5]" << endl;
1706 - cout << " => must be >= 1" << endl;
1707 - cout << " -m # : # of milliseconds to pause between each push/pull [default 0]" << endl;
1708 - cout << " -M # : # of milliseconds to pause during incoming push, pull, try_pull [default 0]" << endl;
1709 - cout << " (-M only applies to push consumers and pull suppliers)" << endl;
1710 - cout << " -n name : channel name" << endl;
1711 - cout << " => use event service to lookup this name" << endl;
1712 - cout << " -f file : file containing channel IOR" << endl;
1713 - cout << " => use string_to_object on the IOR" << endl;
1714 - cout << " -N name : factory name" << endl;
1715 - cout << " => use event service to lookup this name" << endl;
1716 - cout << " -F file : file containing channel factory IOR" << endl;
1717 - cout << " => use string_to_object on the IOR" << endl;
1718 - cout << " -p file : file to store IOR of the proxy used by this client" << endl;
1719 - cout << " (used by demo_add_filter, demo_offer_change, or demo_subscription_chang)" << endl;
1720 - cout << " -a file : file to store IOR of the admin used by this client" << endl;
1721 - cout << " (used by demo_add_filter, demo_offer_change, or demo_subscription_chang)" << endl;
1722 - cout << " -v : verbose output" << endl;
1724 + std::cout << " -d # : disconnect after # events [default 0 means never disconnect]" << std::endl;
1725 + std::cout << " -b # : batch size (only relevant for batch supplier programs) [default 5]" << std::endl;
1726 + std::cout << " => must be >= 1" << std::endl;
1727 + std::cout << " -m # : # of milliseconds to pause between each push/pull [default 0]" << std::endl;
1728 + std::cout << " -M # : # of milliseconds to pause during incoming push, pull, try_pull [default 0]" << std::endl;
1729 + std::cout << " (-M only applies to push consumers and pull suppliers)" << std::endl;
1730 + std::cout << " -n name : channel name" << std::endl;
1731 + std::cout << " => use event service to lookup this name" << std::endl;
1732 + std::cout << " -f file : file containing channel IOR" << std::endl;
1733 + std::cout << " => use string_to_object on the IOR" << std::endl;
1734 + std::cout << " -N name : factory name" << std::endl;
1735 + std::cout << " => use event service to lookup this name" << std::endl;
1736 + std::cout << " -F file : file containing channel factory IOR" << std::endl;
1737 + std::cout << " => use string_to_object on the IOR" << std::endl;
1738 + std::cout << " -p file : file to store IOR of the proxy used by this client" << std::endl;
1739 + std::cout << " (used by demo_add_filter, demo_offer_change, or demo_subscription_chang)" << std::endl;
1740 + std::cout << " -a file : file to store IOR of the admin used by this client" << std::endl;
1741 + std::cout << " (used by demo_add_filter, demo_offer_change, or demo_subscription_chang)" << std::endl;
1742 + std::cout << " -v : verbose output" << std::endl;
1743 + std::cout << std::endl;
1744 if (supports_filters) {
1745 - cout << "Options for adding a filter:" << endl;
1746 - cout << " -t types : add a filter for the specified types, which should be a" << endl;
1747 - cout << " comma-separated list of types of the form D::T" << endl;
1748 - cout << " -e expr : add a filter with the specified boolean expression" << endl;
1750 - cout << "If only -t specified, the expression \"true\" is used for the filter" << endl;
1751 - cout << "If only -e specified, the event type \"*::*\" is used for the filter" << endl;
1754 - cout << "If both -n and -f are specified, the -n option is tried first" << endl;
1756 - cout << "If neither -n or -f is specified, program first tries name service" << endl;
1757 - cout << "using name \"EventChannel\", then default IOR file /tmp/rdichan.ior" << endl;
1759 + std::cout << "Options for adding a filter:" << std::endl;
1760 + std::cout << " -t types : add a filter for the specified types, which should be a" << std::endl;
1761 + std::cout << " comma-separated list of types of the form D::T" << std::endl;
1762 + std::cout << " -e expr : add a filter with the specified boolean expression" << std::endl;
1763 + std::cout << std::endl;
1764 + std::cout << "If only -t specified, the expression \"true\" is used for the filter" << std::endl;
1765 + std::cout << "If only -e specified, the event type \"*::*\" is used for the filter" << std::endl;
1766 + std::cout << std::endl;
1768 + std::cout << "If both -n and -f are specified, the -n option is tried first" << std::endl;
1769 + std::cout << std::endl;
1770 + std::cout << "If neither -n or -f is specified, program first tries name service" << std::endl;
1771 + std::cout << "using name \"EventChannel\", then default IOR file /tmp/rdichan.ior" << std::endl;
1772 + std::cout << std::endl;
1775 // return 0 if etype_list is a valid comma-separated event type list
1776 @@ -201,12 +201,12 @@
1777 cfact_ior_file = (char*)"/tmp/rdifact.ior";
1779 if ( (!supports_filters) && ( strlen(etype_list) || strlen(constraint_expr) ) ) {
1780 - cout << "Filter options not supported for this client" << endl;
1781 + std::cout << "Filter options not supported for this client" << std::endl;
1782 usage(pname, supports_filters);
1785 if (strlen(etype_list) && parse_etype_list(etype_list, evs)) {
1786 - cout << "Event type list for -t option must be comma-separated list of D::T" << endl << endl;
1787 + std::cout << "Event type list for -t option must be comma-separated list of D::T" << std::endl << std::endl;
1788 usage(pname, supports_filters);
1791 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/sample_clients.cc omniNotify-2.1.new/examples/sample_clients.cc
1792 --- omniNotify-2.1.orig/examples/sample_clients.cc 2003-10-23 08:39:11.000000000 +0400
1793 +++ omniNotify-2.1.new/examples/sample_clients.cc 2009-06-28 17:17:16.000000000 +0400
1798 -#include <fstream.h>
1799 -#include <iostream.h>
1800 -#include <iomanip.h>
1802 +#include <iostream>
1805 #ifdef HAVE_UNISTD_H
1806 # include <unistd.h>
1809 // This helper routine informs channel that type ANY will be supplied
1810 void offer_any(CosNC::NotifyPublish_ptr proxy, const char* objnm, CORBA::Boolean verbose) {
1811 - if (verbose) cout << objnm << ": offering type %ANY" << endl;
1812 + if (verbose) std::cout << objnm << ": offering type %ANY" << std::endl;
1813 CosN::EventTypeSeq added, deled;
1815 added[0].domain_name = CORBA::string_dup("");
1818 proxy->offer_change(added, deled);
1820 - if (verbose) cout << "** registration failed **" << endl;
1821 + if (verbose) std::cout << "** registration failed **" << std::endl;
1825 // This helper routine informs channel that types Stock::Ticker and Bond::Ticker will be supplied
1826 void offer_ticker(CosNC::NotifyPublish_ptr proxy, const char* objnm, CORBA::Boolean verbose) {
1827 - if (verbose) cout << objnm << ": offering types Stock::Ticker and Bond::Ticker" << endl;
1828 + if (verbose) std::cout << objnm << ": offering types Stock::Ticker and Bond::Ticker" << std::endl;
1829 CosN::EventTypeSeq added, deled;
1831 added[0].domain_name = CORBA::string_dup("Stock");
1834 proxy->offer_change(added, deled);
1836 - if (verbose) cout << "** registration failed **" << endl;
1837 + if (verbose) std::cout << "** registration failed **" << std::endl;
1841 @@ -104,19 +104,19 @@
1842 void write_ior_to_file(CORBA::ORB_ptr orb, CORBA::Object_ptr o,
1843 const char* filenm, CORBA::Boolean verbose) {
1844 if (strlen(filenm) == 0) {
1845 - if (verbose) cout << "ior filename empty -- skipping" << endl;
1846 + if (verbose) std::cout << "ior filename empty -- skipping" << std::endl;
1849 - ofstream file(filenm, ios::out);
1850 + std::ofstream file(filenm, std::ios::out);
1852 - if (verbose) cerr << "Failed to open IOR file: " << filenm << endl;
1853 + if (verbose) std::cerr << "Failed to open IOR file: " << filenm << std::endl;
1856 char* ior_name = orb->object_to_string(o);
1860 - if (verbose) cout << "wrote IOR to file: " << filenm << endl;
1861 + if (verbose) std::cout << "wrote IOR to file: " << filenm << std::endl;
1864 // These 2 helper routines are used to obtain one of the
1865 @@ -138,14 +138,14 @@
1867 admin = channel->new_for_suppliers(ifoper, admID);
1868 if ( CORBA::is_nil(admin) ) {
1869 - cerr << "Failed to obtain admin" << endl;
1870 + std::cerr << "Failed to obtain admin" << std::endl;
1871 return generic_proxy; // failure
1874 - cerr << "Failed to obtain admin" << endl;
1875 + std::cerr << "Failed to obtain admin" << std::endl;
1876 return generic_proxy; // failure
1878 - if (verbose) cout << "Obtained admin from the channel" << endl;
1879 + if (verbose) std::cout << "Obtained admin from the channel" << std::endl;
1881 CosNA::ProxyID prxID;
1883 @@ -156,14 +156,14 @@
1886 if (CORBA::is_nil(generic_proxy)) {
1887 - cerr << "Failed to obtain proxy" << endl;
1888 + std::cerr << "Failed to obtain proxy" << std::endl;
1892 admin = CosNA::SupplierAdmin::_nil();
1893 return generic_proxy;
1895 - if (verbose) cout << "Obtained proxy from admin" << endl;
1896 + if (verbose) std::cout << "Obtained proxy from admin" << std::endl;
1897 write_ior_to_file(orb, admin, admin_ior_file, verbose);
1898 return generic_proxy; // success if generic_proxy is non-nil, otherwise failure
1900 @@ -183,14 +183,14 @@
1902 admin = channel->new_for_consumers(ifoper, admID);
1903 if ( CORBA::is_nil(admin) ) {
1904 - cerr << "Failed to obtain admin" << endl;
1905 + std::cerr << "Failed to obtain admin" << std::endl;
1906 return generic_proxy; // failure
1909 - cerr << "Failed to obtain admin" << endl;
1910 + std::cerr << "Failed to obtain admin" << std::endl;
1911 return generic_proxy; // failure
1913 - if (verbose) cout << "Obtained admin from the channel" << endl;
1914 + if (verbose) std::cout << "Obtained admin from the channel" << std::endl;
1916 CosNA::ProxyID prxID;
1918 @@ -201,14 +201,14 @@
1921 if (CORBA::is_nil(generic_proxy)) {
1922 - cerr << "Failed to obtain proxy" << endl;
1923 + std::cerr << "Failed to obtain proxy" << std::endl;
1927 admin = CosNA::ConsumerAdmin::_nil();
1928 return generic_proxy;
1930 - if (verbose) cout << "Obtained proxy from admin" << endl;
1931 + if (verbose) std::cout << "Obtained proxy from admin" << std::endl;
1932 write_ior_to_file(orb, admin, admin_ior_file, verbose);
1933 return generic_proxy; // success if generic_proxy is non-nil, otherwise failure
1935 @@ -226,24 +226,24 @@
1936 CORBA::Boolean verbose) {
1937 // if evs and constraint expr are empty, we ignore them + do not add a filter
1938 if ( (evs.length() == 0) && (strlen(constraint_expr) == 0) ) {
1939 - if (verbose) cout << obj_name << ": (no filter used)" << endl;
1940 + if (verbose) std::cout << obj_name << ": (no filter used)" << std::endl;
1943 // Obtain a reference to the default filter factory; create a filter object
1944 CosNF::FilterFactory_ptr ffp;
1945 filter = CosNF::Filter::_nil();
1947 - if (verbose) cout << obj_name << ": Obtaining default filter factory" << endl;
1948 + if (verbose) std::cout << obj_name << ": Obtaining default filter factory" << std::endl;
1949 ffp = channel->default_filter_factory();
1950 filter = ffp->create_filter("EXTENDED_TCL");
1951 } catch (CORBA::COMM_FAILURE& ex) {
1952 - cerr << obj_name << ": Caught COMM_FAILURE obtaining filter object" << endl;
1953 + std::cerr << obj_name << ": Caught COMM_FAILURE obtaining filter object" << std::endl;
1956 - cerr << obj_name << ": Caught exception obtaining filter object" << endl;
1957 + std::cerr << obj_name << ": Caught exception obtaining filter object" << std::endl;
1960 - if (verbose) cout << obj_name << ": Obtained filter from default filter factory" << endl;
1961 + if (verbose) std::cout << obj_name << ": Obtained filter from default filter factory" << std::endl;
1963 // Construct a simple constraint expression; add it to fadmin
1964 CosNF::ConstraintExpSeq exp;
1965 @@ -252,32 +252,32 @@
1966 exp[0].constraint_expr = CORBA::string_dup(constraint_expr);
1967 CORBA::Boolean res = 0; // OK
1969 - if (verbose) cout << obj_name << ": Adding constraints to filter" << endl;
1970 + if (verbose) std::cout << obj_name << ": Adding constraints to filter" << std::endl;
1971 filter->add_constraints(exp);
1972 - if (verbose) cout << obj_name << ": Adding filter to target" << endl;
1973 + if (verbose) std::cout << obj_name << ": Adding filter to target" << std::endl;
1974 fadmin->add_filter(filter);
1977 - cout << obj_name << ": Added filter for types ";
1978 + std::cout << obj_name << ": Added filter for types ";
1979 for (unsigned int j = 0; j < evs.length(); j++) {
1980 - cout << (const char*)evs[j].domain_name << "::" << (const char*)evs[j].type_name;
1981 + std::cout << (const char*)evs[j].domain_name << "::" << (const char*)evs[j].type_name;
1982 if ((j+1) < evs.length())
1984 + std::cout << ", ";
1987 - cout << obj_name << ": Added filter for type *::* ";
1988 + std::cout << obj_name << ": Added filter for type *::* ";
1990 - cout << " and constraint expression \"" << constraint_expr << "\" " << endl;
1991 + std::cout << " and constraint expression \"" << constraint_expr << "\" " << std::endl;
1994 catch(CosNF::InvalidConstraint& _exobj1) {
1995 - cerr << obj_name << ": Exception thrown : Invalid constraint given "
1996 - << (const char *)constraint_expr << endl;
1997 + std::cerr << obj_name << ": Exception thrown : Invalid constraint given "
1998 + << (const char *)constraint_expr << std::endl;
2002 - cerr << obj_name << ": Exception thrown while adding constraint "
2003 - << (const char *)constraint_expr << endl;
2004 + std::cerr << obj_name << ": Exception thrown while adding constraint "
2005 + << (const char *)constraint_expr << std::endl;
2008 if (res == 1) { // error so destroy filter
2009 @@ -306,17 +306,17 @@
2010 CosNF::FilterFactory_ptr ffp;
2011 filter = CosNF::Filter::_nil();
2013 - if (verbose) cout << obj_name << ": Obtaining default filter factory" << endl;
2014 + if (verbose) std::cout << obj_name << ": Obtaining default filter factory" << std::endl;
2015 ffp = channel->default_filter_factory();
2016 filter = ffp->create_filter("EXTENDED_TCL");
2017 } catch (CORBA::COMM_FAILURE& ex) {
2018 - cerr << obj_name << ": Caught COMM_FAILURE obtaining filter object" << endl;
2019 + std::cerr << obj_name << ": Caught COMM_FAILURE obtaining filter object" << std::endl;
2022 - cerr << obj_name << ": Caught exception obtaining filter object" << endl;
2023 + std::cerr << obj_name << ": Caught exception obtaining filter object" << std::endl;
2026 - if (verbose) cout << obj_name << ": Obtained filter from default filter factory" << endl;
2027 + if (verbose) std::cout << obj_name << ": Obtained filter from default filter factory" << std::endl;
2029 // Construct a simple constraint expression; add it to fadmin
2030 CosNF::ConstraintExpSeq exp;
2031 @@ -327,29 +327,29 @@
2032 exp[0].constraint_expr = CORBA::string_dup("true");
2033 CORBA::Boolean res = 0; // OK
2035 - if (verbose) cout << obj_name << ": Adding initial dummy constraint to filter" << endl;
2036 + if (verbose) std::cout << obj_name << ": Adding initial dummy constraint to filter" << std::endl;
2038 - cout << obj_name << ": Adding constraint with dummy type Type_XXX and constraint \"true\" to filter" << endl;
2039 + std::cout << obj_name << ": Adding constraint with dummy type Type_XXX and constraint \"true\" to filter" << std::endl;
2041 filter->add_constraints(exp);
2042 - if (verbose) cout << obj_name << ": Adding filter to target" << endl;
2043 + if (verbose) std::cout << obj_name << ": Adding filter to target" << std::endl;
2044 fadmin->add_filter(filter);
2045 for (int i = 0; i < 512; i++) {
2047 sprintf(buf, "Type_%03d", i);
2048 exp[0].event_types[0].type_name = CORBA::string_dup(buf);
2050 - cout << obj_name << ": Adding constraint with type " << buf << " and constraint \"true\" to filter" << endl;
2051 + std::cout << obj_name << ": Adding constraint with type " << buf << " and constraint \"true\" to filter" << std::endl;
2053 filter->add_constraints(exp);
2056 catch(CosNF::InvalidConstraint& _exobj1) {
2057 - cerr << obj_name << ": Exception thrown : Invalid constraint given" << endl;
2058 + std::cerr << obj_name << ": Exception thrown : Invalid constraint given" << std::endl;
2062 - cerr << obj_name << ": Exception thrown while adding constraint/filter" << endl;
2063 + std::cerr << obj_name << ": Exception thrown while adding constraint/filter" << std::endl;
2067 @@ -445,16 +445,16 @@
2068 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2070 } catch (CORBA::BAD_PARAM& ex) {
2071 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2072 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2074 } catch (CosEvCA::AlreadyConnected& ex) {
2075 - cerr << _obj_name << ": Already connected" << endl;
2076 + std::cerr << _obj_name << ": Already connected" << std::endl;
2079 - cerr << _obj_name << ": Failed to connect" << endl;
2080 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2083 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2084 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2085 // if _millisecs is set, spawn a thread to ping the proxy
2087 _worker = new GenericBoundWorkerThread(this);
2088 @@ -466,11 +466,11 @@
2089 { // introduce lock scope
2090 TW_SCOPE_LOCK(lock, _oplock, "PushConsumer", "PushConsumer_i::cleanup");
2091 if (_worker || (!_done)) {
2092 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2093 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2096 if (CORBA::is_nil(_my_proxy)) {
2097 - cerr << "Coding error: cleanup already called?" << endl;
2098 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2101 // this method takes sole ownership of _my_proxy
2104 { // introduce lock scope
2105 TW_SCOPE_LOCK(lock, _oplock, "PushConsumer", "PushConsumer_i::start_working");
2106 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
2107 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
2109 if (_done || (_millisecs == 0)) break;
2110 unsigned long t_secs = 0, t_nanosecs = 0;
2112 continue; // continue ping loop
2115 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
2116 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
2118 _finish.broadcast();
2120 @@ -538,16 +538,16 @@
2123 (*_consume_fn)(data, _obj_name, _num_events, _verbose);
2124 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
2125 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
2126 if (_max_events && (_num_events >= _max_events)) {
2127 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2128 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2130 _finish.broadcast();
2132 if (!_done && _delay_millisecs) {
2133 unsigned long d_secs = _delay_millisecs / 1000;
2134 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2135 - if (_verbose) cout << _obj_name << ": delaying push response for " << _delay_millisecs << " millisecs" << endl;
2136 + if (_verbose) std::cout << _obj_name << ": delaying push response for " << _delay_millisecs << " millisecs" << std::endl;
2137 unsigned long t_secs, t_nanosecs;
2138 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2139 _finish.timedwait(t_secs, t_nanosecs);
2142 TW_SCOPE_LOCK(lock, _oplock, "PushConsumer", "PushConsumer_i::disconnect_push_consumer");
2144 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2145 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2147 _finish.broadcast();
2149 @@ -590,11 +590,11 @@
2152 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2153 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2154 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2155 if (!_done && _delay_millisecs) {
2156 unsigned long d_secs = _delay_millisecs / 1000;
2157 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2158 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2159 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2160 unsigned long t_secs, t_nanosecs;
2161 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2162 _finish.timedwait(t_secs, t_nanosecs);
2163 @@ -678,16 +678,16 @@
2164 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2166 } catch (CORBA::BAD_PARAM& ex) {
2167 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2168 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2170 } catch (CosEvCA::AlreadyConnected& ex) {
2171 - cerr << _obj_name << ": Already connected" << endl;
2172 + std::cerr << _obj_name << ": Already connected" << std::endl;
2175 - cerr << _obj_name << ": Failed to connect" << endl;
2176 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2179 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2180 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2181 // if _millisecs is set, spawn a thread to ping the proxy
2183 _worker = new GenericBoundWorkerThread(this);
2184 @@ -699,11 +699,11 @@
2185 { // introduce lock scope
2186 TW_SCOPE_LOCK(lock, _oplock, "StructuredPushConsumer", "StructuredPushConsumer_i::cleanup");
2187 if (_worker || (!_done)) {
2188 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2189 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2192 if (CORBA::is_nil(_my_proxy)) {
2193 - cerr << "Coding error: cleanup already called?" << endl;
2194 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2197 // this method takes sole ownership of _my_proxy ref
2199 { // introduce lock scope
2200 TW_SCOPE_LOCK(lock, _oplock, "StructuredPushConsumer", "StructuredPushConsumer_i::start_working");
2202 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
2203 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
2205 if (_done || (_millisecs == 0)) break;
2206 unsigned long t_secs = 0, t_nanosecs = 0;
2208 continue; // continue ping loop
2211 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
2212 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
2214 _finish.broadcast();
2216 @@ -771,16 +771,16 @@
2219 (*_consume_fn)(data, _obj_name, _num_events, _verbose);
2220 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
2221 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
2222 if (_max_events && (_num_events >= _max_events)) {
2223 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2224 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2226 _finish.broadcast();
2228 if (!_done && _delay_millisecs) {
2229 unsigned long d_secs = _delay_millisecs / 1000;
2230 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2231 - if (_verbose) cout << _obj_name << ": delaying push_structured_event response for " << _delay_millisecs << " millisecs" << endl;
2232 + if (_verbose) std::cout << _obj_name << ": delaying push_structured_event response for " << _delay_millisecs << " millisecs" << std::endl;
2233 unsigned long t_secs, t_nanosecs;
2234 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2235 _finish.timedwait(t_secs, t_nanosecs);
2238 TW_SCOPE_LOCK(lock, _oplock, "StructuredPushConsumer", "StructuredPushConsumer_i::disconnect_structured_push_consumer");
2240 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2241 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2243 _finish.broadcast();
2245 @@ -823,11 +823,11 @@
2248 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2249 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2250 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2251 if (!_done && _delay_millisecs) {
2252 unsigned long d_secs = _delay_millisecs / 1000;
2253 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2254 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2255 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2256 unsigned long t_secs, t_nanosecs;
2257 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2258 _finish.timedwait(t_secs, t_nanosecs);
2259 @@ -922,16 +922,16 @@
2260 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2262 } catch (CORBA::BAD_PARAM& ex) {
2263 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2264 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2266 } catch (CosEvCA::AlreadyConnected& ex) {
2267 - cerr << _obj_name << ": Already connected" << endl;
2268 + std::cerr << _obj_name << ": Already connected" << std::endl;
2271 - cerr << _obj_name << ": Failed to connect" << endl;
2272 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2275 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2276 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2277 // if _millisecs is set, spawn a thread to ping the proxy
2279 _worker = new GenericBoundWorkerThread(this);
2280 @@ -943,11 +943,11 @@
2281 { // introduce lock scope
2282 TW_SCOPE_LOCK(lock, _oplock, "Structured512PushConsumer", "Structured512PushConsumer_i::cleanup");
2283 if (_worker || (!_done)) {
2284 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2285 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2288 if (CORBA::is_nil(_my_proxy)) {
2289 - cerr << "Coding error: cleanup already called?" << endl;
2290 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2293 // this method takes sole ownership of _my_proxy ref
2295 { // introduce lock scope
2296 TW_SCOPE_LOCK(lock, _oplock, "Structured512PushConsumer", "Structured512PushConsumer_i::start_working");
2298 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
2299 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
2300 // invariant: _oplock held at top of loop
2302 if (_done || (_millisecs == 0)) break;
2304 continue; // continue ping loop
2307 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
2308 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
2310 _finish.broadcast();
2312 @@ -1016,16 +1016,16 @@
2315 (*_consume_fn)(data, _obj_name, _num_events, _verbose);
2316 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
2317 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
2318 if (_max_events && (_num_events >= _max_events)) {
2319 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2320 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2322 _finish.broadcast();
2324 if (!_done && _delay_millisecs) {
2325 unsigned long d_secs = _delay_millisecs / 1000;
2326 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2327 - if (_verbose) cout << _obj_name << ": delaying push_structured_event response for " << _delay_millisecs << " millisecs" << endl;
2328 + if (_verbose) std::cout << _obj_name << ": delaying push_structured_event response for " << _delay_millisecs << " millisecs" << std::endl;
2329 unsigned long t_secs, t_nanosecs;
2330 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2331 _finish.timedwait(t_secs, t_nanosecs);
2332 @@ -1038,7 +1038,7 @@
2334 TW_SCOPE_LOCK(lock, _oplock, "Structured512PushConsumer", "Structured512PushConsumer_i::disconnect_structured_push_consumer");
2336 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2337 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2339 _finish.broadcast();
2341 @@ -1068,11 +1068,11 @@
2344 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2345 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2346 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2347 if (!_done && _delay_millisecs) {
2348 unsigned long d_secs = _delay_millisecs / 1000;
2349 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2350 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2351 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2352 unsigned long t_secs, t_nanosecs;
2353 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2354 _finish.timedwait(t_secs, t_nanosecs);
2355 @@ -1155,16 +1155,16 @@
2356 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2358 } catch (CORBA::BAD_PARAM& ex) {
2359 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2360 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2362 } catch (CosEvCA::AlreadyConnected& ex) {
2363 - cerr << _obj_name << ": Already connected" << endl;
2364 + std::cerr << _obj_name << ": Already connected" << std::endl;
2367 - cerr << _obj_name << ": Failed to connect" << endl;
2368 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2371 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2372 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2373 // if _millisecs is set, spawn a thread to ping the proxy
2375 _worker = new GenericBoundWorkerThread(this);
2376 @@ -1176,11 +1176,11 @@
2377 { // introduce lock scope
2378 TW_SCOPE_LOCK(lock, _oplock, "SequencePushConsumer", "SequencePushConsumer_i::cleanup");
2379 if (_worker || (!_done)) {
2380 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2381 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2384 if (CORBA::is_nil(_my_proxy)) {
2385 - cerr << "Coding error: cleanup already called?" << endl;
2386 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2389 // this method takes sole ownership of _my_proxy ref
2390 @@ -1207,7 +1207,7 @@
2391 { // introduce lock scope
2392 TW_SCOPE_LOCK(lock, _oplock, "SequencePushConsumer", "SequencePushConsumer_i::start_working");
2394 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
2395 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
2396 // invariant: _oplock held at top of loop
2398 if (_done || (_millisecs == 0)) break;
2399 @@ -1230,7 +1230,7 @@
2400 continue; // continue ping loop
2403 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
2404 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
2406 _finish.broadcast();
2408 @@ -1250,16 +1250,16 @@
2409 _num_events += data.length();
2411 (*_consume_fn)(data, _obj_name, _num_events, _num_batches, _verbose);
2412 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << " batch count = " << _num_batches << endl;
2413 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << " batch count = " << _num_batches << std::endl;
2414 if (_max_events && (_num_events >= _max_events)) {
2415 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2416 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2418 _finish.broadcast();
2420 if (!_done && _delay_millisecs) {
2421 unsigned long d_secs = _delay_millisecs / 1000;
2422 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2423 - if (_verbose) cout << _obj_name << ": delaying push_structured_events response for " << _delay_millisecs << " millisecs" << endl;
2424 + if (_verbose) std::cout << _obj_name << ": delaying push_structured_events response for " << _delay_millisecs << " millisecs" << std::endl;
2425 unsigned long t_secs, t_nanosecs;
2426 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2427 _finish.timedwait(t_secs, t_nanosecs);
2428 @@ -1272,7 +1272,7 @@
2430 TW_SCOPE_LOCK(lock, _oplock, "SequencePushConsumer", "SequencePushConsumer_i::disconnect_sequence_push_consumer");
2432 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2433 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2435 _finish.broadcast();
2437 @@ -1302,11 +1302,11 @@
2440 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2441 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2442 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2443 if (!_done && _delay_millisecs) {
2444 unsigned long d_secs = _delay_millisecs / 1000;
2445 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2446 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2447 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2448 unsigned long t_secs, t_nanosecs;
2449 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2450 _finish.timedwait(t_secs, t_nanosecs);
2451 @@ -1393,17 +1393,17 @@
2452 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2454 } catch (CORBA::BAD_PARAM& ex) {
2455 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2456 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2458 } catch (CosEvCA::AlreadyConnected& ex) {
2459 - cerr << _obj_name << ": Already connected" << endl;
2460 + std::cerr << _obj_name << ": Already connected" << std::endl;
2463 - cerr << _obj_name << ": Failed to connect" << endl;
2464 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2467 // spawn a thread to do pulling
2468 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2469 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2470 _worker = new GenericBoundWorkerThread(this);
2473 @@ -1413,11 +1413,11 @@
2474 { // introduce lock scope
2475 TW_SCOPE_LOCK(lock, _oplock, "PullConsumer", "PullConsumer_i::cleanup");
2476 if (_worker || (!_done)) {
2477 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2478 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2481 if (CORBA::is_nil(_my_proxy)) {
2482 - cerr << "Coding error: cleanup already called?" << endl;
2483 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2486 // this method takes sole ownership of _my_proxy ref
2487 @@ -1450,7 +1450,7 @@
2488 { // introduce lock scope
2489 TW_SCOPE_LOCK(lock, _oplock, "PullConsumer", "PullConsumer_i::start_working");
2491 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main pull loop" << endl;
2492 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main pull loop" << std::endl;
2494 if (_done) break; // must have disconnected
2495 { // introduce temporary lock release scope; do not hold oplock across pull
2496 @@ -1463,7 +1463,7 @@
2497 } // end temporary lock release scope
2498 if (_done) break; // must have disconnected during pull
2500 - if (_verbose) cout << _obj_name << ": strange failure: pull() returned nil" << endl;
2501 + if (_verbose) std::cout << _obj_name << ": strange failure: pull() returned nil" << std::endl;
2503 break; // break from while loop -- done
2505 @@ -1471,11 +1471,11 @@
2508 (*_consume_fn)(*data, _obj_name, _num_events, _verbose);
2509 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
2510 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
2513 if (_max_events && (_num_events >= _max_events)) {
2514 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2515 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2518 if (_millisecs) { // sleep for specified interval
2519 @@ -1490,7 +1490,7 @@
2520 continue; // continue pulling
2523 - if (_verbose) cout << _obj_name << ": communication error while calling pull()" << endl;
2524 + if (_verbose) std::cout << _obj_name << ": communication error while calling pull()" << std::endl;
2528 @@ -1510,7 +1510,7 @@
2530 TW_SCOPE_LOCK(lock, _oplock, "PullConsumer", "PullConsumer_i::disconnect_pull_consumer");
2532 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2533 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2535 _finish.broadcast();
2537 @@ -1540,11 +1540,11 @@
2540 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2541 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2542 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2543 if (!_done && _delay_millisecs) {
2544 unsigned long d_secs = _delay_millisecs / 1000;
2545 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2546 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2547 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2548 unsigned long t_secs, t_nanosecs;
2549 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2550 _finish.timedwait(t_secs, t_nanosecs);
2551 @@ -1629,17 +1629,17 @@
2552 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2554 } catch (CORBA::BAD_PARAM& ex) {
2555 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2556 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2558 } catch (CosEvCA::AlreadyConnected& ex) {
2559 - cerr << _obj_name << ": Already connected" << endl;
2560 + std::cerr << _obj_name << ": Already connected" << std::endl;
2563 - cerr << _obj_name << ": Failed to connect" << endl;
2564 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2567 // spawn a thread to do pulling
2568 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2569 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2570 _worker = new GenericBoundWorkerThread(this);
2573 @@ -1649,11 +1649,11 @@
2574 { // introduce lock scope
2575 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullConsumer", "StructuredPullConsumer_i::cleanup");
2576 if (_worker || (!_done)) {
2577 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2578 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2581 if (CORBA::is_nil(_my_proxy)) {
2582 - cerr << "Coding error: cleanup already called?" << endl;
2583 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2586 // this method takes sole ownership of _my_proxy ref
2587 @@ -1686,7 +1686,7 @@
2588 { // introduce lock scope
2589 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullConsumer", "StructuredPullConsumer_i::start_working");
2591 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main pull loop" << endl;
2592 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main pull loop" << std::endl;
2594 if (_done) break; // must have disconnected
2595 { // introduce temporary lock release scope; do not hold oplock across pull
2596 @@ -1699,7 +1699,7 @@
2597 } // end temporary lock release scope
2598 if (_done) break; // must have disconnected during pull
2600 - if (_verbose) cout << _obj_name << ": strange failure: pull_structured_event() returned nil" << endl;
2601 + if (_verbose) std::cout << _obj_name << ": strange failure: pull_structured_event() returned nil" << std::endl;
2603 break; // break from while loop -- done
2605 @@ -1707,11 +1707,11 @@
2608 (*_consume_fn)(*data, _obj_name, _num_events, _verbose);
2609 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << endl;
2610 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << std::endl;
2613 if (_max_events && (_num_events >= _max_events)) {
2614 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2615 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2618 if (_millisecs) { // sleep for specified interval
2619 @@ -1726,7 +1726,7 @@
2620 continue; // continue pulling
2622 if (_done) break; // must have disconnected during pull
2623 - if (_verbose) cout << _obj_name << ": communication error while calling pull_structured_event()" << endl;
2624 + if (_verbose) std::cout << _obj_name << ": communication error while calling pull_structured_event()" << std::endl;
2626 break; // break from while loop -- done
2628 @@ -1747,7 +1747,7 @@
2630 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullConsumer", "StructuredPullConsumer_i::disconnect_structured_pull_consumer");
2632 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2633 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2635 _finish.broadcast();
2637 @@ -1777,11 +1777,11 @@
2640 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2641 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2642 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2643 if (!_done && _delay_millisecs) {
2644 unsigned long d_secs = _delay_millisecs / 1000;
2645 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2646 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2647 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2648 unsigned long t_secs, t_nanosecs;
2649 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2650 _finish.timedwait(t_secs, t_nanosecs);
2651 @@ -1865,17 +1865,17 @@
2652 _my_proxy->obtain_offered_types(CosNA::NONE_NOW_UPDATES_OFF);
2654 } catch (CORBA::BAD_PARAM& ex) {
2655 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2656 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2658 } catch (CosEvCA::AlreadyConnected& ex) {
2659 - cerr << _obj_name << ": Already connected" << endl;
2660 + std::cerr << _obj_name << ": Already connected" << std::endl;
2663 - cerr << _obj_name << ": Failed to connect" << endl;
2664 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2667 // spawn a thread to do pulling
2668 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to consume events" << endl;
2669 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to consume events" << std::endl;
2670 _worker = new GenericBoundWorkerThread(this);
2673 @@ -1885,11 +1885,11 @@
2674 { // introduce lock scope
2675 TW_SCOPE_LOCK(lock, _oplock, "SequencePullConsumer", "SequencePullConsumer_i::connect");
2676 if (_worker || (!_done)) {
2677 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2678 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2681 if (CORBA::is_nil(_my_proxy)) {
2682 - cerr << "Coding error: cleanup already called?" << endl;
2683 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2686 // this method takes sole ownership of _my_proxy ref
2687 @@ -1922,7 +1922,7 @@
2688 { // introduce lock scope
2689 TW_SCOPE_LOCK(lock, _oplock, "SequencePullConsumer", "SequencePullConsumer_i::start_working");
2691 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main pull loop" << endl;
2692 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main pull loop" << std::endl;
2694 if (_done) break; // must have disconnected
2695 { // introduce temporary lock release scope; do not hold oplock across pull
2696 @@ -1935,7 +1935,7 @@
2697 } // end temporary lock release scope
2698 if (_done) break; // must have disconnected during pull
2700 - if (_verbose) cout << _obj_name << ": strange failure: pull_structured_events() returned nil" << endl;
2701 + if (_verbose) std::cout << _obj_name << ": strange failure: pull_structured_events() returned nil" << std::endl;
2703 break; // break from while loop -- done
2705 @@ -1944,11 +1944,11 @@
2706 _num_events += data->length();
2708 (*_consume_fn)(*data, _obj_name, _num_events, _num_batches, _verbose);
2709 - else if (_verbose) cout << _obj_name << ": event count = " << _num_events << " batch count = " << _num_batches << endl;
2710 + else if (_verbose) std::cout << _obj_name << ": event count = " << _num_events << " batch count = " << _num_batches << std::endl;
2713 if (_max_events && (_num_events >= _max_events)) {
2714 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2715 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2718 if (_millisecs) { // sleep for specified interval
2719 @@ -1963,7 +1963,7 @@
2720 continue; // continue pulling
2722 if (_done) break; // must have disconnected during pull
2723 - if (_verbose) cout << _obj_name << ": communication error while calling pull_structured_events()" << endl;
2724 + if (_verbose) std::cout << _obj_name << ": communication error while calling pull_structured_events()" << std::endl;
2726 break; // break from while loop -- done
2728 @@ -1983,7 +1983,7 @@
2730 TW_SCOPE_LOCK(lock, _oplock, "SequencePullConsumer", "SequencePullConsumer_i::disconnect_sequence_pull_consumer");
2732 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2733 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2735 _finish.broadcast();
2737 @@ -2013,11 +2013,11 @@
2740 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2741 - else if (_verbose) cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << endl;
2742 + else if (_verbose) std::cout << _obj_name << ": offer_change received [# " << _num_changes << "]" << std::endl;
2743 if (!_done && _delay_millisecs) {
2744 unsigned long d_secs = _delay_millisecs / 1000;
2745 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2746 - if (_verbose) cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << endl;
2747 + if (_verbose) std::cout << _obj_name << ": delaying offer_change response for " << _delay_millisecs << " millisecs" << std::endl;
2748 unsigned long t_secs, t_nanosecs;
2749 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2750 _finish.timedwait(t_secs, t_nanosecs);
2751 @@ -2115,19 +2115,19 @@
2752 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
2754 } catch (CORBA::BAD_PARAM& ex) {
2755 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2756 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2758 } catch (CosEvCA::AlreadyConnected& ex) {
2759 - cerr << _obj_name << ": Already connected" << endl;
2760 + std::cerr << _obj_name << ": Already connected" << std::endl;
2763 - cerr << _obj_name << ": Failed to connect" << endl;
2764 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2767 // register the types to be supplied
2768 offer_any(_my_proxy, _obj_name, _verbose);
2769 // spawn a thread to do pushing
2770 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
2771 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
2772 _worker = new GenericBoundWorkerThread(this);
2775 @@ -2137,11 +2137,11 @@
2776 { // introduce lock scope
2777 TW_SCOPE_LOCK(lock, _oplock, "PushSupplier", "PushSupplier_i::cleanup");
2778 if (_worker || (!_done)) {
2779 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2780 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2783 if (CORBA::is_nil(_my_proxy)) {
2784 - cerr << "Coding error: cleanup already called?" << endl;
2785 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2788 // this method takes sole ownership of _my_proxy ref
2789 @@ -2174,7 +2174,7 @@
2790 { // introduce lock scope
2791 TW_SCOPE_LOCK(lock, _oplock, "PushSupplier", "PushSupplier_i::start_working");
2793 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main push loop" << endl;
2794 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main push loop" << std::endl;
2796 if (_done) break; // must have disconnected
2797 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
2798 @@ -2189,7 +2189,7 @@
2799 if (_done) break; // must have disconnected during push
2801 if (_max_events && (_num_events >= _max_events)) {
2802 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2803 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2807 @@ -2206,7 +2206,7 @@
2808 continue; // continue pushing
2810 if (_done) break; // must have disconnected during push
2811 - if (_verbose) cout << _obj_name << ": communication error while calling push()" << endl;
2812 + if (_verbose) std::cout << _obj_name << ": communication error while calling push()" << std::endl;
2814 break; // break from while loop -- done
2816 @@ -2226,7 +2226,7 @@
2818 TW_SCOPE_LOCK(lock, _oplock, "PushSupplier", "PushSupplier_i::disconnect_push_supplier");
2820 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2821 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2823 _finish.broadcast();
2825 @@ -2256,11 +2256,11 @@
2828 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2829 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
2830 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
2831 if (!_done && _delay_millisecs) {
2832 unsigned long d_secs = _delay_millisecs / 1000;
2833 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2834 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
2835 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
2836 unsigned long t_secs, t_nanosecs;
2837 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2838 _finish.timedwait(t_secs, t_nanosecs);
2839 @@ -2345,19 +2345,19 @@
2840 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
2842 } catch (CORBA::BAD_PARAM& ex) {
2843 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2844 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2846 } catch (CosEvCA::AlreadyConnected& ex) {
2847 - cerr << _obj_name << ": Already connected" << endl;
2848 + std::cerr << _obj_name << ": Already connected" << std::endl;
2851 - cerr << _obj_name << ": Failed to connect" << endl;
2852 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2855 // register the types to be supplied
2856 offer_ticker(_my_proxy, _obj_name, _verbose);
2857 // spawn a thread to do pushing
2858 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
2859 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
2860 _worker = new GenericBoundWorkerThread(this);
2863 @@ -2367,11 +2367,11 @@
2864 { // introduce lock scope
2865 TW_SCOPE_LOCK(lock, _oplock, "StructuredPushSupplier", "StructuredPushSupplier_i::connect");
2866 if (_worker || (!_done)) {
2867 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2868 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2871 if (CORBA::is_nil(_my_proxy)) {
2872 - cerr << "Coding error: cleanup already called?" << endl;
2873 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2876 // this method takes sole ownership of _my_proxy ref
2877 @@ -2404,7 +2404,7 @@
2878 { // introduce lock scope
2879 TW_SCOPE_LOCK(lock, _oplock, "StructuredPushSupplier", "StructuredPushSupplier_i::start_working");
2881 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main push loop" << endl;
2882 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main push loop" << std::endl;
2884 if (_done) break; // must have disconnected
2885 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
2886 @@ -2419,7 +2419,7 @@
2887 if (_done) break; // must have disconnected during push
2889 if (_max_events && (_num_events >= _max_events)) {
2890 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2891 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2895 @@ -2436,7 +2436,7 @@
2896 continue; // continue pushing
2898 if (_done) break; // must have disconnected during push
2899 - if (_verbose) cout << _obj_name << ": communication error while calling push_structured_event()" << endl;
2900 + if (_verbose) std::cout << _obj_name << ": communication error while calling push_structured_event()" << std::endl;
2902 break; // break from while loop -- done
2904 @@ -2456,7 +2456,7 @@
2906 TW_SCOPE_LOCK(lock, _oplock, "StructuredPushSupplier", "StructuredPushSupplier_i::disconnect_structured_push_supplier");
2908 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2909 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2911 _finish.broadcast();
2913 @@ -2486,11 +2486,11 @@
2916 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
2917 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
2918 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
2919 if (!_done && _delay_millisecs) {
2920 unsigned long d_secs = _delay_millisecs / 1000;
2921 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
2922 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
2923 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
2924 unsigned long t_secs, t_nanosecs;
2925 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
2926 _finish.timedwait(t_secs, t_nanosecs);
2927 @@ -2575,17 +2575,17 @@
2928 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
2930 } catch (CORBA::BAD_PARAM& ex) {
2931 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
2932 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
2934 } catch (CosEvCA::AlreadyConnected& ex) {
2935 - cerr << _obj_name << ": Already connected" << endl;
2936 + std::cerr << _obj_name << ": Already connected" << std::endl;
2939 - cerr << _obj_name << ": Failed to connect" << endl;
2940 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
2943 // spawn a thread to do pushing
2944 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
2945 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
2946 _worker = new GenericBoundWorkerThread(this);
2949 @@ -2595,11 +2595,11 @@
2950 { // introduce lock scope
2951 TW_SCOPE_LOCK(lock, _oplock, "Structured512PushSupplier", "Structured512PushSupplier_i::cleanup");
2952 if (_worker || (!_done)) {
2953 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
2954 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
2957 if (CORBA::is_nil(_my_proxy)) {
2958 - cerr << "Coding error: cleanup already called?" << endl;
2959 + std::cerr << "Coding error: cleanup already called?" << std::endl;
2962 // this method takes sole ownership of _my_proxy ref
2963 @@ -2631,7 +2631,7 @@
2964 CosN::StructuredEvent* data = new CosN::StructuredEvent;
2965 { // introduce lock scope
2966 TW_SCOPE_LOCK(lock, _oplock, "Structured512PushSupplier", "Structured512PushSupplier_i::start_working");
2967 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main push loop" << endl;
2968 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main push loop" << std::endl;
2970 if (_done) break; // must have disconnected
2971 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
2972 @@ -2646,7 +2646,7 @@
2973 if (_done) break; // must have disconnected during push
2975 if (_max_events && (_num_events >= _max_events)) {
2976 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
2977 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
2981 @@ -2663,7 +2663,7 @@
2982 continue; // continue pushing
2984 if (_done) break; // must have disconnected during push
2985 - if (_verbose) cout << _obj_name << ": communication error while calling push_structured_event()" << endl;
2986 + if (_verbose) std::cout << _obj_name << ": communication error while calling push_structured_event()" << std::endl;
2988 break; // break from while loop -- done
2990 @@ -2683,7 +2683,7 @@
2992 TW_SCOPE_LOCK(lock, _oplock, "Structured512PushSupplier", "Structured512PushSupplier_i::disconnect_structured_push_supplier");
2994 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
2995 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
2997 _finish.broadcast();
2999 @@ -2713,11 +2713,11 @@
3002 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
3003 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
3004 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
3005 if (!_done && _delay_millisecs) {
3006 unsigned long d_secs = _delay_millisecs / 1000;
3007 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3008 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
3009 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
3010 unsigned long t_secs, t_nanosecs;
3011 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3012 _finish.timedwait(t_secs, t_nanosecs);
3013 @@ -2807,19 +2807,19 @@
3014 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
3016 } catch (CORBA::BAD_PARAM& ex) {
3017 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
3018 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
3020 } catch (CosEvCA::AlreadyConnected& ex) {
3021 - cerr << _obj_name << ": Already connected" << endl;
3022 + std::cerr << _obj_name << ": Already connected" << std::endl;
3025 - cerr << _obj_name << ": Failed to connect" << endl;
3026 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
3029 // register the types to be supplied
3030 offer_ticker(_my_proxy, _obj_name, _verbose);
3031 // spawn a thread to do pushing
3032 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
3033 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
3034 _worker = new GenericBoundWorkerThread(this);
3037 @@ -2829,11 +2829,11 @@
3038 { // introduce lock scope
3039 TW_SCOPE_LOCK(lock, _oplock, "SequencePushSupplier", "SequencePushSupplier_i::cleanup");
3040 if (_worker || (!_done)) {
3041 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
3042 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
3045 if (CORBA::is_nil(_my_proxy)) {
3046 - cerr << "Coding error: cleanup already called?" << endl;
3047 + std::cerr << "Coding error: cleanup already called?" << std::endl;
3050 // this method takes sole ownership of _my_proxy ref
3051 @@ -2867,7 +2867,7 @@
3052 { // introduce lock scope
3053 TW_SCOPE_LOCK(lock, _oplock, "SequencePushSupplier", "SequencePushSupplier_i::start_working");
3055 - if (_verbose && (!_done)) cout << _obj_name << ": Spawned thread entering main push loop" << endl;
3056 + if (_verbose && (!_done)) std::cout << _obj_name << ": Spawned thread entering main push loop" << std::endl;
3058 if (_done) break; // must have disconnected
3060 @@ -2884,7 +2884,7 @@
3062 _num_events += data->length();
3063 if (_max_events && (_num_events >= _max_events)) {
3064 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
3065 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
3069 @@ -2901,7 +2901,7 @@
3070 continue; // continue pushing
3072 if (_done) break; // must have disconnected during push
3073 - if (_verbose) cout << _obj_name << ": communication error while calling push_structured_events()" << endl;
3074 + if (_verbose) std::cout << _obj_name << ": communication error while calling push_structured_events()" << std::endl;
3076 break; // break from while loop -- done
3078 @@ -2921,7 +2921,7 @@
3080 TW_SCOPE_LOCK(lock, _oplock, "SequencePushSupplier", "SequencePushSupplier_i::disconnect_sequence_push_supplier");
3082 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
3083 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
3085 _finish.broadcast();
3087 @@ -2951,11 +2951,11 @@
3090 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
3091 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
3092 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
3093 if (!_done && _delay_millisecs) {
3094 unsigned long d_secs = _delay_millisecs / 1000;
3095 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3096 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
3097 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
3098 unsigned long t_secs, t_nanosecs;
3099 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3100 _finish.timedwait(t_secs, t_nanosecs);
3101 @@ -3053,16 +3053,16 @@
3102 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
3104 } catch (CORBA::BAD_PARAM& ex) {
3105 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
3106 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
3108 } catch (CosEvCA::AlreadyConnected& ex) {
3109 - cerr << _obj_name << ": Already connected" << endl;
3110 + std::cerr << _obj_name << ": Already connected" << std::endl;
3113 - cerr << _obj_name << ": Failed to connect" << endl;
3114 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
3117 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
3118 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
3119 // register the types to be supplied
3120 offer_any(_my_proxy, _obj_name, _verbose);
3121 // if _millisecs is set, spawn a thread to ping the proxy
3122 @@ -3076,11 +3076,11 @@
3123 { // introduce lock scope
3124 TW_SCOPE_LOCK(lock, _oplock, "PullSupplier", "PullSupplier_i::cleanup");
3125 if (_worker || (!_done)) {
3126 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
3127 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
3130 if (CORBA::is_nil(_my_proxy)) {
3131 - cerr << "Coding error: cleanup already called?" << endl;
3132 + std::cerr << "Coding error: cleanup already called?" << std::endl;
3135 // this method takes sole ownership of _my_proxy ref
3136 @@ -3107,7 +3107,7 @@
3137 { // introduce lock scope
3138 TW_SCOPE_LOCK(lock, _oplock, "PullSupplier", "PullSupplier_i::start_working");
3140 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
3141 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
3143 if (_done || (_millisecs == 0)) break;
3144 unsigned long t_secs = 0, t_nanosecs = 0;
3145 @@ -3129,7 +3129,7 @@
3146 continue; // continue ping loop
3149 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
3150 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
3152 _finish.broadcast();
3154 @@ -3148,7 +3148,7 @@
3156 TW_SCOPE_LOCK(lock, _oplock, "PullSupplier", "PullSupplier_i::try_pull");
3157 if (_done) return data;
3158 - if (_verbose) cout << _obj_name << ": Channel called try_pull" << endl;
3159 + if (_verbose) std::cout << _obj_name << ": Channel called try_pull" << std::endl;
3161 // If we reached done point during last try_pull, it is broadcast now
3162 // and we return from this try_pull call without an event.
3163 @@ -3156,10 +3156,10 @@
3164 // processed the previous try_pull (the final supplied event) before
3165 // we disconnect this supplier.
3166 if (_max_events && (_num_events >= _max_events)) {
3167 - if (_verbose) cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << endl;
3168 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << std::endl;
3170 _finish.broadcast();
3171 - if (_verbose) cout << _obj_name << ": NOT returning an event" << endl;
3172 + if (_verbose) std::cout << _obj_name << ": NOT returning an event" << std::endl;
3176 @@ -3167,12 +3167,12 @@
3180 - if (_verbose) cout << _obj_name << ": NOT returning an event" << endl;
3181 + if (_verbose) std::cout << _obj_name << ": NOT returning an event" << std::endl;
3183 if (!_done && _delay_millisecs) {
3184 unsigned long d_secs = _delay_millisecs / 1000;
3185 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3186 - if (_verbose) cout << _obj_name << ": delaying try_pull response for " << _delay_millisecs << " millisecs" << endl;
3187 + if (_verbose) std::cout << _obj_name << ": delaying try_pull response for " << _delay_millisecs << " millisecs" << std::endl;
3188 unsigned long t_secs, t_nanosecs;
3189 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3190 _finish.timedwait(t_secs, t_nanosecs);
3191 @@ -3194,7 +3194,7 @@
3192 { // introduce lock scope
3193 TW_SCOPE_LOCK(lock, _oplock, "PullSupplier", "PullSupplier_i::pull");
3195 - if (_verbose && (!_done)) cout << _obj_name << ": Channel called pull" << endl;
3196 + if (_verbose && (!_done)) std::cout << _obj_name << ": Channel called pull" << std::endl;
3197 // invariants: _oplock is held entering top of loop and
3198 // also whenever we break out of loop
3199 // (it is *not* held during yield() and timedwait() calls)
3200 @@ -3206,7 +3206,7 @@
3201 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
3203 if (_max_events && (_num_events >= _max_events)) {
3204 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
3205 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
3207 _finish.broadcast();
3209 @@ -3227,7 +3227,7 @@
3210 if (!_done && _delay_millisecs) {
3211 unsigned long d_secs = _delay_millisecs / 1000;
3212 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3213 - if (_verbose) cout << _obj_name << ": delaying pull response for " << _delay_millisecs << " millisecs" << endl;
3214 + if (_verbose) std::cout << _obj_name << ": delaying pull response for " << _delay_millisecs << " millisecs" << std::endl;
3215 unsigned long t_secs, t_nanosecs;
3216 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3217 _finish.timedwait(t_secs, t_nanosecs);
3218 @@ -3242,7 +3242,7 @@
3220 TW_SCOPE_LOCK(lock, _oplock, "PullSupplier", "PullSupplier_i::disconnect_pull_supplier");
3222 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
3223 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
3225 _finish.broadcast();
3227 @@ -3272,11 +3272,11 @@
3230 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
3231 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
3232 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
3233 if (!_done && _delay_millisecs) {
3234 unsigned long d_secs = _delay_millisecs / 1000;
3235 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3236 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
3237 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
3238 unsigned long t_secs, t_nanosecs;
3239 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3240 _finish.timedwait(t_secs, t_nanosecs);
3241 @@ -3361,16 +3361,16 @@
3242 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
3244 } catch (CORBA::BAD_PARAM& ex) {
3245 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
3246 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
3248 } catch (CosEvCA::AlreadyConnected& ex) {
3249 - cerr << _obj_name << ": Already connected" << endl;
3250 + std::cerr << _obj_name << ": Already connected" << std::endl;
3253 - cerr << _obj_name << ": Failed to connect" << endl;
3254 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
3257 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
3258 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
3259 // register the types to be supplied
3260 offer_ticker(_my_proxy, _obj_name, _verbose);
3261 // if _millisecs is set, spawn a thread to ping the proxy
3262 @@ -3384,11 +3384,11 @@
3263 { // introduce lock scope
3264 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullSupplier", "StructuredPullSupplier_i::cleanup");
3265 if (_worker || (!_done)) {
3266 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
3267 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
3270 if (CORBA::is_nil(_my_proxy)) {
3271 - cerr << "Coding error: cleanup already called?" << endl;
3272 + std::cerr << "Coding error: cleanup already called?" << std::endl;
3275 // this method takes sole ownership of _my_proxy ref
3276 @@ -3416,7 +3416,7 @@
3277 { // introduce lock scope
3278 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullSupplier", "StructuredPullSupplier_i::start_working");
3280 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
3281 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
3283 if (_done || (_millisecs == 0)) break;
3284 unsigned long t_secs = 0, t_nanosecs = 0;
3285 @@ -3438,7 +3438,7 @@
3286 continue; // continue ping loop
3289 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
3290 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
3292 _finish.broadcast();
3294 @@ -3457,7 +3457,7 @@
3296 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullSupplier", "StructuredPullSupplier_i::try_pull_structured_event");
3297 if (_done) return data;
3298 - if (_verbose) cout << _obj_name << ": Channel called try_pull_structured_event" << endl;
3299 + if (_verbose) std::cout << _obj_name << ": Channel called try_pull_structured_event" << std::endl;
3301 // If we reached done point during last try_pull, it is broadcast now
3302 // and we return from this try_pull call without an event.
3303 @@ -3465,10 +3465,10 @@
3304 // processed the previous try_pull (the final supplied event) before
3305 // we disconnect this supplier.
3306 if (_max_events && (_num_events >= _max_events)) {
3307 - if (_verbose) cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << endl;
3308 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << std::endl;
3310 _finish.broadcast();
3311 - if (_verbose) cout << _obj_name << ": NOT returning an event" << endl;
3312 + if (_verbose) std::cout << _obj_name << ": NOT returning an event" << std::endl;
3316 @@ -3476,12 +3476,12 @@
3320 - if (_verbose) cout << _obj_name << ": NOT returning an event" << endl;
3321 + if (_verbose) std::cout << _obj_name << ": NOT returning an event" << std::endl;
3323 if (!_done && _delay_millisecs) {
3324 unsigned long d_secs = _delay_millisecs / 1000;
3325 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3326 - if (_verbose) cout << _obj_name << ": delaying try_pull_structured_event response for " << _delay_millisecs << " millisecs" << endl;
3327 + if (_verbose) std::cout << _obj_name << ": delaying try_pull_structured_event response for " << _delay_millisecs << " millisecs" << std::endl;
3328 unsigned long t_secs, t_nanosecs;
3329 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3330 _finish.timedwait(t_secs, t_nanosecs);
3331 @@ -3503,7 +3503,7 @@
3332 { // introduce lock scope
3333 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullSupplier", "StructuredPullSupplier_i::pull_structured_event");
3335 - if (_verbose && (!_done)) cout << _obj_name << ": Channel called pull_structured_event" << endl;
3336 + if (_verbose && (!_done)) std::cout << _obj_name << ": Channel called pull_structured_event" << std::endl;
3337 // invariants: _oplock is held entering top of loop and
3338 // also whenever we break out of loop
3339 // (it is *not* held during yield() and timedwait() calls)
3340 @@ -3515,7 +3515,7 @@
3341 if ((*_supply_fn)(*data, _obj_name, _num_events+1, _verbose)) {
3343 if (_max_events && (_num_events >= _max_events)) {
3344 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
3345 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
3347 _finish.broadcast();
3349 @@ -3536,7 +3536,7 @@
3350 if (!_done && _delay_millisecs) {
3351 unsigned long d_secs = _delay_millisecs / 1000;
3352 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3353 - if (_verbose) cout << _obj_name << ": delaying pull_structured_event response for " << _delay_millisecs << " millisecs" << endl;
3354 + if (_verbose) std::cout << _obj_name << ": delaying pull_structured_event response for " << _delay_millisecs << " millisecs" << std::endl;
3355 unsigned long t_secs, t_nanosecs;
3356 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3357 _finish.timedwait(t_secs, t_nanosecs);
3358 @@ -3551,7 +3551,7 @@
3360 TW_SCOPE_LOCK(lock, _oplock, "StructuredPullSupplier", "StructuredPullSupplier_i::disconnect_structured_pull_supplier");
3362 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
3363 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
3365 _finish.broadcast();
3367 @@ -3581,11 +3581,11 @@
3370 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
3371 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
3372 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
3373 if (!_done && _delay_millisecs) {
3374 unsigned long d_secs = _delay_millisecs / 1000;
3375 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3376 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
3377 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
3378 unsigned long t_secs, t_nanosecs;
3379 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3380 _finish.timedwait(t_secs, t_nanosecs);
3381 @@ -3675,16 +3675,16 @@
3382 _my_proxy->obtain_subscription_types(CosNA::NONE_NOW_UPDATES_OFF);
3384 } catch (CORBA::BAD_PARAM& ex) {
3385 - cerr << _obj_name << ": BAD_PARAM Exception while connecting" << endl;
3386 + std::cerr << _obj_name << ": BAD_PARAM Exception while connecting" << std::endl;
3388 } catch (CosEvCA::AlreadyConnected& ex) {
3389 - cerr << _obj_name << ": Already connected" << endl;
3390 + std::cerr << _obj_name << ": Already connected" << std::endl;
3393 - cerr << _obj_name << ": Failed to connect" << endl;
3394 + std::cerr << _obj_name << ": Failed to connect" << std::endl;
3397 - if (_verbose) cout << _obj_name << ": Connected to proxy, ready to supply events" << endl;
3398 + if (_verbose) std::cout << _obj_name << ": Connected to proxy, ready to supply events" << std::endl;
3399 // register the types to be supplied
3400 offer_ticker(_my_proxy, _obj_name, _verbose);
3401 // if _millisecs is set, spawn a thread to ping the proxy
3402 @@ -3698,11 +3698,11 @@
3403 { // introduce lock scope
3404 TW_SCOPE_LOCK(lock, _oplock, "SequencePullSupplier", "SequencePullSupplier_i::cleanup");
3405 if (_worker || (!_done)) {
3406 - cerr << "Coding error: only call c->cleanup() after c->wait_done()" << endl;
3407 + std::cerr << "Coding error: only call c->cleanup() after c->wait_done()" << std::endl;
3410 if (CORBA::is_nil(_my_proxy)) {
3411 - cerr << "Coding error: cleanup already called?" << endl;
3412 + std::cerr << "Coding error: cleanup already called?" << std::endl;
3415 // this method takes sole ownership of _my_proxy ref
3416 @@ -3729,7 +3729,7 @@
3417 { // introduce lock scope
3418 TW_SCOPE_LOCK(lock, _oplock, "SequencePullSupplier", "SequencePullSupplier_i::start_working");
3420 - if (_verbose && (!_done) && _millisecs) cout << _obj_name << ": Spawned thread entering ping loop" << endl;
3421 + if (_verbose && (!_done) && _millisecs) std::cout << _obj_name << ": Spawned thread entering ping loop" << std::endl;
3423 if (_done || (_millisecs == 0)) break;
3424 unsigned long t_secs = 0, t_nanosecs = 0;
3425 @@ -3751,7 +3751,7 @@
3426 continue; // continue ping loop
3429 - if (_verbose) cout << _obj_name << ": communication error while pinging proxy using MyType()" << endl;
3430 + if (_verbose) std::cout << _obj_name << ": communication error while pinging proxy using MyType()" << std::endl;
3432 _finish.broadcast();
3434 @@ -3772,7 +3772,7 @@
3436 TW_SCOPE_LOCK(lock, _oplock, "SequencePullSupplier", "SequencePullSupplier_i::try_pull_structured_events");
3437 if (_done) return data;
3438 - if (_verbose) cout << _obj_name << ": Channel called try_pull_structured_events" << endl;
3439 + if (_verbose) std::cout << _obj_name << ": Channel called try_pull_structured_events" << std::endl;
3441 // If we reached done point during last try_pull, it is broadcast now
3442 // and we return from this try_pull call without an event batch.
3443 @@ -3780,10 +3780,10 @@
3444 // processed the previous try_pull (the final supplied event batch) before
3445 // we disconnect this supplier.
3446 if (_max_events && (_num_events >= _max_events)) {
3447 - if (_verbose) cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << endl;
3448 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached; we waited for 1 extra try_pull]" << std::endl;
3450 _finish.broadcast();
3451 - if (_verbose) cout << _obj_name << ": NOT returning a batch" << endl;
3452 + if (_verbose) std::cout << _obj_name << ": NOT returning a batch" << std::endl;
3456 @@ -3792,12 +3792,12 @@
3458 _num_events += data->length();
3460 - if (_verbose) cout << _obj_name << ": NOT returning a batch" << endl;
3461 + if (_verbose) std::cout << _obj_name << ": NOT returning a batch" << std::endl;
3463 if (!_done && _delay_millisecs) {
3464 unsigned long d_secs = _delay_millisecs / 1000;
3465 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3466 - if (_verbose) cout << _obj_name << ": delaying try_pull_structured_events response for " << _delay_millisecs << " millisecs" << endl;
3467 + if (_verbose) std::cout << _obj_name << ": delaying try_pull_structured_events response for " << _delay_millisecs << " millisecs" << std::endl;
3468 unsigned long t_secs, t_nanosecs;
3469 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3470 _finish.timedwait(t_secs, t_nanosecs);
3471 @@ -3820,7 +3820,7 @@
3472 { // introduce lock scope
3473 TW_SCOPE_LOCK(lock, _oplock, "SequencePullSupplier", "SequencePullSupplier_i::pull_structured_events");
3475 - if (_verbose && (!_done)) cout << _obj_name << ": Channel called pull_structured_events" << endl;
3476 + if (_verbose && (!_done)) std::cout << _obj_name << ": Channel called pull_structured_events" << std::endl;
3477 // invariants: _oplock is held entering top of loop and
3478 // also whenever we break out of loop
3479 // (it is *not* held during yield() and timedwait() calls)
3480 @@ -3834,7 +3834,7 @@
3482 _num_events += data->length();
3483 if (_max_events && (_num_events >= _max_events)) {
3484 - if (_verbose) cout << _obj_name << ": DONE [max_events reached]" << endl;
3485 + if (_verbose) std::cout << _obj_name << ": DONE [max_events reached]" << std::endl;
3487 _finish.broadcast();
3489 @@ -3855,7 +3855,7 @@
3490 if (!_done && _delay_millisecs) {
3491 unsigned long d_secs = _delay_millisecs / 1000;
3492 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3493 - if (_verbose) cout << _obj_name << ": delaying pull_structured_events response for " << _delay_millisecs << " millisecs" << endl;
3494 + if (_verbose) std::cout << _obj_name << ": delaying pull_structured_events response for " << _delay_millisecs << " millisecs" << std::endl;
3495 unsigned long t_secs, t_nanosecs;
3496 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3497 _finish.timedwait(t_secs, t_nanosecs);
3498 @@ -3870,7 +3870,7 @@
3500 TW_SCOPE_LOCK(lock, _oplock, "SequencePullSupplier", "SequencePullSupplier_i::disconnect_sequence_pull_supplier");
3502 - if (_verbose) cout << _obj_name << ": disconnected" << endl;
3503 + if (_verbose) std::cout << _obj_name << ": disconnected" << std::endl;
3505 _finish.broadcast();
3507 @@ -3900,11 +3900,11 @@
3510 if (_change_fn) (*_change_fn)(added, deled, _obj_name, _num_changes, _verbose);
3511 - else if (_verbose) cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << endl;
3512 + else if (_verbose) std::cout << _obj_name << ": subscription_change received [# " << _num_changes << "]" << std::endl;
3513 if (!_done && _delay_millisecs) {
3514 unsigned long d_secs = _delay_millisecs / 1000;
3515 unsigned long d_nanosecs = (_delay_millisecs % 1000) * 1000000;
3516 - if (_verbose) cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << endl;
3517 + if (_verbose) std::cout << _obj_name << ": delaying subscription_change response for " << _delay_millisecs << " millisecs" << std::endl;
3518 unsigned long t_secs, t_nanosecs;
3519 TW_GET_TIME(&t_secs, &t_nanosecs, d_secs, d_nanosecs);
3520 _finish.timedwait(t_secs, t_nanosecs);
3521 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/sample_functions.cc omniNotify-2.1.new/examples/sample_functions.cc
3522 --- omniNotify-2.1.orig/examples/sample_functions.cc 2003-10-23 08:39:11.000000000 +0400
3523 +++ omniNotify-2.1.new/examples/sample_functions.cc 2009-06-28 17:12:44.000000000 +0400
3528 -#include <iostream.h>
3529 -#include <iomanip.h>
3530 +#include <iostream>
3532 #include "sample_functions.h"
3534 ///////////////////////////////////////////////////////////////////
3538 event <<= event_num;
3539 - if (verbose) cout << "Supplied event # " << event_num << endl;
3540 + if (verbose) std::cout << "Supplied event # " << event_num << std::endl;
3548 - if (verbose) cout << obj_name << ": event data = " << ul << ", event count = " << event_num << endl;
3549 + if (verbose) std::cout << obj_name << ": event data = " << ul << ", event count = " << event_num << std::endl;
3551 - if (verbose) cout << obj_name << ": event data not known (not a ULong), event count = " << event_num << endl;
3552 + if (verbose) std::cout << obj_name << ": event data not known (not a ULong), event count = " << event_num << std::endl;
3560 - cout << setw(10) << obj_name << " : " <<
3561 - setw(4) << event_num << " : " <<
3562 - setw(5) << event.header.fixed_header.event_type.domain_name << "::" <<
3563 + std::cout << std::setw(10) << obj_name << " : " <<
3564 + std::setw(4) << event_num << " : " <<
3565 + std::setw(5) << event.header.fixed_header.event_type.domain_name << "::" <<
3566 event.header.fixed_header.event_type.type_name << " -- ";
3567 const char* stock_or_bond_name = "";
3568 CORBA::ULong value = 0;
3570 (event.filterable_data.length() > 1) &&
3571 (event.filterable_data[0].value >>= stock_or_bond_name) &&
3572 (event.filterable_data[1].value >>= value)) {
3573 - cout << "Name: " << stock_or_bond_name << " Value: " << setw(4) << value << " Quote# ";
3574 + std::cout << "Name: " << stock_or_bond_name << " Value: " << std::setw(4) << value << " Quote# ";
3576 if (event.remainder_of_body >>= l) {
3577 - cout << setw(4) << l << endl;
3578 + std::cout << std::setw(4) << l << std::endl;
3580 - cout << "????" << endl;
3581 + std::cout << "????" << std::endl;
3584 - cout << "(not a Stock or Bond quote -- ignoring)" << endl;
3585 + std::cout << "(not a Stock or Bond quote -- ignoring)" << std::endl;
3590 event.filterable_data[1].name = (const char*) "Value";
3591 event.filterable_data[1].value <<= (CORBA::ULong) sample_stockbond_val[i];
3592 event.remainder_of_body <<= (CORBA::ULong) event_num;
3593 - if (verbose) cout << "Supplied event # " << event_num << endl;
3594 + if (verbose) std::cout << "Supplied event # " << event_num << std::endl;
3600 CORBA::ULong evnum = event_num;
3601 // We re-use the singleton example function
3602 - if (verbose) cout << "--------- " << obj_name << " Supplying Event Batch " <<
3603 - batch_num << " -------------" << endl;
3604 + if (verbose) std::cout << "--------- " << obj_name << " Supplying Event Batch " <<
3605 + batch_num << " -------------" << std::endl;
3606 events.length(batch_size);
3607 for (unsigned int i = 0; i < batch_size; i++) {
3608 sample_supply_structured_fn(events[i], obj_name, evnum++, verbose);
3611 // We re-use the singleton example function
3612 CORBA::ULong evnum = (event_num - events.length()) + 1;
3613 - if (verbose) cout << "--------- " << obj_name << " Got Event Batch " <<
3614 - batch_num << " -------------" << endl;
3615 + if (verbose) std::cout << "--------- " << obj_name << " Got Event Batch " <<
3616 + batch_num << " -------------" << std::endl;
3617 for (unsigned int i = 0; i < events.length(); i++) {
3618 sample_consume_structured_fn(events[i], "", evnum++, verbose);
3620 @@ -177,15 +177,15 @@
3624 - cout << setw(10) << obj_name << " : " <<
3625 - setw(4) << event_num << " : " <<
3626 - setw(5) << event.header.fixed_header.event_type.domain_name << "::" <<
3627 + std::cout << std::setw(10) << obj_name << " : " <<
3628 + std::setw(4) << event_num << " : " <<
3629 + std::setw(5) << event.header.fixed_header.event_type.domain_name << "::" <<
3630 event.header.fixed_header.event_type.type_name << " -- ";
3632 if (event.remainder_of_body >>= l) {
3633 - cout << setw(4) << l << endl;
3634 + std::cout << std::setw(4) << l << std::endl;
3636 - cout << "????" << endl;
3637 + std::cout << "????" << std::endl;
3641 @@ -209,13 +209,13 @@
3642 event.filterable_data[0].name = (const char*) "TypeNum";
3643 event.filterable_data[0].value <<= (CORBA::ULong) i;
3644 event.remainder_of_body <<= (CORBA::ULong) event_num;
3645 - if (verbose) cout << "Supplied event # " << event_num << endl;
3646 + if (verbose) std::cout << "Supplied event # " << event_num << std::endl;
3652 -ostream& operator<< (ostream& out, const CosN::EventType & t) {
3653 +std::ostream& operator<< (std::ostream& out, const CosN::EventType & t) {
3654 const char* dname = (t.domain_name ? (const char*)t.domain_name : "*");
3655 const char* tname = (t.type_name ? (const char*)t.type_name : "*");
3656 return out << dname << "::" << tname;
3657 @@ -228,10 +228,10 @@
3659 CosN::EventType type;
3660 for (indx = 0; indx < added.length(); indx++) {
3661 - cout << "\t+ " << added[indx] << endl;
3662 + std::cout << "\t+ " << added[indx] << std::endl;
3664 for (indx = 0; indx < deled.length(); indx++) {
3665 - cout << "\t- " << deled[indx] << endl;
3666 + std::cout << "\t- " << deled[indx] << std::endl;
3674 - cout << "Object " << obj_name <<
3675 - " received offer_change msg [# " << num_changes << "]:" << endl;
3676 + std::cout << "Object " << obj_name <<
3677 + " received offer_change msg [# " << num_changes << "]:" << std::endl;
3678 sample_describe_change_fn(added, deled);
3685 - cout << "Object " << obj_name <<
3686 - " received subscription_change msg [# " << num_changes << "]:" << endl;
3687 + std::cout << "Object " << obj_name <<
3688 + " received subscription_change msg [# " << num_changes << "]:" << std::endl;
3689 sample_describe_change_fn(added, deled);
3692 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/some_notify_clients.cc omniNotify-2.1.new/examples/some_notify_clients.cc
3693 --- omniNotify-2.1.orig/examples/some_notify_clients.cc 2003-10-12 22:51:18.000000000 +0400
3694 +++ omniNotify-2.1.new/examples/some_notify_clients.cc 2009-06-28 17:18:19.000000000 +0400
3699 -#include <iostream.h>
3700 +#include <iostream>
3702 #include "orb_init_name.h"
3703 #include "get_channel.h"
3706 static void usage(const char* pname)
3708 - cout << "Usage: " << pname << " -u client_type [-u client_type ...] [-c #] [-s #] [-b #] [-m #] [-M #] [-n name] [-f file] [-v] [-t types] [-e expr]" << endl;
3709 - cout << " -u type : use the specified client type (one client of that type is used)." << endl;
3710 - cout << " Specify as many as you like, one -u option for each. Types:" << endl;
3711 - cout << " lpushc : legacy push consumer" << endl;
3712 - cout << " apushc : any push consumer" << endl;
3713 - cout << " spushc : structured push consumer" << endl;
3714 - cout << " bpushc : batch push consumer" << endl;
3716 - cout << " lpullc : legacy pull consumer" << endl;
3717 - cout << " apullc : any pull consumer" << endl;
3718 - cout << " spullc : structured pull consumer" << endl;
3719 - cout << " bpullc : batch pull consumer" << endl;
3721 - cout << " lpushs : legacy push supplier" << endl;
3722 - cout << " apushs : any push supplier" << endl;
3723 - cout << " spushs : structured push supplier" << endl;
3724 - cout << " bpushs : batch push supplier" << endl;
3726 - cout << " lpulls : legacy pull supplier" << endl;
3727 - cout << " apulls : any pull supplier" << endl;
3728 - cout << " spulls : structured pull supplier" << endl;
3729 - cout << " bpulls : batch pull supplier" << endl;
3731 - cout << " -s # : for suppliers: disconnect after # events supplied [default 0 means never disconnect]" << endl;
3732 - cout << " -c # : for consumers: disconnect after # events consumed [default 0 means never disconnect]" << endl;
3733 - cout << " ** N.B. You should take # of suppliers into account:" << endl;
3734 - cout << " if 3 suppliers supply 30 events, each consumer should consume 90 events" << endl;
3735 - cout << " -b # : batch size (only relevant for batch supplier programs) [default 5]" << endl;
3736 - cout << " => must be >= 1" << endl;
3737 - cout << " -m # : # of milliseconds to pause between each push/pull [default 0]" << endl;
3738 - cout << " -M # : # of milliseconds to pause during incoming push, pull, try_pull [default 0]" << endl;
3739 - cout << " (-M only applies to push consumers and pull suppliers)" << endl;
3740 - cout << " -n name : channel name" << endl;
3741 - cout << " => use event service to lookup this name" << endl;
3742 - cout << " -f file : file containing channel IOR" << endl;
3743 - cout << " => use string_to_object on the IOR" << endl;
3744 - cout << " -v : verbose output" << endl;
3746 - cout << "Options for adding a filter **:" << endl;
3747 - cout << " -t types : add a filter for the specified types, which should be a" << endl;
3748 - cout << " comma-separated list of types of the form D::T" << endl;
3749 - cout << " -e expr : add a filter with the specified boolean expression" << endl;
3750 - cout << "** N.B. Only add filters that always evaluate to TRUE to get proper program termination" << endl;
3752 - cout << "If only -t specified, the expression \"true\" is used for the filter" << endl;
3753 - cout << "If only -e specified, the event type \"*::*\" is used for the filter" << endl;
3755 - cout << "If both -n and -f are specified, the -n option is tried first" << endl;
3757 - cout << "If neither -n or -f is specified, program first tries name service" << endl;
3758 - cout << "using name \"EventChannel\", then default IOR file /tmp/rdichan.ior" << endl;
3760 + std::cout << "Usage: " << pname << " -u client_type [-u client_type ...] [-c #] [-s #] [-b #] [-m #] [-M #] [-n name] [-f file] [-v] [-t types] [-e expr]" << std::endl;
3761 + std::cout << " -u type : use the specified client type (one client of that type is used)." << std::endl;
3762 + std::cout << " Specify as many as you like, one -u option for each. Types:" << std::endl;
3763 + std::cout << " lpushc : legacy push consumer" << std::endl;
3764 + std::cout << " apushc : any push consumer" << std::endl;
3765 + std::cout << " spushc : structured push consumer" << std::endl;
3766 + std::cout << " bpushc : batch push consumer" << std::endl;
3767 + std::cout << std::endl;
3768 + std::cout << " lpullc : legacy pull consumer" << std::endl;
3769 + std::cout << " apullc : any pull consumer" << std::endl;
3770 + std::cout << " spullc : structured pull consumer" << std::endl;
3771 + std::cout << " bpullc : batch pull consumer" << std::endl;
3772 + std::cout << std::endl;
3773 + std::cout << " lpushs : legacy push supplier" << std::endl;
3774 + std::cout << " apushs : any push supplier" << std::endl;
3775 + std::cout << " spushs : structured push supplier" << std::endl;
3776 + std::cout << " bpushs : batch push supplier" << std::endl;
3777 + std::cout << std::endl;
3778 + std::cout << " lpulls : legacy pull supplier" << std::endl;
3779 + std::cout << " apulls : any pull supplier" << std::endl;
3780 + std::cout << " spulls : structured pull supplier" << std::endl;
3781 + std::cout << " bpulls : batch pull supplier" << std::endl;
3782 + std::cout << std::endl;
3783 + std::cout << " -s # : for suppliers: disconnect after # events supplied [default 0 means never disconnect]" << std::endl;
3784 + std::cout << " -c # : for consumers: disconnect after # events consumed [default 0 means never disconnect]" << std::endl;
3785 + std::cout << " ** N.B. You should take # of suppliers into account:" << std::endl;
3786 + std::cout << " if 3 suppliers supply 30 events, each consumer should consume 90 events" << std::endl;
3787 + std::cout << " -b # : batch size (only relevant for batch supplier programs) [default 5]" << std::endl;
3788 + std::cout << " => must be >= 1" << std::endl;
3789 + std::cout << " -m # : # of milliseconds to pause between each push/pull [default 0]" << std::endl;
3790 + std::cout << " -M # : # of milliseconds to pause during incoming push, pull, try_pull [default 0]" << std::endl;
3791 + std::cout << " (-M only applies to push consumers and pull suppliers)" << std::endl;
3792 + std::cout << " -n name : channel name" << std::endl;
3793 + std::cout << " => use event service to lookup this name" << std::endl;
3794 + std::cout << " -f file : file containing channel IOR" << std::endl;
3795 + std::cout << " => use string_to_object on the IOR" << std::endl;
3796 + std::cout << " -v : verbose output" << std::endl;
3797 + std::cout << std::endl;
3798 + std::cout << "Options for adding a filter **:" << std::endl;
3799 + std::cout << " -t types : add a filter for the specified types, which should be a" << std::endl;
3800 + std::cout << " comma-separated list of types of the form D::T" << std::endl;
3801 + std::cout << " -e expr : add a filter with the specified boolean expression" << std::endl;
3802 + std::cout << "** N.B. Only add filters that always evaluate to TRUE to get proper program termination" << std::endl;
3803 + std::cout << std::endl;
3804 + std::cout << "If only -t specified, the expression \"true\" is used for the filter" << std::endl;
3805 + std::cout << "If only -e specified, the event type \"*::*\" is used for the filter" << std::endl;
3806 + std::cout << std::endl;
3807 + std::cout << "If both -n and -f are specified, the -n option is tried first" << std::endl;
3808 + std::cout << std::endl;
3809 + std::cout << "If neither -n or -f is specified, program first tries name service" << std::endl;
3810 + std::cout << "using name \"EventChannel\", then default IOR file /tmp/rdichan.ior" << std::endl;
3811 + std::cout << std::endl;
3814 // return 0 if etype_list is a valid comma-separated event type list
3816 } else if (strcmp(optarg, "bpulls") == 0) {
3817 USE_B_PULL_S = 1; num_sup++;
3819 - cout << endl << "Bad client type (" << optarg << ") for -u option" << endl;
3820 + std::cout << std::endl << "Bad client type (" << optarg << ") for -u option" << std::endl;
3825 ior_file = (char*)"/tmp/rdichan.ior";
3827 if (strlen(etype_list) && parse_etype_list(etype_list, evs)) {
3828 - cout << "Event type list for -t option must be comma-separated list of D::T" << endl << endl;
3829 + std::cout << "Event type list for -t option must be comma-separated list of D::T" << std::endl << std::endl;
3833 @@ -258,19 +258,19 @@
3834 constraint_expr = (char*)"true";
3836 if (num_con + num_sup == 0) {
3837 - cout << endl << "** You must use at least one -u option to specify a client **" << endl;
3838 + std::cout << std::endl << "** You must use at least one -u option to specify a client **" << std::endl;
3842 if (num_con && num_sup && num_con_events && num_sup_events && (num_con_events != (num_sup * num_sup_events))) {
3843 - cout << endl << "** WARNING: Unless filtering or external clients change the count, your math is wrong" << endl;
3844 - cout << " num_con_events != num_sup * num_sup_events" << endl;
3845 - cout << " ( " << num_con_events << " != " << num_sup << " * " << num_sup_events << " )" << endl;
3846 - cout << "Proceeding anyway" << endl;
3847 + std::cout << std::endl << "** WARNING: Unless filtering or external clients change the count, your math is wrong" << std::endl;
3848 + std::cout << " num_con_events != num_sup * num_sup_events" << std::endl;
3849 + std::cout << " ( " << num_con_events << " != " << num_sup << " * " << num_sup_events << " )" << std::endl;
3850 + std::cout << "Proceeding anyway" << std::endl;
3853 // (2) Obtain reference to notification channel
3854 - if (verbose) cout << "Obtaining reference to notification channel" << endl;
3855 + if (verbose) std::cout << "Obtaining reference to notification channel" << std::endl;
3856 CosNA::EventChannel_ptr channel = getchan_from_ns(orb, channel_name, verbose);
3857 if (CORBA::is_nil(channel)) { // name service lookup failed
3858 channel = getchan_from_iorfile(orb, ior_file, verbose);
3859 @@ -323,12 +323,12 @@
3861 // (3.1) legacy_push_consumer
3863 - cout << "Constructing legacy_push_consumer, num_con_events = " << num_con_events << endl;
3864 + std::cout << "Constructing legacy_push_consumer, num_con_events = " << num_con_events << std::endl;
3866 LegacyPushConsumer_i::create(channel, num_con_events, "legacy_push_consumer",
3867 sample_consume_any_fn, millisecs, delay_millisecs, verbose);
3869 - cerr << "Constructing legacy_push_consumer failed" << endl;
3870 + std::cerr << "Constructing legacy_push_consumer failed" << std::endl;
3871 goto error_return; // failed to create a client
3873 my_l_push_c = l_push_c->_this();
3874 @@ -337,12 +337,12 @@
3876 // (3.2) legacy_pull_consumer
3878 - cout << "Constructing legacy_pull_consumer, num_con_events = " << num_con_events << endl;
3879 + std::cout << "Constructing legacy_pull_consumer, num_con_events = " << num_con_events << std::endl;
3881 LegacyPullConsumer_i::create(channel, num_con_events, "legacy_pull_consumer",
3882 sample_consume_any_fn, millisecs, delay_millisecs, verbose);
3884 - cerr << "Constructing legacy_pull_consumer failed" << endl;
3885 + std::cerr << "Constructing legacy_pull_consumer failed" << std::endl;
3886 goto error_return; // failed to create a client
3888 my_l_pull_c = l_pull_c->_this();
3889 @@ -351,13 +351,13 @@
3891 // (3.3) any_push_consumer
3893 - cout << "Constructing any_push_consumer, num_con_events = " << num_con_events << endl;
3894 + std::cout << "Constructing any_push_consumer, num_con_events = " << num_con_events << std::endl;
3896 PushConsumer_i::create(orb, channel, num_con_events, batch_size, "any_push_consumer",
3897 "", "", sample_consume_any_fn, sample_offer_change_fn,
3898 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
3900 - cerr << "Constructing any_push_consumer failed" << endl;
3901 + std::cerr << "Constructing any_push_consumer failed" << std::endl;
3902 goto error_return; // failed to create a client
3904 my_a_push_c = a_push_c->_this();
3905 @@ -366,13 +366,13 @@
3907 // (3.4) struct_push_consumer
3909 - cout << "Constructing struct_push_consumer, num_con_events = " << num_con_events << endl;
3910 + std::cout << "Constructing struct_push_consumer, num_con_events = " << num_con_events << std::endl;
3912 StructuredPushConsumer_i::create(orb, channel, num_con_events, batch_size, "struct_push_consumer",
3913 "", "", sample_consume_structured_fn, sample_offer_change_fn,
3914 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
3916 - cerr << "Constructing struct_push_consumer failed" << endl;
3917 + std::cerr << "Constructing struct_push_consumer failed" << std::endl;
3918 goto error_return; // failed to create a client
3920 my_s_push_c = s_push_c->_this();
3921 @@ -381,13 +381,13 @@
3923 // (3.5) batch_push_consumer
3925 - cout << "Constructing batch_push_consumer, num_con_events = " << num_con_events << endl;
3926 + std::cout << "Constructing batch_push_consumer, num_con_events = " << num_con_events << std::endl;
3928 SequencePushConsumer_i::create(orb, channel, num_con_events, batch_size, "batch_push_consumer",
3929 "", "", sample_consume_batch_fn, sample_offer_change_fn,
3930 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
3932 - cerr << "Constructing batch_push_consumer failed" << endl;
3933 + std::cerr << "Constructing batch_push_consumer failed" << std::endl;
3934 goto error_return; // failed to create a client
3936 my_b_push_c = b_push_c->_this();
3937 @@ -396,13 +396,13 @@
3939 // (3.6) any_pull_consumer
3941 - cout << "Constructing any_pull_consumer, num_con_events = " << num_con_events << endl;
3942 + std::cout << "Constructing any_pull_consumer, num_con_events = " << num_con_events << std::endl;
3944 PullConsumer_i::create(orb, channel, num_con_events, batch_size, "any_pull_consumer",
3945 "", "", sample_consume_any_fn, sample_offer_change_fn,
3946 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
3948 - cerr << "Constructing any_pull_consumer failed" << endl;
3949 + std::cerr << "Constructing any_pull_consumer failed" << std::endl;
3950 goto error_return; // failed to create a client
3952 my_a_pull_c = a_pull_c->_this();
3953 @@ -411,13 +411,13 @@
3955 // (3.7) struct_pull_consumer
3957 - cout << "Constructing struct_pull_consumer, num_con_events = " << num_con_events << endl;
3958 + std::cout << "Constructing struct_pull_consumer, num_con_events = " << num_con_events << std::endl;
3960 StructuredPullConsumer_i::create(orb, channel, num_con_events, batch_size, "struct_pull_consumer",
3961 "", "", sample_consume_structured_fn, sample_offer_change_fn,
3962 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
3964 - cerr << "Constructing struct_pull_consumer failed" << endl;
3965 + std::cerr << "Constructing struct_pull_consumer failed" << std::endl;
3966 goto error_return; // failed to create a client
3968 my_s_pull_c = s_pull_c->_this();
3969 @@ -426,13 +426,13 @@
3971 // (3.8) batch_pull_consumer
3973 - cout << "Constructing batch_pull_consumer, num_con_events = " << num_con_events << endl;
3974 + std::cout << "Constructing batch_pull_consumer, num_con_events = " << num_con_events << std::endl;
3976 SequencePullConsumer_i::create(orb, channel, num_con_events, batch_size, "batch_pull_consumer",
3977 "", "", sample_consume_batch_fn, sample_offer_change_fn,
3978 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
3980 - cerr << "Constructing batch_pull_consumer failed" << endl;
3981 + std::cerr << "Constructing batch_pull_consumer failed" << std::endl;
3982 goto error_return; // failed to create a client
3984 my_b_pull_c = b_pull_c->_this();
3985 @@ -441,12 +441,12 @@
3987 // (3.9) legacy_push_supplier
3989 - cout << "Constructing legacy_push_supplier, num_sup_events = " << num_sup_events << endl;
3990 + std::cout << "Constructing legacy_push_supplier, num_sup_events = " << num_sup_events << std::endl;
3992 LegacyPushSupplier_i::create(channel, num_sup_events, "legacy_push_supplier",
3993 sample_supply_any_fn, millisecs, delay_millisecs, verbose);
3995 - cerr << "Constructing legacy_push_supplier failed" << endl;
3996 + std::cerr << "Constructing legacy_push_supplier failed" << std::endl;
3997 goto error_return; // failed to create a client
3999 my_l_push_s = l_push_s->_this();
4000 @@ -455,12 +455,12 @@
4002 // (3.10) legacy_pull_supplier
4004 - cout << "Constructing legacy_pull_supplier, num_sup_events = " << num_sup_events << endl;
4005 + std::cout << "Constructing legacy_pull_supplier, num_sup_events = " << num_sup_events << std::endl;
4007 LegacyPullSupplier_i::create(channel, num_sup_events, "legacy_pull_supplier",
4008 sample_supply_any_fn, millisecs, delay_millisecs, verbose);
4010 - cerr << "Constructing legacy_pull_supplier failed" << endl;
4011 + std::cerr << "Constructing legacy_pull_supplier failed" << std::endl;
4012 goto error_return; // failed to create a client
4014 my_l_pull_s = l_pull_s->_this();
4015 @@ -469,13 +469,13 @@
4017 // (3.11) any_push_supplier
4019 - cout << "Constructing any_push_supplier, num_sup_events = " << num_sup_events << endl;
4020 + std::cout << "Constructing any_push_supplier, num_sup_events = " << num_sup_events << std::endl;
4022 PushSupplier_i::create(orb, channel, num_sup_events, batch_size, "any_push_supplier",
4023 "", "", sample_supply_any_fn, sample_subscription_change_fn,
4024 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
4026 - cerr << "Constructing any_push_supplier failed" << endl;
4027 + std::cerr << "Constructing any_push_supplier failed" << std::endl;
4028 goto error_return; // failed to create a client
4030 my_a_push_s = a_push_s->_this();
4031 @@ -484,13 +484,13 @@
4033 // (3.12) struct_push_supplier
4035 - cout << "Constructing struct_push_supplier, num_sup_events = " << num_sup_events << endl;
4036 + std::cout << "Constructing struct_push_supplier, num_sup_events = " << num_sup_events << std::endl;
4038 StructuredPushSupplier_i::create(orb, channel, num_sup_events, batch_size, "struct_push_supplier",
4039 "", "", sample_supply_structured_fn, sample_subscription_change_fn,
4040 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
4042 - cerr << "Constructing struct_push_supplier failed" << endl;
4043 + std::cerr << "Constructing struct_push_supplier failed" << std::endl;
4044 goto error_return; // failed to create a client
4046 my_s_push_s = s_push_s->_this();
4047 @@ -499,13 +499,13 @@
4049 // (3.13) batch_push_supplier
4051 - cout << "Constructing batch_push_supplier, num_sup_events = " << num_sup_events << endl;
4052 + std::cout << "Constructing batch_push_supplier, num_sup_events = " << num_sup_events << std::endl;
4054 SequencePushSupplier_i::create(orb, channel, num_sup_events, batch_size, "batch_push_supplier",
4055 "", "", sample_supply_batch_fn, sample_subscription_change_fn,
4056 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
4058 - cerr << "Constructing batch_push_supplier failed" << endl;
4059 + std::cerr << "Constructing batch_push_supplier failed" << std::endl;
4060 goto error_return; // failed to create a client
4062 my_b_push_s = b_push_s->_this();
4063 @@ -514,13 +514,13 @@
4065 // (3.14) any_pull_supplier
4067 - cout << "Constructing any_pull_supplier, num_sup_events = " << num_sup_events << endl;
4068 + std::cout << "Constructing any_pull_supplier, num_sup_events = " << num_sup_events << std::endl;
4070 PullSupplier_i::create(orb, channel, num_sup_events, batch_size, "any_pull_supplier",
4071 "", "", sample_supply_any_fn, sample_subscription_change_fn,
4072 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
4074 - cerr << "Constructing any_pull_supplier failed" << endl;
4075 + std::cerr << "Constructing any_pull_supplier failed" << std::endl;
4076 goto error_return; // failed to create a client
4078 my_a_pull_s = a_pull_s->_this();
4079 @@ -529,13 +529,13 @@
4081 // (3.15) struct_pull_supplier
4083 - cout << "Constructing struct_pull_supplier, num_sup_events = " << num_sup_events << endl;
4084 + std::cout << "Constructing struct_pull_supplier, num_sup_events = " << num_sup_events << std::endl;
4086 StructuredPullSupplier_i::create(orb, channel, num_sup_events, batch_size, "struct_pull_supplier",
4087 "", "", sample_supply_structured_fn, sample_subscription_change_fn,
4088 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
4090 - cerr << "Constructing struct_pull_supplier failed" << endl;
4091 + std::cerr << "Constructing struct_pull_supplier failed" << std::endl;
4092 goto error_return; // failed to create a client
4094 my_s_pull_s = s_pull_s->_this();
4095 @@ -544,13 +544,13 @@
4097 // (3.16) batch_pull_supplier
4099 - cout << "Constructing batch_pull_supplier, num_sup_events = " << num_sup_events << endl;
4100 + std::cout << "Constructing batch_pull_supplier, num_sup_events = " << num_sup_events << std::endl;
4102 SequencePullSupplier_i::create(orb, channel, num_sup_events, batch_size, "batch_pull_supplier",
4103 "", "", sample_supply_batch_fn, sample_subscription_change_fn,
4104 &evs, constraint_expr, millisecs, delay_millisecs, verbose);
4106 - cerr << "Constructing batch_pull_supplier failed" << endl;
4107 + std::cerr << "Constructing batch_pull_supplier failed" << std::endl;
4108 goto error_return; // failed to create a client
4110 my_b_pull_s = b_pull_s->_this();
4111 @@ -558,116 +558,116 @@
4114 // (4) Tell POA we are ready to go
4115 - if (verbose) cout << "Activating POA manager" << endl;
4116 + if (verbose) std::cout << "Activating POA manager" << std::endl;
4117 PortableServer::POAManager_var pman = poa->the_POAManager();
4120 // (5) Connect clients to their proxies -- consumers first
4121 - if (verbose) cout << "Connecting consumer clients to proxies" << endl;
4122 + if (verbose) std::cout << "Connecting consumer clients to proxies" << std::endl;
4125 if (l_push_c->connect()) {
4126 - cerr << "Connecting legacy_push_consumer failed" << endl;
4127 + std::cerr << "Connecting legacy_push_consumer failed" << std::endl;
4132 if (a_push_c->connect()) {
4133 - cerr << "Connecting any_push_consumer failed" << endl;
4134 + std::cerr << "Connecting any_push_consumer failed" << std::endl;
4139 if (s_push_c->connect()) {
4140 - cerr << "Connecting struct_push_consumer failed" << endl;
4141 + std::cerr << "Connecting struct_push_consumer failed" << std::endl;
4146 if (b_push_c->connect()) {
4147 - cerr << "Connecting batch_push_consumer failed" << endl;
4148 + std::cerr << "Connecting batch_push_consumer failed" << std::endl;
4154 if (l_pull_c->connect()) {
4155 - cerr << "Connecting legacy_pull_consumer failed" << endl;
4156 + std::cerr << "Connecting legacy_pull_consumer failed" << std::endl;
4161 if (a_pull_c->connect()) {
4162 - cerr << "Connecting any_pull_consumer failed" << endl;
4163 + std::cerr << "Connecting any_pull_consumer failed" << std::endl;
4168 if (s_pull_c->connect()) {
4169 - cerr << "Connecting struct_pull_consumer failed" << endl;
4170 + std::cerr << "Connecting struct_pull_consumer failed" << std::endl;
4175 if (b_pull_c->connect()) {
4176 - cerr << "Connecting batch_pull_consumer failed" << endl;
4177 + std::cerr << "Connecting batch_pull_consumer failed" << std::endl;
4182 - if (verbose) cout << "Connecting supplier clients to proxies" << endl;
4183 + if (verbose) std::cout << "Connecting supplier clients to proxies" << std::endl;
4186 if (l_push_s->connect()) {
4187 - cerr << "Connecting legacy_push_supplier failed" << endl;
4188 + std::cerr << "Connecting legacy_push_supplier failed" << std::endl;
4193 if (a_push_s->connect()) {
4194 - cerr << "Connecting any_push_supplier failed" << endl;
4195 + std::cerr << "Connecting any_push_supplier failed" << std::endl;
4200 if (s_push_s->connect()) {
4201 - cerr << "Connecting struct_push_supplier failed" << endl;
4202 + std::cerr << "Connecting struct_push_supplier failed" << std::endl;
4207 if (b_push_s->connect()) {
4208 - cerr << "Connecting batch_push_supplier failed" << endl;
4209 + std::cerr << "Connecting batch_push_supplier failed" << std::endl;
4215 if (l_pull_s->connect()) {
4216 - cerr << "Connecting legacy_pull_supplier failed" << endl;
4217 + std::cerr << "Connecting legacy_pull_supplier failed" << std::endl;
4222 if (a_pull_s->connect()) {
4223 - cerr << "Connecting any_pull_supplier failed" << endl;
4224 + std::cerr << "Connecting any_pull_supplier failed" << std::endl;
4229 if (s_pull_s->connect()) {
4230 - cerr << "Connecting struct_pull_supplier failed" << endl;
4231 + std::cerr << "Connecting struct_pull_supplier failed" << std::endl;
4236 if (b_pull_s->connect()) {
4237 - cerr << "Connecting batch_pull_supplier failed" << endl;
4238 + std::cerr << "Connecting batch_pull_supplier failed" << std::endl;
4243 - if (verbose) cout << "Waiting for all 16 clients to finish" << endl;
4244 + if (verbose) std::cout << "Waiting for all 16 clients to finish" << std::endl;
4246 CORBA::Boolean l_push_c_err = 0, l_pull_c_err = 0, l_push_s_err = 0, l_pull_s_err = 0;
4247 CORBA::Boolean a_push_c_err = 0, a_pull_c_err = 0, a_push_s_err = 0, a_pull_s_err = 0;
4248 @@ -745,13 +745,13 @@
4251 if (sup_com_err && (num_sup_events > 0)) {
4252 - if (verbose) cout << "Supplier communication error -- probably did not supply desired # of events" << endl;
4253 + if (verbose) std::cout << "Supplier communication error -- probably did not supply desired # of events" << std::endl;
4255 if (con_com_err && (num_con_events > 0)) {
4256 - if (verbose) cout << "Consumer communication error -- probably did not consume desired # of events" << endl;
4257 + if (verbose) std::cout << "Consumer communication error -- probably did not consume desired # of events" << std::endl;
4260 - if (verbose) cout << "Cleaning up" << endl;
4261 + if (verbose) std::cout << "Cleaning up" << std::endl;
4264 if (!l_push_c_err) { l_push_c->cleanup(); }
4265 @@ -808,23 +808,23 @@
4268 catch(CORBA::SystemException&) {
4269 - cerr << "main caught CORBA::SystemException." << endl;
4270 + std::cerr << "main caught CORBA::SystemException." << std::endl;
4272 catch(CORBA::Exception&) {
4273 - cerr << "main caught CORBA::Exception." << endl;
4274 + std::cerr << "main caught CORBA::Exception." << std::endl;
4276 catch(omniORB::fatalException& fe) {
4277 - cerr << "main caught omniORB::fatalException:" << endl;
4278 - cerr << " file: " << fe.file() << endl;
4279 - cerr << " line: " << fe.line() << endl;
4280 - cerr << " mesg: " << fe.errmsg() << endl;
4281 + std::cerr << "main caught omniORB::fatalException:" << std::endl;
4282 + std::cerr << " file: " << fe.file() << std::endl;
4283 + std::cerr << " line: " << fe.line() << std::endl;
4284 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
4287 // nameclt comment says it is a bad idea to report an error here
4289 - cerr << "main caught an exception." << endl;
4290 + std::cerr << "main caught an exception." << std::endl;
4292 - cerr << "QUITTING due to error" << endl;
4293 + std::cerr << "QUITTING due to error" << std::endl;
4297 diff -Naur --exclude=CVS omniNotify-2.1.orig/examples/ten_any_pull_consumers.cc omniNotify-2.1.new/examples/ten_any_pull_consumers.cc
4298 --- omniNotify-2.1.orig/examples/ten_any_pull_consumers.cc 2003-10-23 08:39:11.000000000 +0400
4299 +++ omniNotify-2.1.new/examples/ten_any_pull_consumers.cc 2009-06-28 17:14:26.000000000 +0400
4301 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
4303 // (1) Tell POA we are ready to go
4304 - if (verbose) cout << "Activating POA manager" << endl;
4305 + if (verbose) std::cout << "Activating POA manager" << std::endl;
4306 PortableServer::POAManager_var pman = poa->the_POAManager();
4310 num_con_events = num_events;
4312 // (3) Obtain reference to notification channel
4313 - if (verbose) cout << "Obtaining reference to notification channel" << endl;
4314 + if (verbose) std::cout << "Obtaining reference to notification channel" << std::endl;
4315 CosNA::EventChannel_ptr channel = getchan_from_ns(orb, channel_name, verbose);
4316 if (CORBA::is_nil(channel)) { // name service lookup failed
4317 channel = getchan_from_iorfile(orb, ior_file, verbose);
4321 // (4) Create all 12 CosNotify-style clients
4322 - if (verbose) cout << "Creating 10 any_pull_consumer clients" << endl;
4323 + if (verbose) std::cout << "Creating 10 any_pull_consumer clients" << std::endl;
4325 PullConsumer_i* a_pull_c[10];
4326 CosNotifyComm::PullConsumer_var my_a_pull_c[10];
4328 for (i = 0; i < 10; i++) {
4329 sprintf(buf, "any_pull_consumer%d", i);
4330 - if (verbose) cout << "Creating " << buf << endl;
4331 + if (verbose) std::cout << "Creating " << buf << std::endl;
4333 PullConsumer_i::create(orb, channel, num_con_events, batch_size, CORBA::string_dup(buf),
4334 "", "", sample_consume_any_fn, sample_offer_change_fn,
4338 // (5) Connect clients to their proxies -- consumers first
4339 - if (verbose) cout << "Connecting consumer clients to proxies" << endl;
4340 + if (verbose) std::cout << "Connecting consumer clients to proxies" << std::endl;
4342 for (i = 0; i < 10; i++) {
4343 - if (verbose) cout << "Connecting Client # " << i+1 << endl;
4344 + if (verbose) std::cout << "Connecting Client # " << i+1 << std::endl;
4345 if (a_pull_c[i]->connect()) { goto error_return; }
4348 - if (verbose) cout << "Waiting for all 10 clients to finish" << endl;
4349 + if (verbose) std::cout << "Waiting for all 10 clients to finish" << std::endl;
4351 CORBA::Boolean a_com_err[10];
4352 CORBA::Boolean com_err = 0;
4356 if (com_err && (num_events > 0)) {
4357 - if (verbose) cout << "Communication error -- probably did not process desired # of events" << endl;
4358 + if (verbose) std::cout << "Communication error -- probably did not process desired # of events" << std::endl;
4361 - if (verbose) cout << "Cleaning up" << endl;
4362 + if (verbose) std::cout << "Cleaning up" << std::endl;
4364 for (i = 0; i < 10; i++) {
4365 if (!a_com_err[i]) { a_pull_c[i]->cleanup(); }
4366 @@ -107,23 +107,23 @@
4369 catch(CORBA::SystemException&) {
4370 - cerr << "main caught CORBA::SystemException." << endl;
4371 + std::cerr << "main caught CORBA::SystemException." << std::endl;
4373 catch(CORBA::Exception&) {
4374 - cerr << "main caught CORBA::Exception." << endl;
4375 + std::cerr << "main caught CORBA::Exception." << std::endl;
4377 #if defined(__OMNIORB3__) || defined(__OMNIORB4__)
4378 catch(omniORB::fatalException& fe) {
4379 - cerr << "main caught omniORB::fatalException:" << endl;
4380 - cerr << " file: " << fe.file() << endl;
4381 - cerr << " line: " << fe.line() << endl;
4382 - cerr << " mesg: " << fe.errmsg() << endl;
4383 + std::cerr << "main caught omniORB::fatalException:" << std::endl;
4384 + std::cerr << " file: " << fe.file() << std::endl;
4385 + std::cerr << " line: " << fe.line() << std::endl;
4386 + std::cerr << " mesg: " << fe.errmsg() << std::endl;
4390 // nameclt comment says it is a bad idea to report an error here
4392 - cerr << "main caught an exception." << endl;
4393 + std::cerr << "main caught an exception." << std::endl;
4397 diff -Naur --exclude=CVS omniNotify-2.1.orig/include/ModFlexLexer.h omniNotify-2.1.new/include/ModFlexLexer.h
4398 --- omniNotify-2.1.orig/include/ModFlexLexer.h 2003-10-23 08:39:11.000000000 +0400
4399 +++ omniNotify-2.1.new/include/ModFlexLexer.h 2009-06-28 17:03:57.000000000 +0400
4402 // XXX ModFlexLexer overrides the 2 yylex decls, from
4404 -// XXX int yylex( istream* new_in, ostream* new_out = 0 )
4405 +// XXX int yylex( std::istream* new_in, std::ostream* new_out = 0 )
4407 // XXX int yylex(YYSTYPE* lvalp, RDI_PCState* ps)
4408 -// XXX int yylex(YYSTYPE* lvalp, RDI_PCState* ps, istream* new_in, ostream* new_out = 0 )
4409 +// XXX int yylex(YYSTYPE* lvalp, RDI_PCState* ps, std::istream* new_in, std::ostream* new_out = 0 )
4411 // XXX It therefore requires these 2 lines:
4412 #include "RDIConstraint.h"
4414 // Never included before - need to define base class.
4415 #define __FLEX_LEXER_H
4417 -#include <iostream.h>
4418 +#include <iostream>
4423 @@ -105,16 +106,16 @@
4425 yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
4426 virtual struct yy_buffer_state*
4427 - yy_create_buffer( istream* s, int size ) = 0;
4428 + yy_create_buffer( std::istream* s, int size ) = 0;
4429 virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
4430 - virtual void yyrestart( istream* s ) = 0;
4431 + virtual void yyrestart( std::istream* s ) = 0;
4433 virtual int yylex(YYSTYPE* lvalp, RDI_PCState* ps) = 0;
4434 // virtual int yylex() = 0;
4436 // Call yylex with new input/output sources.
4437 - int yylex(YYSTYPE* lvalp, RDI_PCState* ps, istream* new_in, ostream* new_out = 0 )
4438 - // int yylex( istream* new_in, ostream* new_out = 0 )
4439 + int yylex(YYSTYPE* lvalp, RDI_PCState* ps, std::istream* new_in, std::ostream* new_out = 0 )
4440 + // int yylex( std::istream* new_in, std::ostream* new_out = 0 )
4442 switch_streams( new_in, new_out );
4443 return yylex(lvalp, ps);
4446 // Switch to new input/output streams. A nil stream pointer
4447 // indicates "keep the current one".
4448 - virtual void switch_streams( istream* new_in = 0,
4449 - ostream* new_out = 0 ) = 0;
4450 + virtual void switch_streams( std::istream* new_in = 0,
4451 + std::ostream* new_out = 0 ) = 0;
4453 int lineno() const { return yylineno; }
4455 @@ -150,17 +151,17 @@
4457 // arg_yyin and arg_yyout default to the cin and cout, but we
4458 // only make that assignment when initializing in yylex().
4459 - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 );
4460 + yyFlexLexer( std::istream* arg_yyin = 0, std::ostream* arg_yyout = 0 );
4462 virtual ~yyFlexLexer();
4464 void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
4465 - struct yy_buffer_state* yy_create_buffer( istream* s, int size );
4466 + struct yy_buffer_state* yy_create_buffer( std::istream* s, int size );
4467 void yy_delete_buffer( struct yy_buffer_state* b );
4468 - void yyrestart( istream* s );
4469 + void yyrestart( std::istream* s );
4471 virtual int yylex(YYSTYPE* lvalp, RDI_PCState* ps);
4472 - virtual void switch_streams( istream* new_in, ostream* new_out );
4473 + virtual void switch_streams( std::istream* new_in, std::ostream* new_out );
4476 virtual int LexerInput( char* buf, int max_size );
4480 void yy_load_buffer_state();
4481 - void yy_init_buffer( struct yy_buffer_state* b, istream* s );
4482 + void yy_init_buffer( struct yy_buffer_state* b, std::istream* s );
4483 void yy_flush_buffer( struct yy_buffer_state* b );
4485 int yy_start_stack_ptr;
4487 yy_state_type yy_try_NUL_trans( yy_state_type current_state );
4488 int yy_get_next_buffer();
4490 - istream* yyin; // input source for default LexerInput
4491 - ostream* yyout; // output sink for default LexerOutput
4492 + std::istream* yyin; // input source for default LexerInput
4493 + std::ostream* yyout; // output sink for default LexerOutput
4495 struct yy_buffer_state* yy_current_buffer;
4497 diff -Naur --exclude=CVS omniNotify-2.1.orig/lib/RDIParser_l.cc omniNotify-2.1.new/lib/RDIParser_l.cc
4498 --- omniNotify-2.1.orig/lib/RDIParser_l.cc 2003-10-23 08:39:12.000000000 +0400
4499 +++ omniNotify-2.1.new/lib/RDIParser_l.cc 2009-06-28 17:06:28.000000000 +0400
4504 -#include <iostream.h>
4505 +#include <iostream>
4507 /* Use prototypes in function declarations. */
4508 #define YY_USE_PROTOS
4511 struct yy_buffer_state
4513 - istream* yy_input_file;
4514 + std::istream* yy_input_file;
4516 char *yy_ch_buf; /* input buffer */
4517 char *yy_buf_pos; /* current position in input buffer */
4518 @@ -1764,10 +1764,10 @@
4519 yy_start = 1; /* first start state */
4527 + yyout = &std::cout;
4529 if ( ! yy_current_buffer )
4531 @@ -2123,7 +2123,7 @@
4532 } /* end of scanning one token */
4533 } /* end of yylex */
4535 -yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
4536 +yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
4540 @@ -2157,7 +2157,7 @@
4541 yy_delete_buffer( yy_current_buffer );
4544 -void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
4545 +void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
4549 @@ -2497,7 +2497,7 @@
4553 -void yyFlexLexer::yyrestart( istream* input_file )
4554 +void yyFlexLexer::yyrestart( std::istream* input_file )
4556 if ( ! yy_current_buffer )
4557 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
4558 @@ -2541,7 +2541,7 @@
4562 -YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
4563 +YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
4567 @@ -2582,7 +2582,7 @@
4570 extern "C" int isatty YY_PROTO(( int ));
4571 -void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
4572 +void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
4575 yy_flush_buffer( b );
4576 @@ -2681,7 +2681,7 @@
4578 void yyFlexLexer::LexerError( yyconst char msg[] )
4580 - cerr << msg << '\n';
4581 + std::cerr << msg << '\n';
4582 exit( YY_EXIT_FAILURE );