⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 store.c

📁 mico_example_siegel c源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
#include "Store.h"//--------------------------------------------------------//  Implementation of stubs//--------------------------------------------------------#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_ItemTypes; };#elseCORBA::TypeCodeConst AStore::_tc_ItemTypes;#endifCORBA::Boolean operator<<=( CORBA::Any &_a, const AStore::ItemTypes &_e ){  _a.type( AStore::_tc_ItemTypes );  return (_a.enum_put( (CORBA::ULong) _e ));}CORBA::Boolean operator>>=( const CORBA::Any &_a, AStore::ItemTypes &_e ){  CORBA::ULong _ul;  if( !_a.enum_get( _ul ) )    return FALSE;  _e = (AStore::ItemTypes) _ul;  return TRUE;}#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_AStoreId; };#elseCORBA::TypeCodeConst AStore::_tc_AStoreId;#endif#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_ItemInfo; };#elseCORBA::TypeCodeConst AStore::_tc_ItemInfo;#endif#ifdef HAVE_EXPLICIT_STRUCT_OPSAStore::ItemInfo::ItemInfo(){}AStore::ItemInfo::ItemInfo( const ItemInfo& _s ){  Item = ((ItemInfo&)_s).Item;  Itemtype = ((ItemInfo&)_s).Itemtype;  Itemcost = ((ItemInfo&)_s).Itemcost;  Name = ((ItemInfo&)_s).Name;  Quantity = ((ItemInfo&)_s).Quantity;}AStore::ItemInfo::~ItemInfo(){}AStore::ItemInfo&AStore::ItemInfo::operator=( const ItemInfo& _s ){  Item = ((ItemInfo&)_s).Item;  Itemtype = ((ItemInfo&)_s).Itemtype;  Itemcost = ((ItemInfo&)_s).Itemcost;  Name = ((ItemInfo&)_s).Name;  Quantity = ((ItemInfo&)_s).Quantity;  return *this;}#endifCORBA::Boolean operator<<=( CORBA::Any &_a, const AStore::ItemInfo &_s ){  _a.type( AStore::_tc_ItemInfo );  return (_a.struct_put_begin() &&    (_a <<= ((AStore::ItemInfo&)_s).Item) &&    (_a <<= ((AStore::ItemInfo&)_s).Itemtype) &&    (_a <<= ((AStore::ItemInfo&)_s).Itemcost) &&    (_a <<= ((AStore::ItemInfo&)_s).Name) &&    (_a <<= ((AStore::ItemInfo&)_s).Quantity) &&    _a.struct_put_end() );}CORBA::Boolean operator>>=( const CORBA::Any &_a, AStore::ItemInfo &_s ){  return (_a.struct_get_begin() &&    (_a >>= _s.Item) &&    (_a >>= _s.Itemtype) &&    (_a >>= _s.Itemcost) &&    (_a >>= _s.Name) &&    (_a >>= _s.Quantity) &&    _a.struct_get_end() );}#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_BarcodeNotFound; };#elseCORBA::TypeCodeConst AStore::_tc_BarcodeNotFound;#endif#ifdef HAVE_EXPLICIT_STRUCT_OPSAStore::BarcodeNotFound::BarcodeNotFound(){}AStore::BarcodeNotFound::BarcodeNotFound( const BarcodeNotFound& _s ){  item = ((BarcodeNotFound&)_s).item;}AStore::BarcodeNotFound::~BarcodeNotFound(){}AStore::BarcodeNotFound&AStore::BarcodeNotFound::operator=( const BarcodeNotFound& _s ){  item = ((BarcodeNotFound&)_s).item;  return *this;}#endifCORBA::Boolean operator<<=( CORBA::Any &_a, const AStore::BarcodeNotFound &_e ){  _a.type( AStore::_tc_BarcodeNotFound );  return (_a.except_put_begin( "IDL:AStore/BarcodeNotFound:1.0" ) &&    (_a <<= ((AStore::BarcodeNotFound&)_e).item) &&    _a.except_put_end() );}CORBA::Boolean operator>>=( const CORBA::Any &_a, AStore::BarcodeNotFound &_e ){  CORBA::String_var _repoid;  return (_a.except_get_begin( _repoid ) &&    (_a >>= _e.item) &&    _a.except_get_end() );}void AStore::BarcodeNotFound::_throwit() const{  #ifdef HAVE_EXCEPTIONS  throw BarcodeNotFound_var( (AStore::BarcodeNotFound*)_clone() );  #else  CORBA::Exception::_throw_failed( _clone() );  #endif}const char *AStore::BarcodeNotFound::_repoid() const{  return "IDL:AStore/BarcodeNotFound:1.0";}void AStore::BarcodeNotFound::_encode( CORBA::DataEncoder &_en ) const{  CORBA::Any _a;  _a <<= *this;  _a.marshal( _en );}CORBA::Exception *AStore::BarcodeNotFound::_clone() const{  return new BarcodeNotFound( *this );}AStore::BarcodeNotFound *AStore::BarcodeNotFound::_narrow( CORBA::Exception *_ex ){  if( _ex && !strcmp( _ex->_repoid(), "IDL:AStore/BarcodeNotFound:1.0" ) )    return (BarcodeNotFound *) _ex;  return NULL;}#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_POSInfo; };#elseCORBA::TypeCodeConst AStore::_tc_POSInfo;#endif#ifdef HAVE_EXPLICIT_STRUCT_OPSAStore::POSInfo::POSInfo(){}AStore::POSInfo::POSInfo( const POSInfo& _s ){  Id = ((POSInfo&)_s).Id;  StoreAccessReference = ((POSInfo&)_s).StoreAccessReference;  TotalSales = ((POSInfo&)_s).TotalSales;  TotalTaxes = ((POSInfo&)_s).TotalTaxes;}AStore::POSInfo::~POSInfo(){}AStore::POSInfo&AStore::POSInfo::operator=( const POSInfo& _s ){  Id = ((POSInfo&)_s).Id;  StoreAccessReference = ((POSInfo&)_s).StoreAccessReference;  TotalSales = ((POSInfo&)_s).TotalSales;  TotalTaxes = ((POSInfo&)_s).TotalTaxes;  return *this;}#endifCORBA::Boolean operator<<=( CORBA::Any &_a, const AStore::POSInfo &_s ){  _a.type( AStore::_tc_POSInfo );  return (_a.struct_put_begin() &&    (_a <<= ((AStore::POSInfo&)_s).Id) &&    (_a <<= (AStore::StoreAccess_ptr) ((AStore::POSInfo&)_s).StoreAccessReference) &&    (_a <<= ((AStore::POSInfo&)_s).TotalSales) &&    (_a <<= ((AStore::POSInfo&)_s).TotalTaxes) &&    _a.struct_put_end() );}CORBA::Boolean operator>>=( const CORBA::Any &_a, AStore::POSInfo &_s ){  return (_a.struct_get_begin() &&    (_a >>= _s.Id) &&    (_a >>= (AStore::StoreAccess_ptr&) _s.StoreAccessReference) &&    (_a >>= _s.TotalSales) &&    (_a >>= _s.TotalTaxes) &&    _a.struct_get_end() );}#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_POSList; };#elseCORBA::TypeCodeConst AStore::_tc_POSList;#endif// Stub interface TaxAStore::Tax::~Tax(){}AStore::Tax_ptr AStore::Tax::_duplicate( Tax_ptr _obj ){  if( !CORBA::is_nil( _obj ) )    _obj->_ref();  return _obj;}void *AStore::Tax::_narrow_helper( const char *_repoid ){  if( strcmp( _repoid, "IDL:AStore/Tax:1.0" ) == 0 )    return (void *)this;  return NULL;}bool AStore::Tax::_narrow_helper2( CORBA::Object_ptr _obj ){  if( strcmp( _obj->_repoid(), "IDL:AStore/Tax:1.0" ) == 0) {    return true;  }  for( vector<CORBA::Narrow_proto>::size_type _i = 0;       _narrow_helpers && _i < _narrow_helpers->size(); _i++ ) {    bool _res = (*(*_narrow_helpers)[ _i ])( _obj );    if( _res )      return true;  }  return false;}AStore::Tax_ptr AStore::Tax::_narrow( CORBA::Object_ptr _obj ){  AStore::Tax_ptr _o;  if( !CORBA::is_nil( _obj ) ) {    void *_p;    if( (_p = _obj->_narrow_helper( "IDL:AStore/Tax:1.0" )))      return _duplicate( (AStore::Tax_ptr) _p );    if( _narrow_helper2( _obj ) ) {      _o = new AStore::Tax_stub;      _o->MICO_SCOPE(CORBA,Object::operator=)( *_obj );      return _o;    }  }  return _nil();}AStore::Tax_ptr AStore::Tax::_nil(){  return NULL;}AStore::Tax_stub::~Tax_stub(){}CORBA::Float AStore::Tax_stub::CalculateTax( CORBA::Float TaxableAmount ){  CORBA::Request_var _req = this->_request( "CalculateTax" );  _req->add_in_arg( "TaxableAmount" ) <<= TaxableAmount;  _req->result()->value()->type( CORBA::_tc_float );  _req->invoke();  #ifdef HAVE_EXCEPTIONS  if( _req->env()->exception() ) {    CORBA::Exception *_ex = _req->env()->exception();    CORBA::UnknownUserException *_uuex = CORBA::UnknownUserException::_narrow( _ex );    if( _uuex ) {      mico_throw( CORBA::UNKNOWN() );    } else {      mico_throw( *_ex );    }  }  #else  {    CORBA::Exception *_ex;    if( (_ex = _req->env()->exception()) )      CORBA::Exception::_throw_failed( _ex );  }  #endif  CORBA::Float _res;  *_req->result()->value() >>= _res;  return _res;}CORBA::Float AStore::Tax_stub::FindTaxablePrice( CORBA::Float ItemPrice, AStore::ItemTypes ItemType ){  CORBA::Request_var _req = this->_request( "FindTaxablePrice" );  _req->add_in_arg( "ItemPrice" ) <<= ItemPrice;  _req->add_in_arg( "ItemType" ) <<= ItemType;  _req->result()->value()->type( CORBA::_tc_float );  _req->invoke();  #ifdef HAVE_EXCEPTIONS  if( _req->env()->exception() ) {    CORBA::Exception *_ex = _req->env()->exception();    CORBA::UnknownUserException *_uuex = CORBA::UnknownUserException::_narrow( _ex );    if( _uuex ) {      mico_throw( CORBA::UNKNOWN() );    } else {      mico_throw( *_ex );    }  }  #else  {    CORBA::Exception *_ex;    if( (_ex = _req->env()->exception()) )      CORBA::Exception::_throw_failed( _ex );  }  #endif  CORBA::Float _res;  *_req->result()->value() >>= _res;  return _res;}#ifdef HAVE_NAMESPACEnamespace AStore { vector<CORBA::Narrow_proto> * Tax::_narrow_helpers; };#elsevector<CORBA::Narrow_proto> * AStore::Tax::_narrow_helpers;#endif#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst _tc_Tax; };#elseCORBA::TypeCodeConst AStore::_tc_Tax;#endifCORBA::Booleanoperator<<=( CORBA::Any &_a, const AStore::Tax_ptr _obj ){  return (_a <<= CORBA::Any::from_object( _obj, "Tax" ));}CORBA::Booleanoperator>>=( const CORBA::Any &_a, AStore::Tax_ptr &_obj ){  CORBA::Object_ptr _o;  if( !(_a >>= CORBA::Any::to_object( _o )) )    return FALSE;  if( CORBA::is_nil( _o ) ) {    _obj = ::AStore::Tax::_nil();    return TRUE;  }  _obj = ::AStore::Tax::_narrow( _o );  CORBA::release( _o );  return TRUE;}#ifdef HAVE_NAMESPACEnamespace AStore { CORBA::TypeCodeConst Store::_tc_StoreTotals; };#elseCORBA::TypeCodeConst AStore::Store::_tc_StoreTotals;#endif#ifdef HAVE_EXPLICIT_STRUCT_OPSAStore::Store::StoreTotals::StoreTotals(){}AStore::Store::StoreTotals::StoreTotals( const StoreTotals& _s ){  StoreTotal = ((StoreTotals&)_s).StoreTotal;  StoreTaxTotal = ((StoreTotals&)_s).StoreTaxTotal;}AStore::Store::StoreTotals::~StoreTotals(){}AStore::Store::StoreTotals&AStore::Store::StoreTotals::operator=( const StoreTotals& _s ){  StoreTotal = ((StoreTotals&)_s).StoreTotal;  StoreTaxTotal = ((StoreTotals&)_s).StoreTaxTotal;  return *this;}#endifCORBA::Boolean operator<<=( CORBA::Any &_a, const AStore::Store::StoreTotals &_s ){  _a.type( AStore::Store::_tc_StoreTotals );  return (_a.struct_put_begin() &&    (_a <<= ((AStore::Store::StoreTotals&)_s).StoreTotal) &&    (_a <<= ((AStore::Store::StoreTotals&)_s).StoreTaxTotal) &&    _a.struct_put_end() );}CORBA::Boolean operator>>=( const CORBA::Any &_a, AStore::Store::StoreTotals &_s ){  return (_a.struct_get_begin() &&    (_a >>= _s.StoreTotal) &&    (_a >>= _s.StoreTaxTotal) &&

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -