diff options
Diffstat (limited to 'TAO/examples/Advanced/ch_18/client.cpp')
-rw-r--r-- | TAO/examples/Advanced/ch_18/client.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/TAO/examples/Advanced/ch_18/client.cpp b/TAO/examples/Advanced/ch_18/client.cpp index 1d0b8d50ecf..2b85967e1bc 100644 --- a/TAO/examples/Advanced/ch_18/client.cpp +++ b/TAO/examples/Advanced/ch_18/client.cpp @@ -17,11 +17,10 @@ // // ============================================================================ -#include "CCSC.h" // ORB-specific -#include "assert.h" -#include <orbsvcs/CosNamingC.h> -#include <iostream> -// #include <fstream.h> +#include "CCSC.h" // ORB-specific +#include "assert.h" +#include <orbsvcs/CosNamingC.h> +#include <ace/streams.h> // ---------------------------------------------------------------- using namespace std; @@ -40,7 +39,7 @@ resolve_init(CORBA::ORB_ptr orb, const char * id) catch (const CORBA::Exception & e) { std::cerr << "Cannot get initial reference for " << id << ": " - //<< e + << e << std::endl; throw 0; } @@ -53,7 +52,7 @@ resolve_init(CORBA::ORB_ptr orb, const char * id) catch (const CORBA::Exception & e) { std::cerr << "Cannot narrow reference for " << id << ": " - //<< e + << e << std::endl; throw 0; } @@ -82,7 +81,7 @@ resolve_name( } catch (const CORBA::Exception & e) { std::cerr << "Cannot resolve binding: " - //<< e + << e << std::endl; throw 0; } @@ -97,7 +96,7 @@ resolve_name( } catch (const CORBA::Exception & e) { std::cerr << "Cannot narrow reference: " - //<< e + << e << std::endl; throw 0; } @@ -280,7 +279,10 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) list = ctrl->list(); // Show details for each device. for ( i = 0; i < list->length(); i++) - std::cout << list[i]; + { + CCS::Thermometer_ptr ti = list[i]; + std::cout << ti; + } std::cout << std::endl; // Change the location of first device in the list @@ -291,7 +293,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) // Check that the location was updated std::cout << "New details for device " << anum << " are:" << std::endl; - std::cout << list[0u] << std::endl; + CCS::Thermometer_ptr tx = list[0u]; + std::cout << tx << std::endl; // Find first thermostat in list. CCS::Thermostat_var tmstat; @@ -352,7 +355,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } } catch (const CORBA::Exception & e) { std::cerr << "Uncaught CORBA exception: " - //<< e + << e << std::endl; return 1; } catch (...) { |