int TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, TAO_ServerRequest &req, CORBA::Object_out forward_to) { ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START); // This object is magical, i.e., it has a non-trivial constructor // and destructor. TAO::Portable_Server::Servant_Upcall servant_upcall (&this->orb_core_); // Set up state in the POA et al (including the POA Current), so // that we know that this servant is currently in an upcall. const char *operation = req.operation (); int result = servant_upcall.prepare_for_upcall (key, operation, forward_to); if (result != TAO_Adapter::DS_OK) return result; // Preprocess request. if (req.collocated ()) { servant_upcall.pre_invoke_collocated_request (); } else { servant_upcall.pre_invoke_remote_request (req); } // Servant dispatch. { ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_DISPATCH_START); do_dispatch (req, servant_upcall); } #if TAO_HAS_INTERCEPTORS == 1 // ServerInterceptor might have raised ForwardRequest. In case of // remote calls invocations the LocationForwardReply would have been // sent in earlier stage, but in colocal scenario no message is sent // and the LocationForward object must be passed over here to // calling operation's mem-space. if (req.collocated() && req.pi_reply_status () == PortableInterceptor::LOCATION_FORWARD) { forward_to = req.forward_location (); result = TAO_Adapter::DS_FORWARD; } #endif return result; }
int TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key) { ACE_FUNCTION_TIMEPROBE (TAO_POA_LOCATE_SERVANT_START); PortableServer::ObjectId id; TAO_Root_POA *poa = 0; this->locate_poa (key, id, poa); PortableServer::Servant servant = 0; TAO_SERVANT_LOCATION const servant_location = poa->locate_servant_i (id, servant); switch (servant_location) { case TAO_SERVANT_FOUND: // Optimistic attitude case TAO_DEFAULT_SERVANT: case TAO_SERVANT_MANAGER: return 0; case TAO_SERVANT_NOT_FOUND: return -1; } return -1; }
int TAO_Dynamic_Hash_OpTable::find (const char *opname, TAO_Collocated_Skeleton& skel_ptr, TAO::Collocation_Strategy s, const unsigned int ) { ACE_FUNCTION_TIMEPROBE (TAO_DYNAMIC_HASH_OPTABLE_FIND_START); TAO::Operation_Skeletons skel; int const retval = this->hash_.find (opname, skel); if (retval != -1) { switch (s) { case TAO::TAO_CS_DIRECT_STRATEGY: skel_ptr = skel.direct_skel_ptr; break; default: return -1; } } return retval; }
void Cubit_i::cube_many_sequence (const Cubit::many_seq & input, Cubit::many_seq_out output) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_MANY_SEQUENCE_START); if (output.ptr () == 0) output = new Cubit::many_seq (input.length ()); output->length (input.length ()); #if defined (ACE_HAS_PURIFY) && (ACE_HAS_PURIFY == 1) for (CORBA::ULong i = 0; i < input.length (); ++i) { const Cubit::Many &in = input[i]; Cubit::Many &out = output[i]; out.o = in.o * in.o * in.o; out.s = in.s * in.s * in.s; out.l = in.l * in.l * in.l; } #else CORBA::ULong i = 0; const Cubit::Many &in = input[i]; Cubit::Many &out = output[i]; out.o = in.o * in.o * in.o; out.s = in.s * in.s * in.s; out.l = in.l * in.l * in.l; #endif /* ACE_HAS_PURIFY == 1 */ }
void Cubit_i::cube_rti_data (const Cubit::RtiPacket &input, Cubit::RtiPacket_out output) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_LONG_SEQUENCE_START); if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, "Input:\n")); print_RtiPacket (input); } if (output.ptr () == 0) output = new Cubit::RtiPacket (input); output->packetHeader.packetColor = input.packetHeader.packetColor * input.packetHeader.packetColor * input.packetHeader.packetColor; if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, "Output:\n")); print_RtiPacket (*output.ptr ()); } }
CORBA::Short Cubit_i::cube_short (CORBA::Short s) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_SHORT_START); return s * s * s; }
CORBA::Long Cubit_i::cube_long (CORBA::Long l) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_LONG_START); return l * l * l; }
CORBA::Octet Cubit_i::cube_octet (CORBA::Octet o) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_OCTET_START); return o * o * o; }
TAO_OutputCDR::TAO_OutputCDR (char *data, size_t size, int byte_order, ACE_Allocator *buffer_allocator, ACE_Allocator *data_block_allocator, ACE_Allocator* message_block_allocator, size_t memcpy_tradeoff, ACE_CDR::Octet major_version, ACE_CDR::Octet minor_version) : ACE_OutputCDR (data, size, byte_order, buffer_allocator, data_block_allocator, message_block_allocator, memcpy_tradeoff, major_version, minor_version) , fragmentation_strategy_ (0) , more_fragments_ (false) , request_id_ (0) , stub_ (0) , message_semantics_ (TAO_Message_Semantics::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR2_ENTER); }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_OutputCDR::TAO_OutputCDR (size_t size, int byte_order, ACE_Allocator *buffer_allocator, ACE_Allocator *data_block_allocator, ACE_Allocator* message_block_allocator, size_t memcpy_tradeoff, ACE_CDR::Octet major_version, ACE_CDR::Octet minor_version) : ACE_OutputCDR (size, byte_order, buffer_allocator, data_block_allocator, message_block_allocator, memcpy_tradeoff, major_version, minor_version) , fragmentation_strategy_ (0) , more_fragments_ (false) , request_id_ (0) , stub_ (0) , message_semantics_ (TAO_Message_Semantics::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR1_ENTER); #if defined (TAO_ZERO_TAO_OUTPUTCDR_ALLOCATED_BUFFERS) // Zero out the buffer if we allocated the buffer. if (size == 0) (void) ACE_OS::memset (this->current()->wr_ptr(), 0, this->current()->space()); #endif /* TAO_ZERO_TAO_OUTPUTCDR_ALLOCATED_BUFFERS */ }
int TAO_Perfect_Hash_OpTable::find (const char *opname, TAO_Collocated_Skeleton &skelfunc, TAO::Collocation_Strategy st, const unsigned int length) { ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START); TAO_operation_db_entry const * const entry = lookup (opname, length); if (entry == 0) { skelfunc = 0; // insure that somebody can't call a wrong function! TAOLIB_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("TAO_Perfect_Hash_OpTable:find for ") ACE_TEXT ("operation '%C' (length=%d) failed\n"), opname ? opname : "<null string>", length), -1); } switch (st) { case TAO::TAO_CS_DIRECT_STRATEGY: skelfunc = entry->direct_skel_ptr; break; default: return -1; } return 0; }
Cubit::oneof Cubit_i::cube_union (const Cubit::oneof &values) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_UNION_START); Cubit::oneof temp; switch (values._d ()) { case Cubit::e_0th: temp.o (values.o () * values.o () * values.o ()); break; case Cubit::e_1st: temp.s (values.s () * values.s () * values.s ()); break; case Cubit::e_2nd: temp.l (values.l () * values.l () * values.l ()); break; case Cubit::e_3rd: default: temp._d (values._d ()); // set the discriminant // use the read/write accessor temp.cm ().o = values.cm ().o * values.cm ().o * values.cm ().o; temp.cm ().s = values.cm ().s * values.cm ().s * values.cm ().s; temp.cm ().l = values.cm ().l * values.cm ().l * values.cm ().l; } return temp; }
void PP_Test_i::shutdown (void) { ACE_DEBUG ((LM_DEBUG, "%s\n", "PP_Test_i is shutting down")); ACE_FUNCTION_TIMEPROBE (PP_TEST_I_SERVER_SHUTDOWN_START); this->orb_->shutdown (); }
void TAO_Object_Adapter::locate_poa (const TAO::ObjectKey &key, PortableServer::ObjectId &system_id, TAO_Root_POA *&poa) { TAO_Object_Adapter::poa_name poa_system_name; CORBA::Boolean is_root = false; CORBA::Boolean is_persistent = false; CORBA::Boolean is_system_id = false; TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; int result = 0; { ACE_FUNCTION_TIMEPROBE (TAO_POA_PARSE_KEY_START); result = TAO_Root_POA::parse_key (key, poa_system_name, system_id, is_root, is_persistent, is_system_id, poa_creation_time); } if (result != 0) throw ::CORBA::OBJ_ADAPTER (); { ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_FIND_POA_START); result = this->find_poa (poa_system_name, is_persistent, is_root, poa_creation_time, poa); } if (result != 0) throw ::CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); }
CORBA::Any * Cubit_i::cube_any (const CORBA::Any & any) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_ANY_START); CORBA::Long l; any >>= l; l = l * l * l; CORBA::Any * ret_any = new CORBA::Any(); *ret_any <<= l; return ret_any; }
void Cubit_Client::cube_any_struct (int i) { try { Cubit::Many arg_struct; Cubit::Many * ret_struct; this->call_count_++; arg_struct.l = this->func (i); arg_struct.s = this->func (i); arg_struct.o = this->func (i); // Cube a "struct" in an any ... CORBA::Any arg_any; CORBA::Any * ret_any; arg_any <<= arg_struct; { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_ANY_STRUCT_START); ret_any = this->cubit_->cube_any_struct (arg_any); } *ret_any >>= ret_struct; if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "cube any struct ...")); } arg_struct.l = arg_struct.l * arg_struct.l * arg_struct.l; arg_struct.s = arg_struct.s * arg_struct.s * arg_struct.s; arg_struct.o = arg_struct.o * arg_struct.o * arg_struct.o; if (arg_struct.l != ret_struct->l || arg_struct.s != ret_struct->s || arg_struct.o != ret_struct->o) { ACE_ERROR ((LM_ERROR, "** cube_any_struct ERROR -- %d should be %d\n", ret_struct->l, arg_struct.l)); this->error_count_++; } delete ret_any; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_any_struct"); this->error_count_++; } }
ACE_Data_Block::ACE_Data_Block (size_t size, ACE_Message_Block::ACE_Message_Type msg_type, const char *msg_data, ACE_Allocator *allocator_strategy, ACE_Lock *locking_strategy, ACE_Message_Block::Message_Flags flags, ACE_Allocator *data_block_allocator) : type_ (msg_type), cur_size_ (0), // Reset later if memory alloc'd ok max_size_ (0), flags_ (flags), base_ (const_cast <char *> (msg_data)), allocator_strategy_ (allocator_strategy), locking_strategy_ (locking_strategy), reference_count_ (1), data_block_allocator_ (data_block_allocator) { ACE_TRACE ("ACE_Data_Block::ACE_Data_Block"); ACE_FUNCTION_TIMEPROBE (ACE_DATA_BLOCK_CTOR2_ENTER); // If the user didn't pass one in, let's use the // <ACE_Allocator::instance>. if (this->allocator_strategy_ == 0) ACE_ALLOCATOR (this->allocator_strategy_, ACE_Allocator::instance ()); if (this->data_block_allocator_ == 0) ACE_ALLOCATOR (this->data_block_allocator_, ACE_Allocator::instance ()); if (msg_data == 0) { ACE_ALLOCATOR (this->base_, (char *) this->allocator_strategy_->malloc (size)); #if defined (ACE_INITIALIZE_MEMORY_BEFORE_USE) (void) ACE_OS::memset (this->base_, '\0', size); #endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */ } // ACE_ALLOCATOR returns on alloc failure but we cant throw, so setting // the size to 0 (i.e. "bad bit") ... if (this->base_ == 0) { size = 0; } // The memory is legit, whether passed in or allocated, so set // the size. this->cur_size_ = this->max_size_ = size; }
Cubit::Many Cubit_i::cube_struct (const Cubit::Many &values) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_STRUCT_START); Cubit::Many temp; temp.o = values.o * values.o * values.o; temp.s = values.s * values.s * values.s; temp.l = values.l * values.l * values.l; return temp; }
void Cubit_Client::cube_any (int i) { try { CORBA::Long arg_long = this->func (i); // Cube a long inside an any. CORBA::Long ret_long; CORBA::Any arg_any; CORBA::Any * ret_any; // Should the timing include the packing and unpacking of the any? NO. arg_any <<= arg_long; { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_ANY_START); ret_any = this->cubit_->cube_any (arg_any); } *ret_any >>= ret_long; this->call_count_++; if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "cube any (long): %d --> %d\n", arg_long, ret_long)); } arg_long = arg_long * arg_long * arg_long; if (arg_long != ret_long) { ACE_ERROR ((LM_ERROR, "** cube_any(%d) ERROR (got %d, expect %d)\n", (CORBA::Long) this->func (i), ret_long, arg_long)); this->error_count_++; } delete ret_any; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_any"); this->error_count_++; } }
void Cubit_Client::cube_void (int) { try { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_VOID_START); this->cubit_->cube_void (); this->call_count_++; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_void"); this->error_count_++; } }
CORBA::Any * Cubit_i::cube_any_struct (const CORBA::Any & any) { ACE_FUNCTION_TIMEPROBE (CUBIT_I_CUBE_ANY_STRUCT_START); Cubit::Many * arg_struct; Cubit::Many ret_struct; any >>= arg_struct; ret_struct.o = arg_struct->o * arg_struct->o * arg_struct->o; ret_struct.s = arg_struct->s * arg_struct->s * arg_struct->s; ret_struct.l = arg_struct->l * arg_struct->l * arg_struct->l; CORBA::Any * ret_any = new CORBA::Any(); *ret_any <<= ret_struct; return ret_any; }
void Cubit_Client::cube_struct (int i) { try { Cubit::Many arg_struct; Cubit::Many ret_struct; this->call_count_++; arg_struct.l = this->func (i); arg_struct.s = this->func (i); arg_struct.o = this->func (i); // Cube a "struct" ... { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_STRUCT_START); ret_struct = this->cubit_->cube_struct (arg_struct); } if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "cube struct ...")); } arg_struct.l = arg_struct.l * arg_struct.l * arg_struct.l; arg_struct.s = arg_struct.s * arg_struct.s * arg_struct.s; arg_struct.o = arg_struct.o * arg_struct.o * arg_struct.o; if (arg_struct.l != ret_struct.l || arg_struct.s != ret_struct.s || arg_struct.o != ret_struct.o) { ACE_ERROR ((LM_ERROR, "** cube_struct ERROR\n")); this->error_count_++; } } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_struct"); this->error_count_++; } }
void Cubit_Client::cube_long (int i) { try { CORBA::Long arg_long = this->func (i); // Cube a long. CORBA::Long ret_long; { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_LONG_START); ret_long = this->cubit_->cube_long (arg_long); } this->call_count_++; if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "cube long: %d --> %d\n", arg_long, ret_long)); } arg_long = arg_long * arg_long * arg_long; if (arg_long != ret_long) { // CORBA::Long is 32 bits, which can be handled by %d on // most platforms. ACE_ERROR ((LM_ERROR, "** cube_long (%d) ERROR (--> %d)\n", (CORBA::Long) this->func (i), ret_long)); this->error_count_++; } } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_long"); this->error_count_++; } }
void PP_Test_Client::send_void (void) { try { ACE_FUNCTION_TIMEPROBE (PP_TEST_CLIENT_SEND_VOID_START); this->objref_->send_void (); this->call_count_++; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from send_void"); this->error_count_++; } }
ACE_Data_Block * ACE_Data_Block::clone_nocopy (ACE_Message_Block::Message_Flags mask, size_t max_size) const { ACE_FUNCTION_TIMEPROBE(ACE_DATA_BLOCK_CLONE_ENTER); ACE_TRACE ("ACE_Data_Block::clone_nocopy"); // You always want to clear this one to prevent memory leaks but you // might add some others later. const ACE_Message_Block::Message_Flags always_clear = ACE_Message_Block::DONT_DELETE; const size_t newsize = max_size == 0 ? this->max_size_ : max_size; ACE_Data_Block *nb = 0; ACE_NEW_MALLOC_RETURN (nb, static_cast<ACE_Data_Block*> ( this->data_block_allocator_->malloc (sizeof (ACE_Data_Block))), ACE_Data_Block (newsize, // size this->type_, // type 0, // data this->allocator_strategy_, // allocator this->locking_strategy_, // locking strategy this->flags_, // flags this->data_block_allocator_), 0); // Message block initialization may fail while the construction // succeds. Since as a matter of policy, ACE may throw no // exceptions, we have to do a separate check like this. if (nb != 0 && nb->size () < newsize) { nb->ACE_Data_Block::~ACE_Data_Block(); // placement destructor ... this->data_block_allocator_->free (nb); // free ... errno = ENOMEM; return 0; } // Set new flags minus the mask... nb->clr_flags (mask | always_clear); return nb; }
int TAO_Dynamic_Hash_OpTable::find (const char *opname, TAO_Skeleton& skel_ptr, const unsigned int ) { ACE_FUNCTION_TIMEPROBE (TAO_DYNAMIC_HASH_OPTABLE_FIND_START); TAO::Operation_Skeletons s; int const retval = this->hash_.find (opname, s); if (retval != -1) { skel_ptr = s.skel_ptr; } return retval; }
void Cubit_Client::cube_octet (int i) { try { CORBA::Octet arg_octet = this->func (i); // Cube an octet. CORBA::Octet ret_octet; { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_OCTET_START); ret_octet = this->cubit_->cube_octet (arg_octet); } this->call_count_++; if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "cube octet: %d --> %d\n", arg_octet, ret_octet)); } arg_octet = arg_octet * arg_octet * arg_octet; if (arg_octet != ret_octet) { ACE_DEBUG ((LM_DEBUG, "** cube_octet (%d) ERROR (--> %d)\n", (CORBA::Octet) this->func (i), ret_octet)); this->error_count_++; } } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_octet"); this->error_count_++; } }
void Cubit_Client::cube_short (int i) { try { CORBA::Short arg_short = this->func (i); // Cube a short. CORBA::Short ret_short; { ACE_FUNCTION_TIMEPROBE (CUBIT_CLIENT_CUBE_SHORT_START); ret_short = cubit_->cube_short (arg_short); } this->call_count_++; if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "cube short: %d --> %d\n", arg_short, ret_short)); } arg_short = arg_short * arg_short * arg_short; if (arg_short != ret_short) { ACE_ERROR ((LM_ERROR, "** cube_short (%d) ERROR (--> %d)\n", (CORBA::Short) this->func (i), ret_short)); this->error_count_++; } } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("from cube_short"); this->error_count_++; } }
ACE_Data_Block::ACE_Data_Block (void) : type_ (ACE_Message_Block::MB_DATA), cur_size_ (0), max_size_ (0), flags_ (ACE_Message_Block::DONT_DELETE), base_ (0), allocator_strategy_ (0), locking_strategy_ (0), reference_count_ (1), data_block_allocator_ (0) { ACE_TRACE ("ACE_Data_Block::ACE_Data_Block"); ACE_FUNCTION_TIMEPROBE (ACE_DATA_BLOCK_CTOR1_ENTER); ACE_ALLOCATOR (this->allocator_strategy_, ACE_Allocator::instance ()); ACE_ALLOCATOR (this->data_block_allocator_, ACE_Allocator::instance ()); }
int PP_Test_Client::run () { if (this->only_void_) { return this->run_void (); } if (this->only_oneway_) { return this->run_oneway (); } CORBA::ULong i; // Show the results one type at a time. // VOID this->call_count_ = 0; this->error_count_ = 0; for (i = 0; i < this->loop_count_; i++) { this->send_void (); } // ONEWAY this->call_count_ = 0; this->error_count_ = 0; for (i = 0; i < this->loop_count_; i++) { this->send_oneway (); } // This causes a memPartFree on VxWorks. ACE_FUNCTION_TIMEPROBE (PP_TEST_CLIENT_SERVER_SHUTDOWN_START); this->shutdown_server (this->shutdown_); return this->error_count_ == 0 ? 0 : 1; }