Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / docs / tutorials / Quoter / Event_Service / Stock_i.cpp
blobc7a7008f896ee4d49b63b8713e502a811c2ef646
2 #include "Stock_i.h"
4 Quoter_Stock_i::Quoter_Stock_i (const char *symbol,
5 const char *full_name,
6 CORBA::Double price)
7 : supplier_personality_ (this)
9 this->data_.symbol = symbol;
10 this->data_.full_name = full_name;
11 this->data_.price = price;
14 char *
15 Quoter_Stock_i::symbol ()
17 return CORBA::string_dup (this->data_.symbol.in ());
20 char *
21 Quoter_Stock_i::full_name ()
23 return CORBA::string_dup (this->data_.full_name.in ());
26 CORBA::Double
27 Quoter_Stock_i::price ()
29 return this->data_.price;
32 void
33 Quoter_Stock_i::set_price (CORBA::Double new_price)
35 this->data_.price = new_price;
36 if (CORBA::is_nil (this->consumer_proxy_.in ()))
37 return;
39 CORBA::Any event;
40 event <<= this->data_;
41 this->consumer_proxy_->push (event);
44 void
45 Quoter_Stock_i::disconnect_push_supplier ()
47 // Forget about the consumer it is not there anymore
48 this->consumer_proxy_ =
49 CosEventChannelAdmin::ProxyPushConsumer::_nil ();
52 void
53 Quoter_Stock_i::connect (CosEventChannelAdmin::SupplierAdmin_ptr supplier_admin)
55 this->consumer_proxy_ =
56 supplier_admin->obtain_push_consumer ();
57 CosEventComm::PushSupplier_var supplier =
58 this->supplier_personality_._this ();
59 this->consumer_proxy_->connect_push_supplier (supplier.in ());