📄 store.c
字号:
"6f74686572000000000000094974656d636f737400000000000000060000" "00054e616d65000000000000001200000000000000095175616e74697479" "0000000000000003"; AStore::_tc_BarcodeNotFound = "000000000000001600000084000000000000001f49444c3a4153746f7265" "2f426172636f64654e6f74466f756e643a312e3000000000001042617263" "6f64654e6f74466f756e640000000001000000056974656d000000000000" "001500000030000000000000001449444c3a504f532f426172636f64653a" "312e300000000008426172636f6465000000001200000000"; AStore::_tc_POSInfo = "000000000000000f000000ec000000000000001749444c3a4153746f7265" "2f504f53496e666f3a312e30000000000008504f53496e666f0000000004" "0000000349640000000000150000002c000000000000001249444c3a504f" "532f504f5349643a312e3000000000000006504f53496400000000000003" "0000001553746f72654163636573735265666572656e6365000000000000" "000e00000034000000000000001b49444c3a4153746f72652f53746f7265" "4163636573733a312e3000000000000c53746f7265416363657373000000" "000b546f74616c53616c65730000000000060000000b546f74616c546178" "6573000000000006"; AStore::_tc_POSList = "000000000000001500000130000000000000001749444c3a4153746f7265" "2f504f534c6973743a312e30000000000008504f534c6973740000000013" "000000fc000000000000000f000000ec000000000000001749444c3a4153" "746f72652f504f53496e666f3a312e30000000000008504f53496e666f00" "000000040000000349640000000000150000002c00000000000000124944" "4c3a504f532f504f5349643a312e3000000000000006504f534964000000" "000000030000001553746f72654163636573735265666572656e63650000" "00000000000e00000034000000000000001b49444c3a4153746f72652f53" "746f72654163636573733a312e3000000000000c53746f72654163636573" "73000000000b546f74616c53616c65730000000000060000000b546f7461" "6c546178657300000000000600000000"; AStore::_tc_Tax = "000000000000000e00000024000000000000001349444c3a4153746f7265" "2f5461783a312e3000000000000454617800"; AStore::Store::_tc_StoreTotals = "000000000000000f0000006c000000000000002149444c3a4153746f7265" "2f53746f72652f53746f7265546f74616c733a312e30000000000000000c" "53746f7265546f74616c7300000000020000000b53746f7265546f74616c" "0000000000060000000e53746f7265546178546f74616c00000000000006" ; AStore::_tc_Store = "000000000000000e0000002a000000000000001549444c3a4153746f7265" "2f53746f72653a312e30000000000000000653746f726500"; AStore::_tc_StoreAccess = "000000000000000e00000034000000000000001b49444c3a4153746f7265" "2f53746f72654163636573733a312e3000000000000c53746f7265416363" "65737300"; }};static __tc_init_STORE __init_STORE;//--------------------------------------------------------// Implementation of skeletons//--------------------------------------------------------// Dynamic Implementation Routine for interface TaxAStore::Tax_skel::Tax_skel( const CORBA::BOA::ReferenceData &_id ){ CORBA::ImplementationDef_var _impl = _find_impl( "IDL:AStore/Tax:1.0", "Tax" ); assert( !CORBA::is_nil( _impl ) ); _create_ref( _id, CORBA::InterfaceDef::_nil(), _impl, "IDL:AStore/Tax:1.0" ); register_dispatcher( new InterfaceDispatcherWrapper<Tax_skel>( this ) );}AStore::Tax_skel::Tax_skel( CORBA::Object_ptr _obj ){ CORBA::ImplementationDef_var _impl = _find_impl( "IDL:AStore/Tax:1.0", "Tax" ); assert( !CORBA::is_nil( _impl ) ); _restore_ref( _obj, CORBA::BOA::ReferenceData(), CORBA::InterfaceDef::_nil(), _impl ); register_dispatcher( new InterfaceDispatcherWrapper<Tax_skel>( this ) );}AStore::Tax_skel::~Tax_skel(){}bool AStore::Tax_skel::dispatch( CORBA::ServerRequest_ptr _req, CORBA::Environment & /*_env*/ ){ if( strcmp( _req->op_name(), "CalculateTax" ) == 0 ) { CORBA::Float TaxableAmount; CORBA::NVList_ptr _args = new CORBA::NVList (1); _args->add( CORBA::ARG_IN ); _args->item( 0 )->value()->type( CORBA::_tc_float ); if (!_req->params( _args )) return true; *_args->item( 0 )->value() >>= TaxableAmount; CORBA::Float _res; #ifdef HAVE_EXCEPTIONS try { #endif _res = CalculateTax( TaxableAmount ); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif CORBA::Any *_any_res = new CORBA::Any; *_any_res <<= _res; _req->result( _any_res ); return true; } if( strcmp( _req->op_name(), "FindTaxablePrice" ) == 0 ) { CORBA::Float ItemPrice; ItemTypes ItemType; CORBA::NVList_ptr _args = new CORBA::NVList (2); _args->add( CORBA::ARG_IN ); _args->item( 0 )->value()->type( CORBA::_tc_float ); _args->add( CORBA::ARG_IN ); _args->item( 1 )->value()->type( AStore::_tc_ItemTypes ); if (!_req->params( _args )) return true; *_args->item( 0 )->value() >>= ItemPrice; *_args->item( 1 )->value() >>= ItemType; CORBA::Float _res; #ifdef HAVE_EXCEPTIONS try { #endif _res = FindTaxablePrice( ItemPrice, ItemType ); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif CORBA::Any *_any_res = new CORBA::Any; *_any_res <<= _res; _req->result( _any_res ); return true; } return false;}AStore::Tax_ptr AStore::Tax_skel::_this(){ return AStore::Tax::_duplicate( this );}// Dynamic Implementation Routine for interface StoreAStore::Store_skel::Store_skel( const CORBA::BOA::ReferenceData &_id ){ CORBA::ImplementationDef_var _impl = _find_impl( "IDL:AStore/Store:1.0", "Store" ); assert( !CORBA::is_nil( _impl ) ); _create_ref( _id, CORBA::InterfaceDef::_nil(), _impl, "IDL:AStore/Store:1.0" ); register_dispatcher( new InterfaceDispatcherWrapper<Store_skel>( this ) );}AStore::Store_skel::Store_skel( CORBA::Object_ptr _obj ){ CORBA::ImplementationDef_var _impl = _find_impl( "IDL:AStore/Store:1.0", "Store" ); assert( !CORBA::is_nil( _impl ) ); _restore_ref( _obj, CORBA::BOA::ReferenceData(), CORBA::InterfaceDef::_nil(), _impl ); register_dispatcher( new InterfaceDispatcherWrapper<Store_skel>( this ) );}AStore::Store_skel::~Store_skel(){}bool AStore::Store_skel::dispatch( CORBA::ServerRequest_ptr _req, CORBA::Environment & /*_env*/ ){ if( strcmp( _req->op_name(), "_get_StoreId" ) == 0 ) { CORBA::NVList_ptr _args = new CORBA::NVList (0); if (!_req->params( _args )) return true; AStoreId _res; #ifdef HAVE_EXCEPTIONS try { #endif _res = StoreId(); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif CORBA::Any *_any_res = new CORBA::Any; *_any_res <<= _res; _req->result( _any_res ); return true; } if( strcmp( _req->op_name(), "_get_Totals" ) == 0 ) { CORBA::NVList_ptr _args = new CORBA::NVList (0); if (!_req->params( _args )) return true; StoreTotals _res; #ifdef HAVE_EXCEPTIONS try { #endif _res = Totals(); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif CORBA::Any *_any_res = new CORBA::Any; *_any_res <<= _res; _req->result( _any_res ); return true; } if( strcmp( _req->op_name(), "Login" ) == 0 ) { POS::POSId Id; CORBA::NVList_ptr _args = new CORBA::NVList (1); _args->add( CORBA::ARG_IN ); _args->item( 0 )->value()->type( POS::_tc_POSId ); if (!_req->params( _args )) return true; *_args->item( 0 )->value() >>= Id; StoreAccess_ptr _res; #ifdef HAVE_EXCEPTIONS try { #endif _res = Login( Id ); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif CORBA::Any *_any_res = new CORBA::Any; *_any_res <<= (StoreAccess_ptr) _res; CORBA::release( _res ); _req->result( _any_res ); return true; } if( strcmp( _req->op_name(), "GetPOSTotals" ) == 0 ) { POSList* POSData; CORBA::NVList_ptr _args = new CORBA::NVList (1); _args->add( CORBA::ARG_OUT ); _args->item( 0 )->value()->type( AStore::_tc_POSList ); if (!_req->params( _args )) return true; #ifdef HAVE_EXCEPTIONS try { #endif GetPOSTotals( POSData ); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif *_args->item( 0 )->value() <<= *POSData; delete POSData; return true; } if( strcmp( _req->op_name(), "UpdateStoreTotals" ) == 0 ) { POS::POSId Id; CORBA::Float Price; CORBA::Float Taxes; CORBA::NVList_ptr _args = new CORBA::NVList (3); _args->add( CORBA::ARG_IN ); _args->item( 0 )->value()->type( POS::_tc_POSId ); _args->add( CORBA::ARG_IN ); _args->item( 1 )->value()->type( CORBA::_tc_float ); _args->add( CORBA::ARG_IN ); _args->item( 2 )->value()->type( CORBA::_tc_float ); if (!_req->params( _args )) return true; *_args->item( 0 )->value() >>= Id; *_args->item( 1 )->value() >>= Price; *_args->item( 2 )->value() >>= Taxes; #ifdef HAVE_EXCEPTIONS try { #endif UpdateStoreTotals( Id, Price, Taxes ); #ifdef HAVE_EXCEPTIONS } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif return true; } return false;}AStore::Store_ptr AStore::Store_skel::_this(){ return AStore::Store::_duplicate( this );}// Dynamic Implementation Routine for interface StoreAccessAStore::StoreAccess_skel::StoreAccess_skel( const CORBA::BOA::ReferenceData &_id ){ CORBA::ImplementationDef_var _impl = _find_impl( "IDL:AStore/StoreAccess:1.0", "StoreAccess" ); assert( !CORBA::is_nil( _impl ) ); _create_ref( _id, CORBA::InterfaceDef::_nil(), _impl, "IDL:AStore/StoreAccess:1.0" ); register_dispatcher( new InterfaceDispatcherWrapper<StoreAccess_skel>( this ) );}AStore::StoreAccess_skel::StoreAccess_skel( CORBA::Object_ptr _obj ){ CORBA::ImplementationDef_var _impl = _find_impl( "IDL:AStore/StoreAccess:1.0", "StoreAccess" ); assert( !CORBA::is_nil( _impl ) ); _restore_ref( _obj, CORBA::BOA::ReferenceData(), CORBA::InterfaceDef::_nil(), _impl ); register_dispatcher( new InterfaceDispatcherWrapper<StoreAccess_skel>( this ) );}AStore::StoreAccess_skel::~StoreAccess_skel(){}bool AStore::StoreAccess_skel::dispatch( CORBA::ServerRequest_ptr _req, CORBA::Environment & /*_env*/ ){ if( strcmp( _req->op_name(), "FindPrice" ) == 0 ) { POS::Barcode_var Item; CORBA::Long Quantity; CORBA::Float ItemPrice; CORBA::Float ItemTaxPrice; ItemInfo* IInfo; CORBA::NVList_ptr _args = new CORBA::NVList (5); _args->add( CORBA::ARG_IN ); _args->item( 0 )->value()->type( POS::_tc_Barcode ); _args->add( CORBA::ARG_IN ); _args->item( 1 )->value()->type( CORBA::_tc_long ); _args->add( CORBA::ARG_OUT ); _args->item( 2 )->value()->type( CORBA::_tc_float ); _args->add( CORBA::ARG_OUT ); _args->item( 3 )->value()->type( CORBA::_tc_float ); _args->add( CORBA::ARG_OUT ); _args->item( 4 )->value()->type( AStore::_tc_ItemInfo ); if (!_req->params( _args )) return true; *_args->item( 0 )->value() >>= CORBA::Any::to_string( Item, 0 ); *_args->item( 1 )->value() >>= Quantity; #ifdef HAVE_EXCEPTIONS try { #endif FindPrice( Item, Quantity, ItemPrice, ItemTaxPrice, IInfo ); #ifdef HAVE_EXCEPTIONS } catch( ::AStore::BarcodeNotFound_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( CORBA::SystemException_var &_ex ) { _req->exception( _ex->_clone() ); return true; } catch( ... ) { assert( 0 ); return true; } #endif *_args->item( 2 )->value() <<= ItemPrice; *_args->item( 3 )->value() <<= ItemTaxPrice; *_args->item( 4 )->value() <<= *IInfo; delete IInfo; return true; } return false;}AStore::StoreAccess_ptr AStore::StoreAccess_skel::_this(){ return AStore::StoreAccess::_duplicate( this );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -