當前位置: 首頁>>代碼示例>>C++>>正文


C++ ACE_NEW_NORETURN函數代碼示例

本文整理匯總了C++中ACE_NEW_NORETURN函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACE_NEW_NORETURN函數的具體用法?C++ ACE_NEW_NORETURN怎麽用?C++ ACE_NEW_NORETURN使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ACE_NEW_NORETURN函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: proactor

void AIO_Input_Handler::open
  (ACE_HANDLE new_handle, ACE_Message_Block &) {
  reader_.open (*this, new_handle, 0, proactor ());
  ACE_NEW_NORETURN
    (mblk_, ACE_Message_Block (ACE_DEFAULT_CDR_BUFSIZE));
  // Align the Message Block for a CDR stream
  ACE_CDR::mb_align (mblk_);
  reader_.read (*mblk_, LOG_HEADER_SIZE);
}
開發者ID:DOCGroup,項目名稱:ACE_TAO,代碼行數:9,代碼來源:AIO_Client_Logging_Daemon.cpp

示例2: ACE_DEBUG

//***************************************************************************
//
//    Method:          handle_read_file
//
//    Description:   Callback used when a read completes
//
// Inputs:        read file result structure containing message block
//
// Returns:       none
//
//***************************************************************************
void
FileIOHandler::handle_read_file(const ACE_Asynch_Read_File::Result &result)
{
  ACE_Message_Block &mb = result.message_block();
  // If the read failed, queue up another one using the same message block
  if (!result.success() || result.bytes_transferred() == 0)
  {
    //ACE_DEBUG((LM_INFO, ACE_TEXT("FileIOHandler receive timeout.\n")));
    reader_.read(mb,
                 mb.space(),
                 result.offset () + result.bytes_transferred ());
  }
  else
  {
    // We have a message block with some read data in it. Send it onward
    ACE_DEBUG((LM_INFO, ACE_TEXT("FileIOHandler received %d bytes of data at offset %d\n"),
                        result.bytes_transferred(), result.offset ()));

    // TODO: Process this data in some meaningful way
    if (result.offset () != (unsigned long)*reinterpret_cast<unsigned char*> (mb.rd_ptr ()))
    {
      ACE_DEBUG((LM_ERROR, ACE_TEXT("FileIOHandler received incorrect data: got [%u] expected [%u]\n"),
                           *reinterpret_cast<unsigned char*> (mb.rd_ptr ()), result.offset ()));
    }

    // Release the message block when we're done with it
    mb.release();

    if ((result.offset () + result.bytes_transferred ()) < 256)
    {
      // Our processing is done; prime the read process again
      ACE_Message_Block *new_mb;
      ACE_NEW_NORETURN(new_mb, ACE_Message_Block(FILE_FRAME_SIZE));
      if (reader_.read(*new_mb, new_mb->space(),
                       result.offset () + result.bytes_transferred ()) != 0)
      {
        int errnr = ACE_OS::last_error ();
        ACE_DEBUG(
            (LM_INFO, ACE_TEXT("%p [%d]\n"), ACE_TEXT("FileIOHandler continuing read failed"), errnr));
        new_mb->release();
#if defined (ACE_WIN32)
        this->read_pending_ = false;
      }
      else
      {
        this->read_pending_ = true;
#endif
      }
    }
    else
    {
      // we have it all; stop the proactor
      ACE_Proactor::instance ()->proactor_end_event_loop ();
    }
  }
}
開發者ID:esohns,項目名稱:ATCD,代碼行數:67,代碼來源:Proactor_File_Test.cpp

示例3: RPG_TRACE

bool
RPG_Net_Protocol_Module_IRCSplitter::putStatisticsMessage (const RPG_Net_Protocol_RuntimeStatistic& info_in,
                                                           const ACE_Time_Value& collectionTime_in) const
{
  RPG_TRACE (ACE_TEXT ("RPG_Net_Protocol_Module_IRCSplitter::putStatisticsMessage"));

  // step1: initialize session data
  RPG_Net_Protocol_SessionData* data_p = NULL;
  ACE_NEW_NORETURN (data_p,
                    RPG_Net_Protocol_SessionData);
  if (!data_p)
  {
    ACE_DEBUG ((LM_CRITICAL,
                ACE_TEXT ("failed to allocate memory: \"%m\", aborting\n")));
    return false;
  } // end IF
  //ACE_OS::memset (data_p, 0, sizeof (RPG_Net_Protocol_SessionData));
  data_p->currentStatistics = info_in;
  data_p->lastCollectionTimestamp = collectionTime_in;

  // step2: allocate session data container
  RPG_Net_Protocol_StreamSessionData_t* session_data_p = NULL;
  ACE_NEW_NORETURN (session_data_p,
                    RPG_Net_Protocol_StreamSessionData_t (data_p,
                                                          true));
  if (!session_data_p)
  {
    ACE_DEBUG ((LM_CRITICAL,
                ACE_TEXT ("failed to allocate memory: \"%m\", aborting\n")));

    // clean up
    delete data_p;

    return false;
  } // end IF

  // step3: send the data downstream...
  // *NOTE*: "fire-and-forget"-API for session_data_p
  ACE_ASSERT (inherited::state_);
  return inherited::putSessionMessage (SESSION_STATISTICS,
                                       session_data_p,
                                       inherited::allocator_);
}
開發者ID:bhutnath,項目名稱:yarp,代碼行數:43,代碼來源:rpg_net_protocol_module_IRCsplitter.cpp

示例4: ACE_NEW_NORETURN

void ProactorService::PostRecv()
{
	ACE_Message_Block* pBlock;

	ACE_NEW_NORETURN(pBlock, ACE_Message_Block (2048));
	if(this->m_AsyncReader.read(*pBlock, pBlock->space()) != 0)
	{
		pBlock->release();
		ReserveClose();
	}
}
開發者ID:codemaru,項目名稱:CGSF,代碼行數:11,代碼來源:ProactorService.cpp

示例5: create_VTopics_Sender_Impl

  extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_VTopics_Sender_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();
    ACE_NEW_NORETURN (
      retval,
      Sender_exec_i);

    return retval;
  }
開發者ID:CCJY,項目名稱:ATCD,代碼行數:11,代碼來源:VTopics_Sender_exec.cpp

示例6: create_InterInArgsT_Sender_Impl

  extern "C" INTERINARGS_T_SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_InterInArgsT_Sender_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Sender_exec_i);

    return retval;
  }
開發者ID:CCJY,項目名稱:ATCD,代碼行數:12,代碼來源:InterInArgsT_Sender_exec.cpp

示例7: ACE_TRACE

template <ACE_SYNCH_DECL, class TIME_POLICY> int
ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
                                    void *a)
{
  ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::control");
  ACE_IO_Cntl_Msg ioc (cmd);

  ACE_Message_Block *db = 0;

  // Try to create a data block that contains the user-supplied data.
  ACE_NEW_RETURN (db,
                  ACE_Message_Block (sizeof (int),
                                     ACE_Message_Block::MB_IOCTL,
                                     0,
                                     (char *) a),
                  -1);
  // Try to create a control block <cb> that contains the control
  // field and a pointer to the data block <db> in <cb>'s continuation
  // field.
  ACE_Message_Block *cb = 0;

  ACE_NEW_NORETURN (cb,
                    ACE_Message_Block (sizeof ioc,
                                       ACE_Message_Block::MB_IOCTL,
                                       db,
                                       (char *) &ioc));
  // @@ Michael: The old semantic assumed that cb returns == 0
  //             if no memory was available. We will now return immediately
  //             without release (errno is set to ENOMEM by the macro).

  // If we can't allocate <cb> then we need to delete db and return
  // -1.
  if (cb == 0)
    {
      db->release ();
      errno = ENOMEM;
      return -1;
    }

  int result;

  if (this->stream_head_->writer ()->put (cb) == -1)
    result = -1;
  else if (this->stream_head_->reader ()->getq (cb) == -1)
    result = -1;
  else
    result = ((ACE_IO_Cntl_Msg *) cb->rd_ptr ())->rval ();

  // This will also release db if it's reference count == 0.
  cb->release ();

  return result;
}
開發者ID:Adeer,項目名稱:OregonCore,代碼行數:53,代碼來源:Stream.cpp

示例8: create_Shapes_Controller_Impl

  extern "C" CONTROLLER_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_Shapes_Controller_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Controller_exec_i);

    return retval;
  }
開發者ID:Yijtx,項目名稱:ACE,代碼行數:12,代碼來源:Shapes_Controller_exec.cpp

示例9: create_Hello_Sender_comp_Impl

  extern "C" HELLO_SENDER_COMP_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_Hello_Sender_comp_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Sender_comp_exec_i);

    return retval;
  }
開發者ID:bbidulock,項目名稱:Middleware,代碼行數:12,代碼來源:Hello_Sender_comp_exec.cpp

示例10: create_Launch_Failure_Home_Impl

  extern "C" LAUNCH_FAILURE_EXEC_Export ::Components::HomeExecutorBase_ptr
  create_Launch_Failure_Home_Impl (void)
  {
    ::Components::HomeExecutorBase_ptr retval =
      ::Components::HomeExecutorBase::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Launch_Failure_Home_exec_i);

    return retval;
  }
開發者ID:CCJY,項目名稱:ATCD,代碼行數:12,代碼來源:Launch_Failure_exec.cpp

示例11: create_Shapes_Receiver_comp_Impl

extern "C" SHAPES_RECEIVER_COMP_EXEC_Export ::Components::EnterpriseComponent_ptr
create_Shapes_Receiver_comp_Impl (void)
{
    ::Components::EnterpriseComponent_ptr retval =
        ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
        retval,
        Receiver_comp_exec_i);

    return retval;
}
開發者ID:svn2github,項目名稱:ACE-Middleware,代碼行數:12,代碼來源:Shapes_Receiver_comp_exec.cpp

示例12: create_DelReplyH_Receiver_Impl

  extern "C"  ::Components::EnterpriseComponent_ptr
  create_DelReplyH_Receiver_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Receiver_exec_i);

    return retval;
  }
開發者ID:Yijtx,項目名稱:ACE,代碼行數:12,代碼來源:DelReplyH_Receiver_exec.cpp

示例13: create_UsesMulti_Sender_Impl

  extern "C" USESMULTI_SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_UsesMulti_Sender_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Sender_exec_i);

    return retval;
  }
開發者ID:Yijtx,項目名稱:ACE,代碼行數:12,代碼來源:UsesMulti_Sender_exec.cpp

示例14: create_MLD_TypeRegistration_Test_CFTTestComponent_Impl

  extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_MLD_TypeRegistration_Test_CFTTestComponent_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      CFTTestComponent_exec_i);

    return retval;
  }
開發者ID:DOCGroup,項目名稱:CIAO,代碼行數:12,代碼來源:TypeRegistration_Test_Component_exec.cpp

示例15: create_Launch_Failure_Impl

  extern "C" LAUNCH_FAILURE_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_Launch_Failure_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      Launch_Failure_exec_i);

    return retval;
  }
開發者ID:CCJY,項目名稱:ATCD,代碼行數:12,代碼來源:Launch_Failure_exec.cpp


注:本文中的ACE_NEW_NORETURN函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。