这篇教程C++ ACE_TEXT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACE_TEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ ACE_TEXT函数的具体用法?C++ ACE_TEXT怎么用?C++ ACE_TEXT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACE_TEXT函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: throwvoid qlTimeSeriesDataReaderListenerImpl::on_data_available( DDS::DataReader_ptr reader ) throw (CORBA::SystemException){ try { timeseries::qlTimeSeriesDataReader_var obj_dr = timeseries::qlTimeSeriesDataReader::_narrow(reader); if (CORBA::is_nil (obj_dr.in ())) { ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") ACE_TEXT("qlTimeSeriesDataReaderListenerImpl::on_data_available: _narrow failed./n"))); } on_reading_start( reader ); int count = 0; while ( true ) { timeseries::qlTimeSeries obj; DDS::SampleInfo si ; DDS::ReturnCode_t status = obj_dr->take_next_sample(obj, si) ; if ( status == DDS::RETCODE_OK ) { if ( si.valid_data == true ) { ++count; if ( pre_quantlib_addin_call( reader, si, obj ) ) { std::string returnObject;; try { ACE_Guard<ACE_Mutex> guard( get_ACE_Mutex() ); returnObject = QuantLibAddinCpp::qlTimeSeries ( obj.ObjectId.in(), qldds_utils::vector_cast<ObjectHandler::property_t,CORBA::StringSeq>(obj.Dates), qldds_utils::vector_cast<double,CORBA::DoubleSeq>(obj.Values), static_cast<bool>(obj.Permanent), obj.Trigger, static_cast<bool>(obj.Overwrite) ); ; } catch ( std::exception& e ) { on_std_exception( reader, obj, e ); continue; } if ( !post_quantlib_addin_call( reader, obj, returnObject ) ) break; } } } else if (status == DDS::RETCODE_NO_DATA) { on_reading_end( reader, count ); break; } else { std::string err = "ERROR: read qlTimeSeries: Error: "; err += status; on_dds_reading_error( reader, err ); } } } catch (CORBA::Exception& e) { on_dds_exception( reader, e ); }}
开发者ID:Fantasticer,项目名称:qldds,代码行数:75,
示例2: definedintACE_Svc_Conf_Lexer::yylex (YYSTYPE* ace_yylval, ACE_Svc_Conf_Param* param){#if defined (ACE_USES_WCHAR) bool look_for_bom = false; ACE_Encoding_Converter_Factory::Encoding_Hint hint = ACE_Encoding_Converter_Factory::ACE_NONE;#endif /* ACE_USES_WCHAR */ if (param->buffer == 0) {#if defined (ACE_USES_WCHAR) look_for_bom = true;#endif /* ACE_USES_WCHAR */ ACE_NEW_RETURN (param->buffer, ace_yy_buffer_state, -1); } int token = ACE_NO_STATE; do { if (param->buffer->need_more_) {#if defined (ACE_USES_WCHAR) size_t skip_bytes = 0;#endif /* ACE_USES_WCHAR */ param->buffer->need_more_ = false; size_t amount = input (param, param->buffer->input_ + param->buffer->size_, normalize (ACE_YY_BUF_SIZE - param->buffer->size_)); if (amount == 0) { param->buffer->eof_ = true;#if defined (ACE_USES_WCHAR) skip_bytes = param->buffer->size_;#endif /* ACE_USES_WCHAR */ } else {#if defined (ACE_USES_WCHAR) if (look_for_bom) { size_t read_more = 0; look_for_bom = false; hint = locate_bom (param->buffer->input_, amount, read_more); if (read_more != 0) { input (param, param->buffer->input_ + amount, read_more); ACE_OS::memmove (param->buffer->input_, param->buffer->input_ + read_more, amount); } } skip_bytes = param->buffer->size_;#endif /* ACE_USES_WCHAR */ param->buffer->size_ += amount; }#if defined (ACE_USES_WCHAR) if (!convert_to_utf8 (param, skip_bytes, hint)) { ace_yyerror (++param->yyerrno, param->yylineno, ACE_TEXT ("Unable to convert input stream to UTF-8")); return ACE_NO_STATE; }#endif /* ACE_USES_WCHAR */ } token = scan (ace_yylval, param); } while (token == ACE_NO_STATE && param->buffer->need_more_); return token;}
开发者ID:CCJY,项目名称:ACE,代码行数:80,
示例3: ACE_GUARDvoidTAO::PG_Object_Group::add_member (const PortableGroup::Location & the_location, CORBA::Object_ptr member){ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_); if (CORBA::is_nil (member)) { if (TAO_debug_level > 3) { ORBSVCS_ERROR ((LM_ERROR, ACE_TEXT ("%T %n (%P|%t) - TAO::PG_Object_Group::add_member") ACE_TEXT ("Can't add a null member to object group/n") )); } throw PortableGroup::ObjectNotAdded (); } ///////////////////////////////////////// // Convert the new member to a string IOR // This keeps a clean IOR (not an IOGR!) // while we add it to a group. We need a // IORs, not IOGRs to send new IOGRs out // to replicas. // Verify that the member is not using V1.0 profiles // since IIOP V1.0 does not support tagged components const TAO_MProfile &member_profiles = member->_stubobj ()->base_profiles (); CORBA::ULong member_profile_count = member_profiles.profile_count (); if (member_profile_count > 0) { const TAO_GIOP_Message_Version & version = member_profiles.get_profile (0)->version (); if (version.major_version () == 1 && version.minor_version () == 0) { if (TAO_debug_level > 3) { ORBSVCS_ERROR ((LM_ERROR, ACE_TEXT ("%T %n (%P|%t) - ") ACE_TEXT ("Can't add member because first profile ") ACE_TEXT ("is IIOP version 1.0, which does not ") ACE_TEXT ("support tagged components./n") )); } throw PortableGroup::ObjectNotAdded (); } } CORBA::String_var member_ior_string = orb_->object_to_string (member); PortableGroup::ObjectGroup_var new_reference; try { new_reference = this->add_member_to_iogr (member); } catch (const TAO_IOP::Duplicate&) { throw PortableGroup::MemberAlreadyPresent (); } catch (const TAO_IOP::Invalid_IOR&) { throw PortableGroup::ObjectNotAdded (); } catch (...) { throw; } if (CORBA::is_nil (new_reference.in ())) throw PortableGroup::ObjectNotAdded (); // Convert new member back to a (non group) ior. CORBA::Object_var member_ior = this->orb_->string_to_object (member_ior_string.in ()); MemberInfo * info = 0; ACE_NEW_THROW_EX (info, MemberInfo (member_ior.in (), the_location), CORBA::NO_MEMORY()); if (this->members_.bind (the_location, info) != 0) { delete info; // @@ Dale why this is a NO MEMORY exception? throw CORBA::NO_MEMORY(); } this->reference_ = new_reference; // note var-to-var assignment does // a duplicate if (this->increment_version ()) { this->distribute_iogr ();//.........这里部分代码省略.........
开发者ID:bjovke,项目名称:ACE_TAO,代码行数:101,
示例4: RPG_TRACEvoidSDL_GUI_MainWindow::initScrollSpots(){ RPG_TRACE(ACE_TEXT("SDL_GUI_MainWindow::initScrollSpots")); // upper left RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // size std::make_pair(0, 0), // offset CURSOR_SCROLL_UL); // (hover) cursor graphic // up RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair((clipRectangle_.w - (2 * RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN)), RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // size std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, 0), // offset CURSOR_SCROLL_U); // (hover) cursor graphic // upper right RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // size std::make_pair((clipRectangle_.w - RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), 0), // offset CURSOR_SCROLL_UR); // (hover) cursor graphic // left RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, (clipRectangle_.h - (2 * RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN))), // size std::make_pair(0, RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // offset CURSOR_SCROLL_L); // (hover) cursor graphic // right RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, (clipRectangle_.h - (2 * RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN))), // size std::make_pair((clipRectangle_.w - RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // offset CURSOR_SCROLL_R); // (hover) cursor graphic // lower left RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // size std::make_pair(0, (clipRectangle_.h - RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN)), // offset CURSOR_SCROLL_DL); // (hover) cursor graphic // down RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(clipRectangle_.w - (2 * RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // size std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, (clipRectangle_.h - RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN)), // offset CURSOR_SCROLL_D); // (hover) cursor graphic // lower right RPG_Graphics_HotSpot::initialize(*this, // parent std::make_pair(RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN, RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), // size std::make_pair((clipRectangle_.w - RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN), (clipRectangle_.h - RPG_GRAPHICS_WINDOW_HOTSPOT_SCROLL_MARGIN)), // offset CURSOR_SCROLL_DR); // (hover) cursor graphic}
开发者ID:bhutnath,项目名称:yarp,代码行数:72,
示例5: ACE_ERROR_RETURNintbe_visitor_operation_ch::visit_operation (be_operation *node){ TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); *os << be_nl_2; // STEP I: generate the return type. be_type *bt = be_type::narrow_from_decl (node->return_type ()); if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("be_visitor_operation_ch::") ACE_TEXT ("visit_operation - ") ACE_TEXT ("Bad return type/n")), -1); } //Only if we are generating exec header file, generate DOxygen documentation if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_EXH) { if (this->void_return_type (bt)) { *os << "/// Setter for " << node->local_name() << " attribute" << be_nl << "/// @param[in] " << node->local_name() << " - New value for " << node->local_name() << " attribute" << be_nl; } else { *os << "/// Getter for " << node->local_name() << " attribute" << be_nl << "/// @return value of " << node->local_name() << " attribute" << be_nl; } } *os << "virtual "; // Grab the right visitor to generate the return type. be_visitor_context ctx (*this->ctx_); be_visitor_operation_rettype or_visitor (&ctx); if (bt->accept (&or_visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_operation_ch::" "visit_operation - " "codegen for return type failed/n"), -1); } // STEP 2: generate the operation name. The port prefix should // be an empty string except for operations from attributes // defined in a porttype. *os << " " << node->local_name (); // STEP 3: generate the argument list with the appropriate mapping. For these // we grab a visitor that generates the parameter listing. ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH); be_visitor_operation_arglist oa_visitor (&ctx); if (node->accept (&oa_visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_operation_ch::" "visit_operation - " "codegen for argument list failed/n"), -1); } be_interface *intf = be_interface::narrow_from_scope (node->defined_in ()); /// If we are in a reply handler, are not an excep_* operation, /// and have no native args, then generate the AMI static /// reply stub declaration. if (intf != 0 && intf->is_ami_rh () && !node->is_excep_ami () && !node->has_native ()) { *os << be_nl_2 << "static void" << be_nl << node->local_name () << "_reply_stub (" << be_idt_nl << "TAO_InputCDR &_tao_reply_cdr," << be_nl << "::Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl << "::CORBA::ULong reply_status);" << be_uidt; } return 0;}
开发者ID:asdlei00,项目名称:ACE,代码行数:94,
示例6: ACE_TEXT#include "test_config.h"#include "Cfg.h"#include "PSession.h"#include "ace/INET_Addr.h"//#include "ace/Countdown_Time.h"#include "Asynch_RW.h"static TestCfg cfg;static ACE_TCHAR complete_message[] = ACE_TEXT ("GET / HTTP/1.1/r/n") ACE_TEXT ("Accept: */*/r/n") ACE_TEXT ("Accept-Language: C++/r/n") ACE_TEXT ("Accept-Encoding: gzip, deflate/r/n") ACE_TEXT ("User-Agent: P_Test /1.0 (non-compatible)/r/n") ACE_TEXT ("Connection: Keep-Alive/r/n") ACE_TEXT ("/r/n");#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)template class TRB_Asynch_Acceptor<PSession>;template class TRB_Asynch_Connector<PSession>;template class TRB_Asynch_RW<TRB_Asynch_Read_Stream,TRB_Asynch_Write_Stream>;template class TRB_Asynch_RW_Stream<TRB_Asynch_Read_Stream,TRB_Asynch_Write_Stream>;
开发者ID:binghuo365,项目名称:BaseLab,代码行数:29,
示例7: get_name // Virtual from PSession virtual const ACE_TCHAR * get_name (void) const { return ACE_TEXT("Sender"); }
开发者ID:binghuo365,项目名称:BaseLab,代码行数:5,
示例8: aiowaitintACE_SUN_Proactor::handle_events_i (ACE_Time_Value *delta){ int retval = 0; aio_result_t *result = 0; if (0 == delta) { if (this->num_started_aio_ == 0) this->wait_for_start (0); result = aiowait (0); } else { if (this->num_started_aio_ == 0) { // Decrement delta with the amount of time spent waiting ACE_Countdown_Time countdown (delta); ACE_Time_Value tv (*delta); tv += ACE_OS::gettimeofday (); if (this->wait_for_start (&tv) == -1) return -1; } struct timeval delta_tv = *delta; result = aiowait (&delta_tv); } if (result == 0) { // timeout, do nothing, // we should process "post_completed" queue } else if (reinterpret_cast<long> (result) == -1) { // Check errno for EINVAL,EAGAIN,EINTR ?? switch (errno) { case EINTR : // aiowait() was interrupted by a signal. case EINVAL: // there are no outstanding asynchronous I/O requests. break; // we should process "post_completed" queue default: // EFAULT ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%N:%l:(%P | %t)::%p /nNumAIO=%d/n"), ACE_TEXT("ACE_SUN_Proactor::handle_events: aiowait failed"), num_started_aio_), -1); } } else { int error_status = 0; size_t transfer_count = 0; ACE_POSIX_Asynch_Result *asynch_result = find_completed_aio (result, error_status, transfer_count); if (asynch_result != 0) { // Call the application code. this->application_specific_code (asynch_result, transfer_count, 0, // No completion key. error_status); // Error retval++; } } // process post_completed results retval += this->process_result_queue (); return retval > 0 ? 1 : 0 ;}
开发者ID:AdrElecTro,项目名称:CactusEMU,代码行数:77,
示例9: ACE_TEXT#include "../Scheduler.h"#include "tao/RTScheduling/RTScheduler_Manager.h"#include "testC.h"#include "ace/Get_Opt.h"#include "ace/SString.h"ACE_TString ior = ACE_TEXT("file://test.ior");intparse_args (int argc, ACE_TCHAR* argv []){ // Parse command line arguments ACE_Get_Opt opts (argc, argv, ACE_TEXT("f:")); int c; while ((c= opts ()) != -1) { switch (c) { case 'f': ior = ACE_TEXT("file://"); ior += opts.opt_arg (); break; default: ACE_DEBUG ((LM_DEBUG, "Unknown Option/n")); return -1; } } return 0;}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:31,
示例10: ACE_REGISTRY_CALL_RETURN// of Win32 Reg*() functions#define ACE_REGISTRY_CALL_RETURN(X) / do { / if (X != ERROR_SUCCESS) / { / errno = X; / return -1; / } / else / return 0; / } while (0)ACE_BEGIN_VERSIONED_NAMESPACE_DECLACE_TCHAR const ACE_Registry::STRING_SEPARATOR[] = ACE_TEXT ("//");boolACE_Registry::Name_Component::operator== (const Name_Component &rhs) const{ return rhs.id_ == this->id_ && rhs.kind_ == this->kind_;}boolACE_Registry::Name_Component::operator!= (const Name_Component &rhs) const{ return !this->operator== (rhs);}
开发者ID:CCJY,项目名称:ACE,代码行数:30,
示例11: search_addrintACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::find_or_create_svc_handler_i(SVC_HANDLER *&sh, const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, std::pair<SVC_HANDLER *, ATTRIBUTES> > *&entry, int &found){ REFCOUNTED_HASH_RECYCLABLE_ADDRESS search_addr (remote_addr); // Try to find the address in the cache. Only if we don't find it // do we create a new <SVC_HANDLER> and connect it with the server. while (this->find (search_addr, entry) != -1) { // We found a cached svc_handler. // Get the cached <svc_handler> sh = entry->int_id_.first (); // Is the connection clean? int state_result= ACE::handle_ready (sh->peer ().get_handle (), &ACE_Time_Value::zero, 1, // read ready 0, // write ready 1);// exception ready if (state_result == 1) { // The connection was disconnected during idle. // close the svc_handler down. if (sh->close () == -1) { ACE_ASSERT (0); return -1; } sh = 0; // and rotate once more... } else if ((state_result == -1) && (errno == ETIME)) { // Found!!! // Set the flag found = 1; // Tell the <svc_handler> that it should prepare itself for // being recycled. if (this->prepare_for_recycling (sh) == -1) { ACE_ASSERT (0); return -1; } return 0; } else // some other return value or error... { ACE_ASSERT (0); // just to see it coming ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%t)ACE_Bounded_Cached_Connect_Strategy<>::") ACE_TEXT ("find_or_create_svc_handler_i - ") ACE_TEXT ("error polling server socket state./n"))); return -1; } } // Not found... // Set the flag found = 0; // Check the limit of handlers... if ((this->max_size_ > 0) && (this->connection_cache_.current_size () >= this->max_size_)) { // Try to purge idle connections if (this->purge_connections () == -1) return -1; // Check limit again. if (this->connection_cache_.current_size () >= this->max_size_) // still too much! return -1; // OK, we have room now... } // We need to use a temporary variable here since we are not // allowed to change <sh> because other threads may use this // when we let go of the lock during the OS level connect. // // Note that making a new svc_handler, connecting remotely, // binding to the map, and assigning of the hint and recycler // should be atomic to the outside world.//.........这里部分代码省略.........
开发者ID:baiyunping333,项目名称:nnt,代码行数:101,
示例12: run_mainintrun_main (int argc, ACE_TCHAR *argv[]){#if defined (ACE_LACKS_FORK) ACE_UNUSED_ARG (argc); ACE_UNUSED_ARG (argv); ACE_START_TEST (ACE_TEXT ("Process_Mutex_Test")); ACE_ERROR ((LM_INFO, ACE_TEXT ("fork is not supported on this platform/n"))); ACE_END_TEST;#else /* ! ACE_LACKS_FORK */ parse_args (argc, argv); // Child process code. if (child_process) { ACE_APPEND_LOG ("Process_Mutex_Test-children"); acquire_release (); ACE_END_LOG; } else { ACE_START_TEST (ACE_TEXT ("Process_Mutex_Test")); ACE_INIT_LOG ("Process_Mutex_Test-children"); ACE_Process_Options options; if (release_mutex == 0) options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT ("Process_Mutex_Test") ACE_PLATFORM_EXE_SUFFIX ACE_TEXT (" -c -n %s -d"), ACE_TEXT_CHAR_TO_TCHAR (mutex_name)); else options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT ("Process_Mutex_Test") ACE_PLATFORM_EXE_SUFFIX ACE_TEXT (" -c -n %s"), ACE_TEXT_CHAR_TO_TCHAR (mutex_name)); // Spawn <n_processes> child processes that will contend for the // lock. ACE_Process children[n_processes]; size_t i; for (i = 0; i < n_processes; i++) { // Spawn the child process. int result = children[i].spawn (options); ACE_ASSERT (result != -1); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Parent spawned child process with pid = %d./n"), children[i].getpid ())); // Give the newly spawned child process a chance to start... // David Levine thinks this sleep() is required because // calling ::waitpid () before a fork'ed child has actually // been created may be a problem on some platforms. It's // not enough for fork() to have returned to the parent. ACE_OS::sleep (1); } for (i = 0; i < n_processes; i++) { ACE_exitcode child_status; // Wait for the child processes we created to exit. ACE_ASSERT (children[i].wait (&child_status) != -1); if (child_status == 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Child %d finished ok/n"), children[i].getpid ())); else ACE_ERROR ((LM_ERROR, ACE_TEXT ("Child %d finished with status %d/n"), children[i].getpid (), child_status)); } ACE_END_TEST; }#endif /* ! ACE_LACKS_FORK */ return 0;}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:86,
示例13: wait_for_matchvoidWriter::write(bool reliable, int num_messages){ DDS::InstanceHandleSeq handles; try { // Block until Subscriber is available wait_for_match(writer1_); wait_for_match(writer2_); ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) Writers matched/n"))); // Write samples Messenger::MessageDataWriter_var message_dw1 = Messenger::MessageDataWriter::_narrow(writer1_); Messenger::MessageDataWriter_var message_dw2 = Messenger::MessageDataWriter::_narrow(writer2_); if (CORBA::is_nil(message_dw1.in())) { ACE_ERROR((LM_ERROR, ACE_TEXT("%N:%l: svc()") ACE_TEXT(" ERROR: _narrow dw1 failed!/n"))); ACE_OS::exit(-1); } if (CORBA::is_nil(message_dw2.in())) { ACE_ERROR((LM_ERROR, ACE_TEXT("%N:%l: svc()") ACE_TEXT(" ERROR: _narrow dw2 failed!/n"))); ACE_OS::exit(-1); } std::ostringstream pid; pid << std::setw(5) << my_pid_; Messenger::Message message1; message1.writer_id = 1; message1.from = "Comic Book Guy 1"; message1.process_id = pid.str().c_str(); message1.text = "Worst. Movie. Ever."; message1.sample_id = 0; Messenger::Message message2 = message1; message2.writer_id = 2; message2.from = "Comic Book Guy 2"; DDS::InstanceHandle_t handle1 = message_dw1->register_instance(message1); DDS::InstanceHandle_t handle2 = message_dw2->register_instance(message2); for (int i = 0; i < num_messages; i++) { // Because the reader does not have infinite buffer space if (!reliable) { ACE_OS::sleep(ACE_Time_Value(0,100000)); } extend_sample(message1); for (CORBA::ULong j = 0; j < message1.data.length(); ++j) { message1.data[j] = j % 256; } ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)%N:%l: Sending Message: process_id = %C ") ACE_TEXT("writer_id = %d ") ACE_TEXT("sample_id = %d ") ACE_TEXT("extra data length = %d/n"), message1.process_id.in(), message1.writer_id, message1.sample_id, message1.data.length())); DDS::ReturnCode_t error; do { error = message_dw1->write(message1, handle1); if (error != DDS::RETCODE_OK) { if (error == DDS::RETCODE_TIMEOUT) { timeout_writes_++; } else { ACE_ERROR((LM_ERROR, ACE_TEXT("%N:%l: svc()") ACE_TEXT(" ERROR: write dw1 returned %d!/n"), error)); } } } while (error == DDS::RETCODE_TIMEOUT); extend_sample(message2); for (CORBA::ULong j = 0; j < message2.data.length(); ++j) { message2.data[j] = 255 - (j % 256); } ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)%N:%l: Sending Message: process_id = %C ") ACE_TEXT("writer_id = %d ") ACE_TEXT("sample_id = %d ") ACE_TEXT("extra data length = %d/n"), message2.process_id.in(), message2.writer_id, message2.sample_id, message2.data.length())); do { error = message_dw2->write(message2, handle2);//.........这里部分代码省略.........
开发者ID:oschwaldp-oci,项目名称:OpenDDS,代码行数:101,
示例14: ACE_TEXTconst ACE_TCHAR *ACE_Proactor::name (void){ return ACE_TEXT ("ACE_Proactor");}
开发者ID:0omega,项目名称:TrinityCore,代码行数:5,
示例15: ACE_TEXT// $Id: server.cpp 91825 2010-09-17 09:10:22Z johnnyw $#include "Service.h"#include "tao/Messaging/Messaging.h"#include "tao/AnyTypeCode/Any.h"#include "ace/Get_Opt.h"#include "ace/OS_NS_stdio.h"const ACE_TCHAR *ior_output_file = ACE_TEXT("test.ior");intparse_args (int argc, ACE_TCHAR *argv[]){ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:")); int c; while ((c = get_opts ()) != -1) switch (c) { case 'o': ior_output_file = get_opts.opt_arg (); break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-o <iorfile>" "/n", argv [0]), -1);
开发者ID:asdlei00,项目名称:ACE,代码行数:31,
示例16: ACE_TRACEintACE_SUN_Proactor::start_aio_i (ACE_POSIX_Asynch_Result *result){ ACE_TRACE ("ACE_SUN_Proactor::start_aio_i"); int ret_val; const ACE_TCHAR *ptype; // ****** from Sun man pages ********************* // Upon completion of the operation both aio_return and aio_errno // are set to reflect the result of the operation. // AIO_INPROGRESS is not a value used by the system // so the client may detect a change in state // by initializing aio_return to this value. result->aio_resultp.aio_return = AIO_INPROGRESS; result->aio_resultp.aio_errno = EINPROGRESS; // Start IO switch (result->aio_lio_opcode) { case LIO_READ : ptype = ACE_TEXT ("read"); ret_val = aioread (result->aio_fildes, (char *) result->aio_buf, result->aio_nbytes, result->aio_offset, SEEK_SET, &result->aio_resultp); break; case LIO_WRITE : ptype = ACE_TEXT ("write"); ret_val = aiowrite (result->aio_fildes, (char *) result->aio_buf, result->aio_nbytes, result->aio_offset, SEEK_SET, &result->aio_resultp); break; default: ptype = ACE_TEXT ("?????"); ret_val = -1; break; } if (ret_val == 0) { this->num_started_aio_++; if (this->num_started_aio_ == 1) // wake up condition this->condition_.broadcast (); } else // if (ret_val == -1) { if (errno == EAGAIN || errno == ENOMEM) // Defer - retry this later. ret_val = 1; else ACE_ERROR ((LM_ERROR, ACE_TEXT ("%N:%l:(%P | %t)::start_aio: aio%s %p/n"), ptype, ACE_TEXT ("queueing failed/n"))); } return ret_val;}
开发者ID:eSDK,项目名称:eSDKClient_Soultion,代码行数:65,
示例17: ACE_TEXT#include "orbsvcs/CosNotifyChannelAdminS.h"#include "orbsvcs/CosNotifyCommC.h"#include "orbsvcs/CosNamingC.h"#include "orbsvcs/TimeBaseC.h"#include "Notify_StructuredPushSupplier.h"#include "goS.h"#include "Notify_Test_Client.h"// ******************************************************************// Data Section// ******************************************************************static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0;static int max_events = 20;static const ACE_TCHAR *ior_output_file = ACE_TEXT ("supplier.ior");static const ACE_TCHAR *notify2ior = ACE_TEXT ("notify2.ior");// ******************************************************************// Subroutine Section// ******************************************************************class sig_i : public POA_sig{public: sig_i(CORBA::ORB_ptr orb) : orb_(orb) , started_(false) { } void go ()
开发者ID:akostrikov,项目名称:ATCD,代码行数:31,
示例18: TAO_EC_Kokyu_Scheduling //Kokyu timeout generator? }#endif return this->TAO_EC_Default_Factory::create_timeout_generator (ec);}TAO_EC_Scheduling_Strategy*TAO_EC_Kokyu_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base* ec){ if (this->scheduling_ == 2) { CORBA::Object_var tmp = ec->scheduler (); RtecScheduler::Scheduler_var scheduler = RtecScheduler::Scheduler::_narrow (tmp.in ()); return new TAO_EC_Kokyu_Scheduling (scheduler.in ()); } return this->TAO_EC_Default_Factory::create_scheduling_strategy (ec);}TAO_END_VERSIONED_NAMESPACE_DECL// ****************************************************************ACE_STATIC_SVC_DEFINE (TAO_EC_Kokyu_Factory, ACE_TEXT ("EC_Factory"), ACE_SVC_OBJ_T, &ACE_SVC_NAME (TAO_EC_Kokyu_Factory), ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, 0)ACE_FACTORY_DEFINE (TAO_RTKokyuEvent, TAO_EC_Kokyu_Factory)
开发者ID:asdlei00,项目名称:ACE,代码行数:30,
示例19: arg_shifterintTAO_EC_Kokyu_Factory::init (int argc, ACE_TCHAR* argv[]){ ACE_Arg_Shifter arg_shifter (argc, argv); while (arg_shifter.is_anything_left ()) { const ACE_TCHAR* arg = arg_shifter.get_current (); if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatching")) == 0) { arg_shifter.consume_arg (); if (arg_shifter.is_parameter_next ()) { const ACE_TCHAR* opt = arg_shifter.get_current (); if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0) { this->dispatching_ = 0; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0) { this->dispatching_ = 1; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("kokyu")) == 0) { this->dispatching_ = 2; } else { ORBSVCS_ERROR ((LM_ERROR, ACE_TEXT("EC_Kokyu_Factory - ") ACE_TEXT("unsupported dispatching <%s>/n"), opt)); } arg_shifter.consume_arg (); } //if Kokyu dispatching - look for sched policy if (this->dispatching_ == 2) { if (arg_shifter.is_parameter_next ()) { const ACE_TCHAR* opt = arg_shifter.get_current (); if (ACE_OS::strcasecmp (opt, ACE_TEXT("SCHED_FIFO")) == 0) { this->disp_sched_policy_ = ACE_SCHED_FIFO; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("SCHED_RR")) == 0) { this->disp_sched_policy_ = ACE_SCHED_RR; } else { this->disp_sched_policy_ = ACE_SCHED_OTHER; } arg_shifter.consume_arg (); if (arg_shifter.is_parameter_next ()) { const ACE_TCHAR* opt = arg_shifter.get_current (); if (ACE_OS::strcasecmp (opt, ACE_TEXT("SYSTEM")) == 0) { this->disp_sched_scope_ = ACE_SCOPE_THREAD; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("PROCESS")) == 0) { this->disp_sched_scope_ = ACE_SCOPE_PROCESS; } arg_shifter.consume_arg (); } } } } else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECFiltering")) == 0) { arg_shifter.consume_arg (); if (arg_shifter.is_parameter_next ()) { const ACE_TCHAR* opt = arg_shifter.get_current (); if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0) { this->filtering_ = 0; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0) { this->filtering_ = 1; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("prefix")) == 0) { this->filtering_ = 2; } else if (ACE_OS::strcasecmp (opt, ACE_TEXT("kokyu")) == 0) { this->filtering_ = 3; } else { ORBSVCS_ERROR ((LM_ERROR,//.........这里部分代码省略.........
开发者ID:asdlei00,项目名称:ACE,代码行数:101,
示例20: run_mainintrun_main (int, ACE_TCHAR *[]){ ACE_START_TEST (ACE_TEXT ("Mem_Map_Test"));#if !defined (ACE_LACKS_MMAP)#if defined (__QNXNTO__) || (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670)) ACE_ERROR ((LM_INFO, ACE_TEXT ("mmap on QNX Neutrino/VxWorks can map only shared memory files/n")));#endif // = Initialize the temporary variable names ACE_TCHAR test_file[MAXPATHLEN + 1]; ACE_TCHAR temp_file1[MAXPATHLEN + 1]; ACE_TCHAR temp_file2[MAXPATHLEN + 1]; // Get the temporary directory // - 18 is for the filenames, ace_mem_map_temp_1 is the longest if (ACE::get_temp_dir (test_file, MAXPATHLEN - 18) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Temporary path too long/n")), -1); // Copy the temp directory to the other variables ACE_OS::strcpy (temp_file1, test_file); ACE_OS::strcpy (temp_file2, test_file); // Add the filenames to the end ACE_OS::strcat (test_file, ACE_TEXT ("ace_mem_map_test")); ACE_OS::strcat (temp_file1, ACE_TEXT ("ace_mem_map_temp_1")); ACE_OS::strcat (temp_file2, ACE_TEXT ("ace_mem_map_temp_2")); // First create a test file to work on if (create_test_file (test_file, LINE_LENGTH, NUM_LINES) != 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Create test file failed/n")), -1); ACE_Mem_Map mmap; // First memory map the test file if (mmap.map (test_file) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%n: %p %s/n%a"), ACE_TEXT ("mmap"), test_file), -1); // Now create a temporary file for intermediate processing#if defined (__QNXNTO__) || (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670)) ACE_Mem_Map mmap_4_open; mmap_4_open.open(temp_file1, O_RDWR | O_TRUNC | O_CREAT, ACE_DEFAULT_FILE_PERMS); ACE_HANDLE temp_file_handle = mmap_4_open.handle();#else ACE_HANDLE temp_file_handle = ACE_OS::open (temp_file1, O_RDWR | O_TRUNC | O_CREAT, ACE_DEFAULT_FILE_PERMS);#endif if (temp_file_handle == ACE_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Open failed/n")), -1); // Reverse the original file and write the output to the temporary // file. reverse_file (temp_file_handle, (char *) mmap.addr (), mmap.size ());#if defined (__QNXNTO__) || (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670)) mmap_4_open.close();#else ACE_OS::close (temp_file_handle);#endif ACE_Mem_Map temp_mmap; // Now memory map the temporary file if (temp_mmap.map (temp_file1) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%n: %p %s/n%a"), ACE_TEXT ("mmap"), temp_file1), -1);#if defined (__QNXNTO__) || (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670)) mmap_4_open.open(temp_file2, O_RDWR | O_TRUNC | O_CREAT, ACE_DEFAULT_FILE_PERMS); temp_file_handle = mmap_4_open.handle();#else temp_file_handle = ACE_OS::open (temp_file2, O_RDWR | O_TRUNC | O_CREAT, ACE_DEFAULT_FILE_PERMS);#endif//.........这里部分代码省略.........
开发者ID:manut,项目名称:ACE,代码行数:101,
示例21: whileintACE_Svc_Conf_Lexer::scan (YYSTYPE* ace_yylval, ACE_Svc_Conf_Param* param){ ace_yy_buffer_state* buffer = param->buffer; // If we are not currently in any state, skip over whitespace if (buffer->state_ == ACE_NO_STATE) { while (buffer->index_ < buffer->size_ && isspace (buffer->input_[buffer->index_])) { // Make sure that we count all of the new lines if (buffer->input_[buffer->index_] == '/n') { ++param->yylineno; } ++buffer->index_; } } size_t current; size_t last = buffer->size_ + (buffer->eof_ ? 1 : 0); for (current = buffer->index_; current < last; current++) { static const char* separators = " /t/r/n:*(){}"; char c = (buffer->eof_ && current == buffer->size_ ? '/n' : buffer->input_[current]); switch (buffer->state_) { case ACE_COMMENT: if (c == '/n') { buffer->state_ = ACE_NO_STATE; buffer->index_ = current + 1; ++param->yylineno; } break; case ACE_STRING: if (!(c >= ' ' && c <= '~')) { // The character at currrent is definitely not part of // the string so we need to move current back one. --current; // Get the starting point of our string (skipping the quote) char* source = buffer->input_ + buffer->index_ + 1; // Now, we need to move back in the string until we find the // same character that started the string bool string_end_found = false; if (current > buffer->index_) { for (size_t i = current - buffer->index_; i-- != 0; ) { if (source[i] == buffer->string_start_) { current = buffer->index_ + i + 1; string_end_found = true; break; } } } if (!string_end_found) { ace_yyerror (++param->yyerrno, param->yylineno, ACE_TEXT ("Unable to find the end of the string")); return ACE_NO_STATE; } size_t amount = (current - buffer->index_) - 1;#if defined (ACE_USES_WCHAR) ACE_TCHAR target[ACE_YY_CONVERSION_SPACE] = ACE_TEXT (""); size_t length = 0; if (!convert_from_utf8 (buffer->converter_, source, amount, target, ACE_YY_CONVERSION_SPACE, length)) { ace_yyerror (++param->yyerrno, param->yylineno, ACE_TEXT ("Unable to convert string from UTF-8")); return ACE_NO_STATE; } amount = length;#else char* target = source;#endif /* ACE_USES_WCHAR */ ace_yylval->ident_ = param->obstack.copy (target, amount); buffer->state_ = ACE_NO_STATE; buffer->index_ = current + 1; return ACE_STRING; } break; case ACE_NO_STATE://.........这里部分代码省略.........
开发者ID:CCJY,项目名称:ACE,代码行数:101,
示例22: create_test_filestatic intcreate_test_file (ACE_TCHAR *filename, int line_length, int num_lines){ char *mybuf = 0; ACE_NEW_RETURN (mybuf, char[line_length + 1], -1); const char *c = ACE_ALPHABET; const char *d = c;#if defined (__QNXNTO__) || (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670)) // For NTO has to applied to open the file, as Mem_Map can map only shared memory ACE_Mem_Map mmap_4_open; mmap_4_open.open (filename, O_RDWR | O_CREAT | O_TRUNC, ACE_DEFAULT_FILE_PERMS); ACE_HANDLE file_handle = mmap_4_open.handle();#else ACE_HANDLE file_handle = ACE_OS::open (filename, O_RDWR | O_CREAT | O_TRUNC, ACE_DEFAULT_FILE_PERMS);#endif if (file_handle == ACE_INVALID_HANDLE) { delete [] mybuf; ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Open failed for %s/n"), filename), -1); } for (int j = 0; j < num_lines; j++) { for (int i = 0; i < line_length; i++) { mybuf[i] = *c; c++; } mybuf[line_length] = '/0'; c = ++d; if (ACE_OS::write (file_handle, mybuf, line_length) != line_length) { delete [] mybuf; ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p (%d) <%s>/n"), ACE_TEXT ("Write to file failed:"), ACE_ERRNO_GET, filename), -1); } if (ACE_OS::write (file_handle, ACE_TEXT ("/n"), 1) != 1) { delete [] mybuf; ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("write to file %s failed/n"), filename), -1); } }#if defined (__QNXNTO__) || (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670)) mmap_4_open.close();#else ACE_OS::close (file_handle);#endif delete [] mybuf; return 0;}
开发者ID:manut,项目名称:ACE,代码行数:68,
示例23: ACE_GUARD_RETURNintTAO::PG_Object_Group::set_primary_member ( TAO_IOP::TAO_IOR_Property * prop, const PortableGroup::Location & the_location){ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0); int result = 1; MemberInfo * info = 0; if (this->members_.find (the_location, info) == 0) { int cleared = 0; this->primary_location_ = the_location; for (MemberMap_Iterator it = this->members_.begin (); !cleared && it != this->members_.end (); ++it) { cleared = (*it).int_id_->is_primary_; (*it).int_id_->is_primary_ = 0; } info->is_primary_ = 1; int set_ok = this->manipulator_.set_primary (prop, this->reference_.in (), info->member_.in ()); if (!set_ok) { if (TAO_debug_level > 3) { ORBSVCS_ERROR ((LM_ERROR, ACE_TEXT ("%T %n (%P|%t) - ") ACE_TEXT ("Can't set primary in IOGR ./n") )); }//@@: ACE_THROW (FT::PrimaryNotSet()); result = 0; } if (result && this->increment_version ()) { this->distribute_iogr (); } else { if (TAO_debug_level > 3) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT("TAO-PG (%P|%t) - set_primary_location ") ACE_TEXT("throwing PrimaryNotSet because increment") ACE_TEXT("version failed./n") )); }//@@: ACE_THROW (FT::PrimaryNotSet()); result = 0; } } else { if (TAO_debug_level > 3) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO-PG (%P|%t) - set_primary_location ") ACE_TEXT ("throwing MemberNotFound./n"))); } throw PortableGroup::MemberNotFound(); } return result;}
开发者ID:bjovke,项目名称:ACE_TAO,代码行数:72,
示例24: ACE_ERRORvoid qlTimeSeriesDataReaderListenerImpl::on_dds_exception( DDS::DataReader_ptr reader, CORBA::Exception& exp ){ ACE_ERROR((LM_WARNING, ACE_TEXT("(%P|%t) WARNING: ") ACE_TEXT("qlTimeSeriesDataReaderListenerImpl::on_dds_reading_error %s/n"), exp._info().c_str() ));}
开发者ID:Fantasticer,项目名称:qldds,代码行数:6,
注:本文中的ACE_TEXT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACE_TEXT_ALWAYS_CHAR函数代码示例 C++ ACE_TEST_ASSERT函数代码示例 |