• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ACE_DEBUG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ACE_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ ACE_DEBUG函数的具体用法?C++ ACE_DEBUG怎么用?C++ ACE_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ACE_DEBUG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: RPG_TRACE

void
RPG_Graphics_Cursor_Manager::setCursor(const RPG_Graphics_Cursor& type_in,
                                       SDL_Rect& dirtyRegion_out,
                                       const bool& lockedAccess_in)
{
  RPG_TRACE(ACE_TEXT("RPG_Graphics_Cursor_Manager::setCursor"));

  // step0: init return value(s)
  ACE_OS::memset(&dirtyRegion_out, 0, sizeof(dirtyRegion_out));

  // step1: load graphic (check cache first)
  RPG_Graphics_Cursor_CacheConstIterator_t iterator = myCache.find(type_in);
  if (iterator != myCache.end())
    myCurrentGraphic = (*iterator).second;
  else
  {
    // not in cache --> (try to) load graphic
    RPG_Graphics_GraphicTypeUnion type;
    type.discriminator = RPG_Graphics_GraphicTypeUnion::CURSOR;
    type.cursor = type_in;
    RPG_Graphics_t graphic;
    graphic.category = RPG_GRAPHICS_CATEGORY_INVALID;
    graphic.type.discriminator = RPG_Graphics_GraphicTypeUnion::INVALID;
    // retrieve properties from the dictionary
    graphic = RPG_GRAPHICS_DICTIONARY_SINGLETON::instance()->get(type);
    ACE_ASSERT((graphic.type.cursor == type_in) &&
               (graphic.type.discriminator == RPG_Graphics_GraphicTypeUnion::CURSOR));
    // sanity check
    if (graphic.category != CATEGORY_CURSOR)
    {
      ACE_DEBUG((LM_ERROR,
                 ACE_TEXT("invalid category (was: \"%s\"): \"%s\" not a cursor type, aborting\n"),
                 ACE_TEXT(RPG_Graphics_CategoryHelper::RPG_Graphics_CategoryToString(graphic.category).c_str()),
                 ACE_TEXT(RPG_Graphics_CursorHelper::RPG_Graphics_CursorToString(type_in).c_str())));

      return;
    } // end IF

    // assemble path
    std::string filename;
    RPG_Graphics_Common_Tools::graphicToFile(graphic, filename);
    ACE_ASSERT(!filename.empty());

    // load file
    myCurrentGraphic = NULL;
    myCurrentGraphic = RPG_Graphics_Surface::load(filename, // file
                                                  true);    // convert to display format
    if (!myCurrentGraphic)
    {
      ACE_DEBUG((LM_ERROR,
                 ACE_TEXT("failed to RPG_Graphics_Surface::load(\"%s\"), aborting\n"),
                 ACE_TEXT(filename.c_str())));

      return;
    } // end IF

    // update cache
    myCache.insert(std::make_pair(type_in, myCurrentGraphic));

    iterator = myCache.find(type_in);
    ACE_ASSERT(iterator != myCache.end());
  } // end ELSE

  // step1: restore old background
  if (myScreenLock && lockedAccess_in)
    myScreenLock->lock();
  restoreBG(dirtyRegion_out,
            NULL,
            false);
  if (myScreenLock && lockedAccess_in)
    myScreenLock->unlock();

  // step2: create background surface
  if (myBG)
  {
    SDL_FreeSurface(myBG);
    myBG = NULL;
  } // end IF
  myBG = RPG_Graphics_Surface::create((*iterator).second->w,
                                      (*iterator).second->h);
  if (!myBG)
  {
    ACE_DEBUG((LM_ERROR,
                ACE_TEXT("failed to RPG_Graphics_Surface::create(%u,%u), aborting\n"),
                (*iterator).second->w, (*iterator).second->h));

    return;
  } // end IF
  myBGPosition = std::make_pair(std::numeric_limits<unsigned int>::max(),
                                std::numeric_limits<unsigned int>::max());

//     ACE_DEBUG((LM_DEBUG,
//                ACE_TEXT("set cursor to: \"%s\"\n"),
//                ACE_TEXT(RPG_Graphics_TypeHelper::RPG_Graphics_TypeToString(type_in).c_str())));

  myCurrentType = type_in;
}
开发者ID:bhutnath,项目名称:yarp,代码行数:97,代码来源:rpg_graphics_cursor_manager.cpp


示例2: ACE_DEBUG

//
// init
//
int Tena_Data_Channel_Subscriber::init (int argc, ACE_TCHAR * argv [])
{
  try
  {
    // Parse the configuration and initialize the TENA middleware.
    this->config_.parse (argc, argv);
    this->runtime_ = TENA::Middleware::init (this->config_.tenaConfiguration ());

    // Extract the current settings from the configuration.
    std::string channel = this->config_["channelName"].getValue <std::string> ().c_str ();
    TENA::uint32 verbosity = this->config_["verbosity"].getValue <TENA::uint32>();
    bool self_reflection = this->config_["enableSelfReflection"].getValue< bool >();
    bool want_pruning = this->config_["pruneExpiredStateChange"].getValue< bool >();

    TENA::Middleware::CommunicationProperties
      communication_properties = this->config_["bestEffort"].isSet() ?
      TENA::Middleware::BestEffort : TENA::Middleware::Reliable;

    // Extract the endpoint and join the specified TENA execution.
    TENA::Middleware::Endpoint endpoint = this->config_["emEndpoint"].getValue <TENA::Middleware::Endpoint> ();
    this->execution_ = this->runtime_->joinExecution (endpoint);

    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("%T (%t) - %M - joining execution %s\n"),
                endpoint.toString ().c_str ()));

    // Extract the session from the configuration. We are going to
    // use this to determine what session we should join.
    std::string session = this->config_["sessionName"].getValue <std::string> ().c_str ();
    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("%T (%t) - %M - joining session %s\n"),
                session.c_str ()));

    this->session_ = this->execution_->createSession (session);

    // Create a new data channel subscription pointer. We are then
    // going to subscribe, but we do not allow self-reflection (i.e.,
    // we can't receive our own objects) since it does not make sense
    // in this case.
    this->data_subscription_.reset (new OASIS::Middleware::DataChannel::Subscription ());
    this->registration_subscription_.reset (new OASIS::Middleware::RegistrationChannel::Subscription ());

    // Create the observer and add it to the subscription(s).
    Einode_Observer * observer = new Einode_Observer (*this);
    this->observer_.reset (observer);

    this->registration_subscription_->addObserver (
      OASIS::Middleware::RegistrationChannel::AbstractObserverPtr (observer));

    OASIS::Middleware::RegistrationChannel::subscribe (*this->session_,
                                                       this->registration_subscription_,
                                                       false);

    this->data_subscription_->addObserver (
      OASIS::Middleware::DataChannel::AbstractObserverPtr (observer));

    OASIS::Middleware::DataChannel::subscribe (*this->session_,
                                               this->data_subscription_,
                                               false);

    // We can now start listening for callbacks.
    this->task_.reset (this->session_);
    this->task_.activate ();

    return 0;
  }
  catch (const TENA::Middleware::ConfigurationError & ex)
  {
    std::cerr << "Configuration Error: \n" << ex.what() << std::endl;
    ACE_ERROR ((LM_ERROR,
                ACE_TEXT ("%T (%t) - %M - Configuration Error: %s\n"),
                ex.what ()));
  }
  catch (const std::exception & ex)
  {
    ACE_ERROR ((LM_ERROR,
                ACE_TEXT ("%T (%t) - %M - Error: Exception raised: %s\n"),
                ex.what ()));
  }
  catch (...)
  {
    ACE_ERROR ((LM_ERROR,
                ACE_TEXT ("%T (%t) - %M - caught unknown exception\n")));
  }

  return -1;
}
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:90,代码来源:Data_Channel_Subscriber.cpp


示例3: ACE_ERROR

void
Receiver_exec_i::ccm_remove (void)
{
    //DDS_Get
    if (!this->getter_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get getter failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get getter passed\n")));
    }
    if (!this->getter_dds_data_reader_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get DDS reader of DDS_Get failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get DDS reader of DDS_Get passed\n")));
    }
    if (!this->getter_reader_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Get failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Get passed\n")));
    }
    if (!this->getter_filter_config_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get filter config of DDS_Get failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get filter config of DDS_Get passed\n")));
    }
    //DDS_Listen
    if (!this->listen_data_control_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get data listen control of DDS_Listen failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get data listen control of DDS_Listen passed\n")));
    }
    if (!this->listen_reader_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Listen failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Listen passed\n")));
    }
    if (!this->listen_dds_data_reader_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get dds reader of DDS_Listen failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get dds reader of DDS_Listen passed\n")));
    }
    if (!this->listen_filter_config_ok_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get filter config of DDS_Listen failed\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get filter config of DDS_Listen passed\n")));
    }
    //Provides
    if (!this->raw_listener_created_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : listener not created\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Listener was created\n")));
    }
    if (!this->listen_port_status_created_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Listen not created\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Listen was created\n")));
    }
    if (!this->get_port_status_created_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Get not created\n")));
    }
    else
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Get was created\n")));
    }
    if (!this->get_status_listener_created_)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : ConnectorStatusListener not created\n")));
    }
    else
    {
//.........这里部分代码省略.........
开发者ID:asdlei00,项目名称:ACE,代码行数:101,代码来源:Event_Connection_Test_Receiver_exec.cpp


示例4: device_factory_init

int KSGateway::setupAllDevices()
{
	DRTPPoolType::SmartObject obj;
	int ret;
	
	ret = device_factory_init(KSG_LOOP_DEV);
	if(ret)
	{
		return -1;
	}
	ACE_DEBUG((LM_INFO,"下载设备参数"));
	obj = KsgGetDrtpPool()->Alloc();
	obj->SetRequestHeader(_configuration._drtpGetDevFuncNo,1);
	obj->AddField(F_LCERT_CODE,_configuration._gwId); // ID
	obj->AddField(F_SCUST_LIMIT2,_configuration._dynaKey.c_str()); // dynamic key
	if(obj->Connect())
	{
		return -1;
	}
	if(obj->SendRequest(3000))
	{
		ACE_DEBUG((LM_ERROR,"下载设备参数失败"));
		return -1;
	}
	else if(obj->GetReturnCode())
	{
		ACE_DEBUG((LM_ERROR,"下载设备参数失败[%s]",obj->GetReturnMsg().c_str()));
		return -1;
	}
	if(obj->HasMoreRecord())
	{
		while(obj->HasMoreRecord())
		{
			ST_PACK * data = obj->GetNextRecord();
			// 获取设备的参数
			NormalDeviceType dt = data->semp;
			std::string devphyid = data->sname;
			std::string ipaddr = data->sname2;
			std::string devname = data->scust_limit; // 设备名称
			std::string vendor = data->sdate0;
			// 连接方式, 默认为 TCP 
			KSGDeviceURL::DevConnType conn_type = static_cast<KSGDeviceURL::DevConnType>(data->lvol5); 			
			char addr[512];
			int devport = data->lvol2;
			try
			{
				ACE_DEBUG((LM_DEBUG,"设备[%d][%s]类型[%s]物理ID[%s]机号[%d]"
					,data->lvol0,devname.c_str(),dt.c_str(),devphyid.c_str(),devport));
				// 设备厂商标识
				DeviceNodeType * device = _devManager->NewDevice(data->lvol0,data->lvol1,vendor,devphyid,dt);
				// 设备地址信息
				if(conn_type == KSGDeviceURL::dctCOM)
					ACE_OS::sprintf(addr,"dev:COM:%s//%[email protected]%s:%d",vendor.c_str()
									,devport,ipaddr.c_str(),data->lvol4);
				else if(conn_type == KSGDeviceURL::dctTCP)
					ACE_OS::sprintf(addr,"dev:TCP:%s//%[email protected]%s:%d",vendor.c_str()
									,devport,ipaddr.c_str(),data->lvol4);
				else if(conn_type == KSGDeviceURL::dctModem)
					ACE_OS::sprintf(addr,"dev:MDM:%s//%[email protected]%s:%d",vendor.c_str()
					,devport,ipaddr.c_str(),data->lvol4);
				else if(conn_type == KSGDeviceURL::dctSubLevel)
					ACE_OS::sprintf(addr,"dev:SUB:%s//%[email protected]",vendor.c_str()
					,devport);
				else
					throw DeviceAddrUrlException();
				device->SetAddrUrl(addr);
				device->set_name(devname);
				device->set_vendor(vendor);
				// 设备机号
				device->SetTermId(data->lvol3);
				device->set_port_count(data->lvol6);
			}
			catch (DeviceIdAlreadyExists&)
			{
				ACE_DEBUG((LM_ERROR,"设备[%d][%s]的已经存在!!!",data->lvol0,devname.c_str()));
				return -1;
			}
			catch(DevTypeNotExists&)
			{
				ACE_DEBUG((LM_ERROR,"设备类型不存在!设备[%d][%s]类型[%s]"
					,data->lvol0,devname.c_str(),dt.c_str()));
				continue;
			}
			catch(DeviceAddrUrlException&)
			{
				ACE_DEBUG((LM_ERROR,"设备的地址信息错误!设备[%d]addr[%s]"
					,data->lvol0,data->vsvarstr0));
				continue;
			}
		}
		ACE_DEBUG((LM_INFO,"共下载[%d]个设备",_devManager->GetDeviceCount()));
		// 将设备按照父ID号进行排序, 
		// 并生成树结构 2006-12-30
		/*
		if(_devManager->Sort())
		{
			return -1;
		}*/
		_devManager->Sort();
	 	
//.........这里部分代码省略.........
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:ksgateway.cpp


示例5: ACE_TMAIN

int
ACE_TMAIN(int, ACE_TCHAR **argv)
{
  int result = 0;

  ACE_TCHAR signum[64];
  ACE_OS::sprintf(signum, ACE_TEXT("%d"), SIGUSR1);

  ACE_ARGV args;
  args.add(argv[0]);
  args.add(ACE_TEXT("-s"));
  args.add(signum);

  ACE_Service_Config &serviceConfig = *ACE_Service_Config::singleton ();

  result = serviceConfig.open (args.argc(),
                               args.argv(),
                               ACE_DEFAULT_LOGGER_KEY,
                               true, // ignore_static_svcs = 1,
                               true, // ignore_default_svc_conf_file = 0,
                               false  // ignore_debug_flag = 0
                               );

  if(0 != result)
    {
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("serviceConfig.open failed\n")));
      return result;
    }
  ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.open done\n")));

  for(int i = 0; i < 5; ++i)
    {
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadOrb ...\n")));
      result = loadOrb(serviceConfig);
      if(0 != result)
        {
          ACE_ERROR ((LM_ERROR, ACE_TEXT ("loadOrb failed\n")));
          return result;
        }
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadOrb done\n")));

      ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadNotify ...\n")));
      result = loadNotify(serviceConfig);
      if(0 != result)
        {
          ACE_ERROR ((LM_ERROR, ACE_TEXT ("loadNotify failed\n")));
          return result;
        }
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadNotify done\n")));

      ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadNotify ...\n")));
      result = unloadNotify(serviceConfig);
      if(0 != result)
        {
          ACE_ERROR ((LM_ERROR, ACE_TEXT ("unloadNotify failed\n")));
          return result;
        }
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadNotify done\n")));

      ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadOrb ...\n")));
      result = unloadOrb(serviceConfig);
      if(0 != result)
        {
          ACE_ERROR ((LM_ERROR, ACE_TEXT ("unloadOrb failed\n")));
          return result;
        }
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadOrb done\n")));
    }

  ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.fini_svcs ...\n")));
  result = serviceConfig.fini_svcs();
  if(0 != result)
    {
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("serviceConfig.fini_svcs failed\n")));
      return result;
    }
  ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.fini_svcs done\n")));

  ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.close ...\n")));
  result = serviceConfig.close();
  if(0 != result)
    {
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("serviceConfig.close failed\n")));
      return result;
    }
  ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.close done\n")));

  return 0;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:89,代码来源:server.cpp


示例6: ACE_DEBUG

void
SubDriver::run()
{
  ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT("(%P|%t) SubDriver::run, ")
              ACE_TEXT(" Wait for %s. \n"),
              pub_id_fname_.c_str ()));

  PublicationIds ids;

  // Wait for the publication id file created by the publisher.
  while (1)
  {
    FILE* fp
      = ACE_OS::fopen (pub_id_fname_.c_str (), ACE_TEXT("r"));
    if (fp == 0)
    {
      ACE_OS::sleep (1);
    }
    else
    {
      // This could be made cleaner  by losing the old C-style I/O.
      ::OpenDDS::DCPS::PublicationId pub_id = OpenDDS::DCPS::GUID_UNKNOWN;
      char charBuffer[64];
      while (fscanf (fp, "%s\n", &charBuffer[0]) != EOF)
      {
        std::stringstream buffer( charBuffer);
        buffer >> pub_id;
        ids.push_back (pub_id);

        std::stringstream idBuffer;
        idBuffer << pub_id;
        ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT("(%P|%t) SubDriver::run, ")
              ACE_TEXT(" Got from %s: pub_id=%C. \n"),
              pub_id_fname_.c_str (),
              buffer.str().c_str()));
      }
      ACE_OS::fclose (fp);
      break;
    }
  }

  CORBA::Object_var object =
    orb_->string_to_object (pub_driver_ior_.c_str ());

  pub_driver_ = ::Test::TestPubDriver::_narrow (object.in ());

  TEST_CHECK (!CORBA::is_nil (pub_driver_.in ()));

  size_t num_publications = ids.size ();

  // Set up the publications.
  OpenDDS::DCPS::AssociationData* publications
    = new OpenDDS::DCPS::AssociationData[num_publications];


  for (size_t i = 0; i < num_publications; i ++)
  {
    publications[i].remote_id_                = ids[i];
    publications[i].remote_data_.transport_id = ALL_TRAFFIC; // TBD later - wrong
    publications[i].remote_data_.publication_transport_priority = 0;

    OpenDDS::DCPS::NetworkAddress network_order_address(this->pub_addr_str_);

    ACE_OutputCDR cdr;
    cdr << network_order_address;
    size_t len = cdr.total_length ();

    publications[i].remote_data_.data
      = OpenDDS::DCPS::TransportInterfaceBLOB
      (len,
      len,
      (CORBA::Octet*)(cdr.buffer ()));
  }

  this->subscriber_.init(ALL_TRAFFIC,
                         this->sub_id_,
                         num_publications,
                         publications,
                         receive_delay_msec_);

  delete [] publications;

  while (this->subscriber_.received_test_message() != num_writes_)
    {
      ACE_OS::sleep(1);
    }

  pub_driver_->shutdown ();

  // Sleep before release transport so the connection will not go away.
  // This would avoid the problem of publisher sendv failure due to lost
  // connection during the shutdown period.
  ACE_OS::sleep (5);

  OpenDDS::DCPS::WriterIdSeq writers;
  writers.length(num_publications);
  for (size_t i = 0; i < num_publications; ++i) {
    writers[i] = ids[i];
//.........这里部分代码省略.........
开发者ID:svn2github,项目名称:OpenDDS,代码行数:101,代码来源:SubDriver.cpp


示例7: loadLocalConfig

int KSGateway::run()
{
	long sleep_time = 0;
	int ret = loadLocalConfig();
	if(ret)
		return ret;
	ret = setupLogSystem();
	if(ret)
		return ret;
	ACE_DEBUG((LM_INFO,"开始启动前置机..."));
	ACE_DEBUG((LM_INFO,"应用服务器[%s:%d]func[%d]",_configuration._drtpSvrIP.c_str()
		,_configuration._drtpSvrPort,_configuration._drtpMainFunc));

	ret = setupDrtpPool();
	if(ret)
	{
		ACE_DEBUG((LM_ERROR,"初始化DRTP连接失败,返回码[%d]",ret));
		return ret;
	}
	
	ret = enroll();
	if(ret)
	{
		ACE_DEBUG((LM_ERROR,"前置机签到失败,错误码[%d]",ret));
		return ret;
	}
	ret = downloadRuntimeParams(&_configuration);
	if(ret)
	{
		ACE_DEBUG((LM_ERROR,"下载运行参数失败,错误码[%d]",ret));
		return ret;
	}
	
	ret = load_vendor_config();
	if(ret)
	{
		return ret;
	}
	// 加载 loop 设备
	/*
	ret = loadLoopDevice();
	if(ret)
	{
		return ret;
	}
	*/

	ret = setupAllDevices();
	if(ret)
	{
		return ret;
	}
	//ACE_DEBUG((LM_INFO,"前置机未加载设备!"));
	loadTaskExecutor();

	_status = stRunning;

	ret = setup_all_proactor_acceptor();

	// 2007-04-19
	// 为防止调度线程在接收任务线程之后启动,当任务队列中只有一条任务的
	// 情况下,可能造成的饥饿死锁,应先启动调度线程。但是这种处理办法并
	// 不是最好的,应该增加信号量来控制任务采集线程晚于调度线程启动.
	ret = start_scheduler_algorithm();
	if(ret)
		return ret;

	ret = startTimeScheduler();
	if(ret)
		return ret;
	
	
	ACE_DEBUG((LM_INFO,"启动前置机成功..."));
	// 进入主循环
	
	int i = 0;
	while(_status == stRunning)
	{
		KSGThreadUtil::Sleep(5000);
		sleep_time += 5000;
		if(sleep_time > 1000 * 60 * 15)
		{
			report_status();
			KSGConfig config;
			config = _configuration;
			if(downloadRuntimeParams(&config) == 0)
			{
				ACE_DEBUG((LM_DEBUG,"更新前置机参数,gwid[%d]",config._gwId));
				_configuration = config;
			}
			sleep_time = 0;
		}
		KSGThreadUtil::yield();
	}
	ACE_DEBUG((LM_INFO,"正在停止前置机..."));
	stop_all_proactor_acceptor();
	SchedulerGroup::Instance().TerminateAll();
	// 使用循环等待方式,控制超时
	/*
	while(_status == stRunning)
//.........这里部分代码省略.........
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:ksgateway.cpp


示例8: test_timed_wait

static void
test_timed_wait (int nesting_level,
                 ACE_TEST_MUTEX *rm)
{
  // Make sure that we're inside of a recursive level.
  if (nesting_level == 0)
    test_timed_wait (nesting_level + 1,
                     rm);
  else
    {
      u_int seed = (u_int) ACE_OS::time (0);

      for (size_t i = 0; i < ACE_MAX_ITERATIONS / 2; i++)
        {
          int result = 0;

          // First attempt to acquire the mutex with a timeout to verify
          // that mutex timeouts are working.

          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("(%P|%t) = trying timed acquire on ")
                      ACE_TEXT ("iteration %d\n"),
                      i));

          ACE_Time_Value delta (1, 0);  // One second timeout
          ACE_Time_Value timeout = ACE_OS::gettimeofday ();
          timeout += delta;  // Must pass absolute time to acquire().

          if (rm->acquire (timeout) != 0)
            {
              if (errno == ETIME)
                ACE_DEBUG ((LM_DEBUG,
                            ACE_TEXT ("(%P|%t) = mutex acquisition ")
                            ACE_TEXT ("timed out\n")));
              else if (errno == ENOTSUP)
                {
#if !defined (ACE_HAS_MUTEX_TIMEOUTS)
                  if (!reported_notsup)
                    {
                      ACE_DEBUG ((LM_INFO,
                                  ACE_TEXT ("(%P|%t) %p, but ACE_HAS_MUTEX_TIMEOUTS is not defined - Ok\n"),
                                  ACE_TEXT ("mutex timed acquire")));
                      reported_notsup = 1;
                    }
#else
                  ACE_DEBUG ((LM_ERROR,
                              ACE_TEXT ("(%P|%t) %p - maybe ACE_HAS_MUTEX_TIMEOUTS should not be defined?\n"),
                              ACE_TEXT ("mutex timed acquire")));
#endif  /* ACE_HAS_MUTEX_TIMEOUTS */
                }
              else
                {
                  ACE_ERROR ((LM_ERROR,
                              ACE_TEXT ("(%P|%t) %p\n%a"),
                              ACE_TEXT ("mutex timeout failed\n")));
                  return;
                }
            }
          else
            {
              result = rm->release ();
              ACE_TEST_ASSERT (result == 0);
            }

          // Now try the standard mutex.

          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("(%P|%t) = trying to acquire on iteration %d\n"),
                      i));
          result = rm->acquire ();
          ACE_TEST_ASSERT (result == 0);
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("(%P|%t) = acquired on iteration %d\n"),
                      i));

          // Sleep for a random amount of time between 0 and 2 seconds.
          // Note that it's ok to use rand() here because we are running
          // within the critical section defined by the Thread_Mutex.
          ACE_OS::sleep (ACE_OS::rand_r (&seed) % 2);

          result = rm->release ();
          ACE_TEST_ASSERT (result == 0);
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("(%P|%t) = released on iteration %d\n"),
                      i));

          // FUZZ: disable check_for_ACE_Guard
          // Basic ACE_Guard usage - automatically acquire the mutex on
          // guard construction and automatically release it on
          // destruction.
          {
            // Construct an ACE_Guard to implicitly acquire the mutex.
            ACE_Guard<ACE_TEST_MUTEX> guard (*rm);
            ACE_TEST_ASSERT (guard.locked () != 0);

            // Perform some operation which might exit the current scope
            // prematurely, e.g. by returning or throwing an exception.
            // ...

            // ACE_Guard object is destroyed when exiting scope and guard
//.........这里部分代码省略.........
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:101,代码来源:Recursive_Mutex_Test.cpp


示例9: test_recursion_depth

static void
test_recursion_depth (int nesting_level,
                      ACE_TEST_MUTEX *rm)
{
  if (nesting_level < n_iterations)
    {
#if !defined (ACE_HAS_WTHREADS)
      // This will work for Windows, too, if ACE_TEST_MUTEX is
      // ACE_Recursive_Thread_Mutex instead of ACE_Process_Mutex.
      if (nesting_level_supported
          && nesting_level != 0
          && nesting_level != rm->get_nesting_level ())
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("(%P|%t) Pre-mutex acquire nesting ")
                      ACE_TEXT ("levels do not match.\n")));
        }
#endif  /* !ACE_HAS_WTHREADS */
      int result = rm->acquire ();
      ACE_TEST_ASSERT (result == 0);
#if !defined (ACE_HAS_WTHREADS)
      if (nesting_level_supported
          && (nesting_level + 1) != rm->get_nesting_level ())
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("(%P|%t) Post-mutex acquire nesting ")
                      ACE_TEXT ("levels do not match.\n")));
        }

      ACE_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("(%P|%t) = acquired, nesting = %d, thread id = %u\n"),
                  rm->get_nesting_level (),
                  rm->get_thread_id ()));
#endif /* !ACE_HAS_WTHREADS */

      test_recursion_depth (nesting_level + 1,
                            rm);

#if !defined (ACE_HAS_WTHREADS)
      if (nesting_level_supported
          && (nesting_level + 1) != rm->get_nesting_level ())
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("(%P|%t) Post recursion nesting ")
                      ACE_TEXT ("levels do not match.\n")));
        }
#endif  /* !ACE_HAS_WTHREADS */
      result = rm->release ();
      ACE_TEST_ASSERT (result == 0);
#if !defined (ACE_HAS_WTHREADS)
      ACE_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("(%P|%t) = released, nesting = %d, thread id = %u\n"),
                  rm->get_nesting_level (),
                  rm->get_thread_id ()));

      if (nesting_level_supported
          && nesting_level != 0
          && nesting_level != rm->get_nesting_level ())
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("(%P|%t) Post-mutex release nesting ")
                      ACE_TEXT ("levels do not match.\n")));
        }
#endif /* !ACE_HAS_WTHREADS */
    }
}
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:66,代码来源:Recursive_Mutex_Test.cpp


示例10: get_BuiltinTopicKey

void DCPS_IR_Domain::publish_publication_bit(DCPS_IR_Publication* publication)
{
#if !defined (DDS_HAS_MINIMUM_BIT)

  if (useBIT_) {

    DCPS_IR_Topic_Description* desc =
      publication->get_topic_description();

    const char* dataTypeName = desc->get_dataTypeName();

    bool isNotBIT =
      ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE) &&
      ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE) &&
      ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE) &&
      ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE);

    if (isNotBIT) {
      try {
        const DDS::DataWriterQos* writerQos = publication->get_datawriter_qos();
        const DDS::PublisherQos* publisherQos = publication->get_publisher_qos();

        DCPS_IR_Topic* topic = publication->get_topic();
        const DDS::TopicQos* topicQos = topic->get_topic_qos();

        DDS::PublicationBuiltinTopicData data;
        get_BuiltinTopicKey(data.key, publication->get_id());
        get_BuiltinTopicKey(data.participant_key,
                            publication->get_participant_id());
        data.topic_name = desc->get_name();
        data.type_name = desc->get_dataTypeName();
        data.durability = writerQos->durability;
        data.durability_service = writerQos->durability_service;
        data.deadline = writerQos->deadline;
        data.latency_budget = writerQos->latency_budget;
        data.liveliness = writerQos->liveliness;
        data.reliability = writerQos->reliability;
        data.lifespan = writerQos->lifespan;
        data.user_data = writerQos->user_data;
        data.ownership = writerQos->ownership;
        data.ownership_strength = writerQos->ownership_strength;
        data.destination_order = writerQos->destination_order;
        data.presentation = publisherQos->presentation;
        data.partition = publisherQos->partition;
        data.topic_data = topicQos->topic_data;
        data.group_data = publisherQos->group_data;

        DDS::InstanceHandle_t handle
        = bitPublicationDataWriter_->register_instance(data);

        publication->set_handle(handle);

        if (OpenDDS::DCPS::DCPS_debug_level > 0) {
          ACE_DEBUG((LM_DEBUG,
                     "(%P|%t) DCPS_IR_Domain::publish_publication_bit: [ %d, 0x%x, 0x%x], handle %d.\n",
                     data.key.value[0], data.key.value[1], data.key.value[2], handle));
        }

        DDS::ReturnCode_t status = bitPublicationDataWriter_->write(data, handle);
        if (status != DDS::RETCODE_OK) {
          ACE_ERROR((LM_ERROR,
                       "(%P|%t) DCPS_IR_Domain::publish_publication_bit: write() status of %d\n",
                       status));
        }

      } catch (const CORBA::Exception& ex) {
        ex._tao_print_exception(
          "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_publication_bit:");
      }

    } else {
      publication->set_bit_status(1);
    }
  }

#else
  ACE_UNUSED_ARG(publication);
#endif // !defined (DDS_HAS_MINIMUM_BIT)

}
开发者ID:tornadoxutao,项目名称:OpenDDS,代码行数:80,代码来源:DCPS_IR_Domain.cpp


示例11: find_topic_description

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::add_topic_i(OpenDDS::DCPS::RepoId& topicId,
                                                       const char * topicName,
                                                       const char * dataTypeName,
                                                       const DDS::TopicQos & qos,
                                                       DCPS_IR_Participant* participantPtr)
{
  DCPS_IR_Topic_Description* description;
  int descriptionLookup = find_topic_description(topicName, dataTypeName, description);

  if (1 == descriptionLookup) {
    topicId = OpenDDS::DCPS::GUID_UNKNOWN;
    return OpenDDS::DCPS::CONFLICTING_TYPENAME;

  } else if (-1 == descriptionLookup) {
    ACE_NEW_RETURN(description,
                   DCPS_IR_Topic_Description(
                     this,
                     topicName,
                     dataTypeName),
                   OpenDDS::DCPS::NOT_FOUND);

    int descriptionAddition = add_topic_description(description);

    if (0 != descriptionAddition) {
      // unable to add the topic
      delete description;
      description = 0;
      topicId = OpenDDS::DCPS::GUID_UNKNOWN;

      if (2 == descriptionAddition) {
        return OpenDDS::DCPS::CONFLICTING_TYPENAME;

      } else {
        return OpenDDS::DCPS::NOT_FOUND;
      }
    }
  }

  DCPS_IR_Topic* topic;
  ACE_NEW_RETURN(topic,
                 DCPS_IR_Topic(
                   topicId,
                   qos,
                   this,
                   participantPtr,
                   description),
                 OpenDDS::DCPS::NOT_FOUND);

  OpenDDS::DCPS::TopicStatus topicStatus = OpenDDS::DCPS::NOT_FOUND;

  switch (description->add_topic(topic)) {
  case 0: {
    switch (participantPtr->add_topic_reference(topic)) {
    case 0: {
      if (OpenDDS::DCPS::DCPS_debug_level > 0) {
        OpenDDS::DCPS::RepoIdConverter converter(topicId);
        ACE_DEBUG((LM_DEBUG,
                   ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_topic_i: ")
                   ACE_TEXT("Domain %d successfully added topic %C ")
                   ACE_TEXT("at 0x%x.\n"),
                   this->id_,
                   std::string(converter).c_str(),
                   topic));
      }

      topicStatus = OpenDDS::DCPS::CREATED;

      // Keep a reference to easily locate the topic by id.
      this->idToTopicMap_[ topicId] = topic;

      // Publish the BIT information
      publish_topic_bit(topic);
    }
    break;

    case 1:

      if (OpenDDS::DCPS::DCPS_debug_level > 0) {
        OpenDDS::DCPS::RepoIdConverter converter(topicId);
        ACE_DEBUG((LM_NOTICE,
                   ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_i: ")
                   ACE_TEXT("Domain %d declined to add duplicate topic %C at 0x%x.\n"),
                   this->id_,
                   std::string(converter).c_str(),
                   topic));
      }

      topicStatus = OpenDDS::DCPS::NOT_FOUND;
      topicId = OpenDDS::DCPS::GUID_UNKNOWN;
      description->remove_topic(topic);
      delete topic;
      break;

    case -1: {
      OpenDDS::DCPS::RepoIdConverter converter(topicId);
      ACE_ERROR((LM_ERROR,
                 ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic_i: ")
                 ACE_TEXT("Domain %d failed to add topic %C at 0x%x.\n"),
                 this->id_,
                 std::string(converter).c_str(),
//.........这里部分代码省略.........
开发者ID:tornadoxutao,项目名称:OpenDDS,代码行数:101,代码来源:DCPS_IR_Domain.cpp


示例12: ACE_TMAIN


//.........这里部分代码省略.........
                          ::DDS::TopicListener::_nil(),
                          ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
      if (CORBA::is_nil (topic.in ()))
      {
        return 1 ;
      }

      ::DDS::TopicDescription_var description =
        dp->lookup_topicdescription(MY_TOPIC);
      if (CORBA::is_nil (description.in ()))
      {
        ACE_ERROR_RETURN ((LM_ERROR,
                           ACE_TEXT("(%P|%t) lookup_topicdescription failed.\n")),
                           1);
      }

      // Create the subscriber
      ::DDS::Subscriber_var sub =
        dp->create_subscriber(SUBSCRIBER_QOS_DEFAULT,
                             ::DDS::SubscriberListener::_nil(),
                             ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
      if (CORBA::is_nil (sub.in ()))
      {
        ACE_ERROR_RETURN ((LM_ERROR,
                           ACE_TEXT("(%P|%t) create_subscriber failed.\n")),
                           1);
      }

      // Create the Datareaders
      ::DDS::DataReaderQos dr_qos;
      sub->get_default_datareader_qos (dr_qos);

      dr_qos.liveliness.lease_duration.sec = LEASE_DURATION_SEC;
      dr_qos.liveliness.lease_duration.nanosec = 0;

      ::DDS::DataReaderListener_var drl (new DataReaderListenerImpl);
      DataReaderListenerImpl* drl_servant =
        dynamic_cast<DataReaderListenerImpl*>(drl.in());

      if (!drl_servant) {
        ACE_ERROR_RETURN((LM_ERROR,
          ACE_TEXT("%N:%l main()")
          ACE_TEXT(" ERROR: drl_servant is nil (dynamic_cast failed)!\n")), -1);
      }

      ::DDS::DataReader_var dr ;

      dr = sub->create_datareader(description.in (),
                                  dr_qos,
                                  drl.in (),
                                  ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);

      ACE_OS::sleep(test_duration);

      // clean up subscriber objects


      sub->delete_contained_entities() ;

      dp->delete_subscriber(sub.in ());

      dp->delete_topic(topic.in ());
      dpf->delete_participant(dp.in ());

      TheServiceParticipant->shutdown ();

      if( drl_servant->deadline_missed() < threshold_liveliness_lost) {
        ACE_ERROR((LM_ERROR,
          ACE_TEXT("(%P|%t) subscriber: ")
          ACE_TEXT("liviness deadline not violated enough for test. ")
          ACE_TEXT("Got %d, expected at least %d.\n"),
          drl_servant->deadline_missed(),
          threshold_liveliness_lost
        ));
        return 1;

      } else {
        ACE_DEBUG((LM_INFO,
          ACE_TEXT("(%P|%t) subscriber: ")
          ACE_TEXT("liviness deadline violated enough for test. ")
          ACE_TEXT("Got %d, expected at least %d.\n"),
          drl_servant->deadline_missed(),
          threshold_liveliness_lost
        ));
      }
    }
  catch (const TestException&)
    {
      ACE_ERROR ((LM_ERROR,
                  ACE_TEXT("(%P|%t) TestException caught in main.cpp. ")));
      return 1;
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("Exception caught in main.cpp:");
      return 1;
    }

  return status;
}
开发者ID:oschwaldp-oci,项目名称:OpenDDS,代码行数:101,代码来源:subscriber.cpp


示例13: ACE_TMAIN

int ACE_TMAIN (int,ACE_TCHAR**)
{
  Kokyu::DSRT_ConfigInfo config_info;

  //  config_info.scheduler_type_ = Kokyu::SCHED_MIF;
  config_info.impl_type_ = Kokyu::DSRT_OS_BASED;

  ACE_Barrier bar (3);

  ACE_DEBUG ((LM_DEBUG, "before create_dispatcher\n" ));

  config_info.sched_strategy_ = Kokyu::DSRT_MIF;

  Kokyu::DSRT_Dispatcher_Factory<mif_scheduler_traits>::DSRT_Dispatcher_Auto_Ptr
    disp (Kokyu::DSRT_Dispatcher_Factory<mif_scheduler_traits>::
          create_DSRT_dispatcher (config_info));

  ACE_DEBUG ((LM_DEBUG, "after create_dispatcher\n" ));

  ACE_ASSERT (disp.get () != 0);

  mif_scheduler_traits::QoSDescriptor_t qos1, qos2, qos3;

  qos1.importance_ = 1;
  qos2.importance_ = 2;
  qos3.importance_ = 3;

  MyTask mytask1 (bar, disp.get (), qos1, 15);
  MyTask mytask2 (bar, disp.get (), qos2, 6);
  MyTask mytask3 (bar, disp.get (), qos3, 4);

  long flags = THR_BOUND | THR_SCHED_FIFO;

  if (mytask1.activate (flags) == -1)
    {
      flags = THR_BOUND;
      if (mytask1.activate (flags) == -1)
        ACE_ERROR ((LM_ERROR,
                        "EC (%P|%t) cannot activate task\n"));
    }

  if (mytask2.activate (flags) == -1)
    {
      flags = THR_BOUND;
      if (mytask2.activate (flags) == -1)
        ACE_ERROR ((LM_ERROR,
                        "EC (%P|%t) cannot activate task\n"));
    }

  if (mytask3.activate (flags) == -1)
    {
      flags = THR_BOUND;
      if (mytask3.activate (flags) == -1)
        ACE_ERROR ((LM_ERROR,
                        "EC (%P|%t) cannot activate task\n"));
    }

  disp->shutdown ();

  ACE_DEBUG ((LM_DEBUG, "main thread exiting\n"));

  return 0;
}
开发者ID:Kintoun,项目名称:POSA,代码行数:63,代码来源:MIF.cpp


示例14: ACE_TMAIN

int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) {
  try
    {
      ACE_DEBUG ((LM_DEBUG, "(%P|%t) publisher main\n"));

      DDS::DomainParticipantFactory_var dpf =
        TheParticipantFactoryWithArgs(argc, argv);

      if (parse_args (argc, argv) == -1) {
        return -1;
      }

      DDS::DomainParticipantQos partQos;
      dpf->get_default_participant_qos(partQos);

      // set up user data in DP qos
      CORBA::ULong part_user_data_len
        = static_cast<CORBA::ULong>(ACE_OS::strlen (PART_USER_DATA));
      partQos.user_data.value.length (part_user_data_len);
      partQos.user_data.value.replace (part_user_data_len,
                                       part_user_data_len,
                                       reinterpret_cast<CORBA::Octet*>(PART_USER_DATA));

      DDS::DomainParticipant_var participant =
        dpf->create_participant(411,
                                partQos,
                                DDS::DomainParticipantListener::_nil(),
                                ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
      if (CORBA::is_nil (participant.in ())) {
        cerr << "publisher: create_participant failed." << endl;
        return 1;
      }

      ::Messenger::MessageTypeSupport_var ts = new ::Messenger::MessageTypeSupportImpl();

      if (DDS::RETCODE_OK != ts->register_type(participant.in (), "Messenger")) {
        cerr << "publisher: register_type failed." << endl;
        exit(1);
      }

      CORBA::String_var type_name = ts->get_type_name ();

      DDS::TopicQos topic_qos;
      participant->get_default_topic_qos(topic_qos);

      // set up topic data in topic qos
      CORBA::ULong topic_data_len = static_cast<CORBA::ULong>(ACE_OS::strlen (TOPIC_DATA));
      topic_qos.topic_data.value.length (topic_data_len);
      topic_qos.topic_data.value.replace (topic_data_len, topic_data_len, reinterpret_cast<CORBA::Octet*>(TOPIC_DATA));

      DDS::Topic_var topic =
        participant->create_topic ("Movie Discussion List",
                                   type_name.in (),
                                   topic_qos,
                                   DDS::TopicListener::_nil(),
                                   ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
      if (CORBA::is_nil (topic.in ())) {
        cerr << "publisher: create_topic failed." << endl;
        exit(1);
      }

      DDS::PublisherQos pub_qos;
      participant->get_default_publisher_qos (pub_qos);

      // set up group data in group qos
      CORBA::ULong group_data_len = static_cast<CORBA::ULong> (ACE_OS::strlen (GROUP_DATA));
      pub_qos.group_data.value.length (group_data_len);
      pub_qos.group_data.value.replace (group_data_len, group_data_len, reinterpret_cast<CORBA::Octet*>(GROUP_DATA));

      DDS::Publisher_var pub =
        participant->create_publisher(pub_qos,
        DDS::PublisherListener::_nil(),
        ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
      if (CORBA::is_nil (pub.in ())) {
        cerr << "publisher: create_publisher failed." << endl;
        exit(1);
      }

      // Create the datawriter
      DDS::DataWriterQos dw_qos;
      pub->get_default_datawriter_qos (dw_qos);
      dw_qos.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
      dw_qos.reliability.kind  = ::DDS::RELIABLE_RELIABILITY_QOS;
      dw_qos.resource_limits.max_samples_per_instance = 1000;
      dw_qos.history.kind  = ::DDS::KEEP_ALL_HISTORY_QOS;

      // set up user data in DW qos
      CORBA::ULong dw_user_data_len = static_cast<CORBA::ULong>(ACE_OS::strlen (DW_USER_DATA));
      dw_qos.user_data.value.length (dw_user_data_len);
      dw_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ACE_ERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ ACE_BIT_ENABLED函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap