/*
  Stock_impl.cpp

  This is the implementation of a Corba Stock object. These objects will be
  created by a server application running the Stock_Factory object.

  It contains only boring business functions.

  Author: Ingo Kloeckl
 */

#include <OB/CORBA.h>
#include <Stock_impl.h>

using namespace std;

Quote_Stock_impl::Quote_Stock_impl(CORBA::Double pPrice, const char* pName,
				   const char* pSymbol) : 
  m_dPrice(pPrice), m_strName(pName), m_strSymbol(pSymbol) {
}

CORBA::Double Quote_Stock_impl::price() throw (CORBA::SystemException){
  return this->m_dPrice;
}

char* Quote_Stock_impl::name() throw (CORBA::SystemException){
  return CORBA::string_dup(this->m_strName.c_str());
}

char* Quote_Stock_impl::symbol() throw (CORBA::SystemException){
  return CORBA::string_dup(this->m_strSymbol.c_str());
}

void Quote_Stock_impl::destroy() throw (CORBA::SystemException){
  PortableServer::POA_var poa = _default_POA();
  PortableServer::ObjectId_var id = poa->servant_to_id(this);
  poa->deactivate_object(id);
}

