summaryrefslogtreecommitdiff
path: root/TAO/docs/tutorials/Quoter/AMI/Handler_i.cpp
blob: 178a4767babc9dfa9a32f36df9638fae05fa0471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//
// $Id$
//

#include "Handler_i.h"
#include "ace/streams.h"

Single_Query_Stock_Handler_i::
    Single_Query_Stock_Handler_i (int *response_count)
    : response_count_ (response_count)
{
}

void
Single_Query_Stock_Handler_i::get_price_and_names (CORBA::Double ami_return_val,
                                                  const char *symbol,
                                                  const char *full_name)
  throw (CORBA::SystemException)
{
  cout << "The price of one stock in \""
       << full_name << "\" (" << symbol << ") is "
       << ami_return_val << endl;
  (*this->response_count_)++;
}

void
Single_Query_Stock_Handler_i::
    get_price_and_names_excep (Quoter::AMI_Single_Query_StockExceptionHolder *)
  throw (CORBA::SystemException)
{
  // We ignore the exception, but this counts as a reponse, otherwise
  // the application would not finish.
  cerr << "Exception raised while querying stock price"
       << endl;
  (*this->response_count_)++;
}


void
Single_Query_Stock_Handler_i::get_symbol (const char *)
  throw (CORBA::SystemException)
{
  throw CORBA::NO_IMPLEMENT ();
}

void
Single_Query_Stock_Handler_i::
    get_symbol_excep (Quoter::AMI_StockExceptionHolder *)
  throw (CORBA::SystemException)
{
  throw CORBA::NO_IMPLEMENT ();
}

void
Single_Query_Stock_Handler_i::get_full_name (const char *)
  throw (CORBA::SystemException)
{
    throw CORBA::NO_IMPLEMENT ();
}

void
Single_Query_Stock_Handler_i::
   get_full_name_excep (Quoter::AMI_StockExceptionHolder *)
  throw (CORBA::SystemException)
{
    throw CORBA::NO_IMPLEMENT ();
}

void
Single_Query_Stock_Handler_i::price (double)
  throw (CORBA::SystemException)
{
  throw CORBA::NO_IMPLEMENT ();
}

void
Single_Query_Stock_Handler_i::
    price_excep (Quoter::AMI_StockExceptionHolder *)
  throw (CORBA::SystemException)
{
    throw CORBA::NO_IMPLEMENT ();
}