当前位置: 首页>>代码示例>>C++>>正文


C++ Raise函数代码示例

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


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

示例1: destroy

		bool Connection::check () {
		
			if (mysql_ping(get())==0) return true;
			
			auto guard=AtExit([&] () {	destroy();	});
			
			auto code=mysql_errno(get());
			if (
				(code==CR_SERVER_GONE_ERROR) ||
				//	The documentation for mysql_ping
				//	explicitly says that it doesn't cause
				//	CR_SERVER_LOST:
				//
				//	http://dev.mysql.com/doc/refman/5.7/en/mysql-ping.html
				//
				//	However, if you manually close all
				//	this data provider's connections on
				//	the server, and then watch as this
				//	function executes in the debugger,
				//	you'll discover that mysql_ping
				//	absolutely does cause CR_SERVER_LOST.
				(code==CR_SERVER_LOST)
			) return false;
			
			Raise();
		
		}
开发者ID:HalfDemon,项目名称:MCPP,代码行数:27,代码来源:connection.cpp

示例2: wxDynamicCast

void XYDialog::OnDrawChange(wxCommandEvent &event) {
	DrawInfo **draw;
	wxButton *button;

	int i = event.GetId() - XY_XAXIS_BUTTON;
	draw = &m_di[i];

	button = wxDynamicCast(FindWindowById(event.GetId()), wxButton);

	if (m_draw_search->ShowModal() == wxID_CANCEL)
		return;
#ifdef __WXMSW__
	//hilarious...
	Raise();
#endif

	long previous = -1;
	DrawInfo *choosen = m_draw_search->GetDrawInfo(&previous);
	if (choosen == NULL)
		return;
	
	*draw = choosen;
	button->SetLabel(choosen->GetName());

}
开发者ID:cyclefusion,项目名称:szarp,代码行数:25,代码来源:xydiag.cpp

示例3: GetFootprintViewerFrame

void CVPCB_MAINFRAME::CreateScreenCmp()
{
    DISPLAY_FOOTPRINTS_FRAME* fpframe = GetFootprintViewerFrame();

    if( !fpframe )
    {
        fpframe = new DISPLAY_FOOTPRINTS_FRAME( &Kiway(), this );
        fpframe->Show( true );
    }
    else
    {
        if( fpframe->IsIconized() )
             fpframe->Iconize( false );

        // The display footprint window might be buried under some other
        // windows, so CreateScreenCmp() on an existing window would not
        // show any difference, leaving the user confused.
        // So we want to put it to front, second after our CVPCB_MAINFRAME.
        // We do this by a little dance of bringing it to front then the main
        // frame back.
        fpframe->Raise();   // Make sure that is visible.
        Raise();            // .. but still we want the focus.
    }

    fpframe->InitDisplay();
}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:26,代码来源:cvpcb_mainframe.cpp

示例4: NyquistEffect

void NyqBench::OnGo(wxCommandEvent & e)
{
   // No need to delete...EffectManager will do it
   mEffect = new NyquistEffect(wxT("Nyquist Effect Workbench"));
   const PluginID & ID = EffectManager::Get().RegisterEffect(mEffect);

   mEffect->SetCommand(mScript->GetValue());
   mEffect->RedirectOutput();

   AudacityProject *p = GetActiveProject();
   wxASSERT(p != NULL);

   if (p) {
      wxWindowDisabler disable(this);
      NyqRedirector redir((NyqTextCtrl *)mOutput);

      mRunning = true;
      UpdateWindowUI();

      p->DoEffect(ID, CommandContext(*p), 0);

      mRunning = false;
      UpdateWindowUI();
   }

   Raise();

   EffectManager::Get().UnregisterEffect(ID);
}
开发者ID:finefin,项目名称:audacity,代码行数:29,代码来源:NyqBench.cpp

示例5: LoadFileInResource

void Data::decompress(int FileID_) {
#ifdef _WIN32
	DWORD size = 0;
#else /*_WIN32*/
	size_t size = 0;
#endif /*_WIN32*/
	const uint8_t* compressedBuf = nullptr;
	int result;
	LoadFileInResource(FileID_, LZMA_STREAM, size, compressedBuf);
	assert(size > 13);
	uint8_t* compressedData = (uint8_t *)malloc(size+1);
	memcpy(compressedData, compressedBuf, size);
	compressedData[size] = 0;
	decompressedSize = *((size_t *)(compressedData+5));
	DecompressedData = (uint8_t *)malloc(decompressedSize);
	result = LzmaUncompress(DecompressedData, &decompressedSize,
		(const uint8_t *)(compressedData+13),
		(SizeT *)&size, (const uint8_t *)compressedData, 5);
	free(compressedData); compressedData = nullptr;
	if (result != SZ_OK) {
		CodeConv::tostringstream o;
		o << _T("LZMAストリームのデコードに失敗しました。ファイルが壊れている虞があります。") <<
			_T("エラーコード: ") << result;
		Raise(EXCEPTION_MJCORE_DECOMPRESSION_FAILURE, o.str().c_str());
	}
	else {
		info(_T("LZMAストリームをデコードしました。"));
	}
	return;
}
开发者ID:wheein,项目名称:MiHaJong,代码行数:30,代码来源:decomp.cpp

示例6: tc3DWindow2

tcGameOutcomePopup::tcGameOutcomePopup(const wxPoint& pos, const wxSize& size)
            : tc3DWindow2(parent, pos, size, "GameOutcome", parent)
{
    SetBaseRenderBin(parent->GetBaseRenderBin() + 10);
    Raise();
    birthCount = tcTime::Get()->Get30HzCount();

    SetBorderDraw(true);

    int w = 70;
    int h = 15;
    int x = (size.GetWidth() - w) / 2;
    int y = size.GetHeight() - 25;
    tcButton* exitButton = new tcButton(this, wxPoint(x - w, y), wxSize(w, h), "XBUTTON");
    exitButton->SetCaption("EXIT GAME");
    exitButton->SetFontSize(fontSize + 2.0f);
    exitButton->SetOffColor(Vec4(0.2f, 0.2f, 0.2f, 0.5f));
    exitButton->SetOverColor(Vec4(0.25f, 0.25f, 0.25f, 0.5f));
    exitButton->SetCommand(86);

    tcButton* continueButton = new tcButton(this, wxPoint(x + w, y), wxSize(w, h), "XBUTTON");
    continueButton->SetCaption("PLAY ON");
    continueButton->SetFontSize(fontSize + 2.0f);
    continueButton->SetOffColor(Vec4(0.2f, 0.2f, 0.2f, 0.5f));
    continueButton->SetOverColor(Vec4(0.25f, 0.25f, 0.25f, 0.5f));
    continueButton->SetCommand(123);

}
开发者ID:WarfareCode,项目名称:gcblue,代码行数:28,代码来源:tcGameOutcomePopup.cpp

示例7: Iconize

void wxZRColaFrame::OnTaskbarIconClick(wxTaskBarIconEvent& event)
{
    Iconize(false);
    Show(true);
    Raise();

    event.Skip();
}
开发者ID:Amebis,项目名称:ZRCola,代码行数:8,代码来源:zrcolafrm.cpp

示例8: Raise

void Console::UnsetHandler () {

    if (!SetConsoleCtrlHandler(
                handler_impl,
                false
            )) Raise();

}
开发者ID:andrewphorn,项目名称:MCPP,代码行数:8,代码来源:console.cpp

示例9: main

int main(void)
{
	int m, n;
	while (scanf("%d%d", &m, &n) == 2) {
		printf("exp: %d\n", Raise(m, n));
	}
	return 0;
}
开发者ID:guoqunabc,项目名称:C-Cplusplus,代码行数:8,代码来源:raise.c

示例10: wxFileDialog

void ABoxDlg::onSelectFile( wxCommandEvent& event ) {
  wxFileDialog* fdlg = new wxFileDialog(this);
  if( fdlg->ShowModal() == wxID_OK ) {
    m_Filename->SetValue(fdlg->GetPath());
  }
  fdlg->Destroy();
  Raise();
}
开发者ID:pmansvelder,项目名称:Rocrail,代码行数:8,代码来源:aboxdlg.cpp

示例11: Raise

bool wxPopupWindow::Show( bool show )
{
    bool ret = wxWindowX11::Show( show );

    Raise();

    return ret;
}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:8,代码来源:popupwin.cpp

示例12: ConnectionFactoryCreate

Connection* ConnectionFactoryCreate(Connection* factory, Address* address, aio4c_socket_t socket) {
    ErrorCode code = AIO4C_ERROR_CODE_INITIALIZER;
    Connection* connection = NULL;
    void* data = NULL;

    connection = NewConnection(factory->pool, address, true);

    connection->socket = socket;

#ifndef AIO4C_WIN32
    if (fcntl(connection->socket, F_SETFL, O_NONBLOCK) == -1) {
        code.error = errno;
        code.connection = connection;
        Raise(AIO4C_LOG_LEVEL_ERROR, AIO4C_CONNECTION_ERROR_TYPE, AIO4C_FCNTL_ERROR, &code);
        shutdown(connection->socket, SHUT_RDWR);
        close(connection->socket);
#else /* AIO4C_WIN32 */
    unsigned long ioctl = 1;
    if (ioctlsocket(connection->socket, FIONBIO, &ioctl) != 0) {
        code.source = AIO4C_ERRNO_SOURCE_WSA;
        code.connection = connection;
        Raise(AIO4C_LOG_LEVEL_ERROR, AIO4C_CONNECTION_ERROR_TYPE, AIO4C_FCNTL_ERROR, &code);
        shutdown(connection->socket, SD_BOTH);
        closesocket(connection->socket);
#endif /* AIO4C_WIN32 */
        aio4c_free(connection);
        return NULL;
    }

    data = factory->dataFactory(connection, factory->dataFactoryArg);

    CopyEventQueue(connection->userHandlers, factory->userHandlers, data);
    CopyEventQueue(connection->systemHandlers, factory->systemHandlers, NULL);

    connection->closedBy[AIO4C_CONNECTION_OWNER_ACCEPTOR] = false;
    connection->closedBy[AIO4C_CONNECTION_OWNER_CLIENT] = true;

    return connection;
}

static void _ConnectionEventHandle(Connection* connection, Event event) {
    Log(AIO4C_LOG_LEVEL_DEBUG, "handling event %d for connection %s", event, connection->string);
    EventHandle(connection->systemHandlers, event, (EventSource)connection);
    EventHandle(connection->userHandlers, event, (EventSource)connection);
}
开发者ID:blakawk,项目名称:Aio4c,代码行数:45,代码来源:connection.c

示例13: get

		void Connection::set (enum mysql_option option, const T & arg) {
		
			if (mysql_options(
				get(),
				option,
				&arg
			)!=0) Raise();
		
		}
开发者ID:HalfDemon,项目名称:MCPP,代码行数:9,代码来源:connection.cpp

示例14: UpdateInterface

 // Updates the controller block interface with this interface_version information
 void UpdateInterface()
 {
     // Nothing here, no interface updating exists yet
     // I hope this doesn't get needed at all :)
     // Here we should update the controller block interface to a newer version to the current in use
     // Maybe we'll not even need to reallocate some memory because CBM_DATA_SIZE is big enought, check data_size
     
     Raise();    // Raise an error, this should never be called for now
 }
开发者ID:MasterHK,项目名称:plugin-sdk,代码行数:10,代码来源:shared.hpp

示例15: do_output

inline void Console::do_output (ConsoleScreenBuffer & buffer) {

    //	The strings to write
    Vector<String> write;
    //	Whether or not we must
    //	lead with a clear
    bool clear=false;

    lock.Execute([&] () mutable {

        for (auto & str : queue) {

            if (str.IsNull()) {

                //	Clear

                clear=true;

                //	Don't even bother
                //	writing out these
                //	lines, they'll just
                //	get immediately cleared
                //	anyway
                write.Clear();

            } else {

                //	A string to write

                write.EmplaceBack(
                    std::move(*str)
                );

            }

        }

        //	We've dequeued everything,
        //	clear the queue
        queue.Clear();

        //	Wake waiting threads
        wait.WakeAll();

        //	Reset event so we don't
        //	loop infinitely
        if (!ResetEvent(queued)) Raise();

    });

    //	Clear console if necessary
    if (clear) buffer.Clear();

    //	Write strings
    buffer.WriteLines(std::move(write));

}
开发者ID:andrewphorn,项目名称:MCPP,代码行数:57,代码来源:console.cpp


注:本文中的Raise函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。