本文整理汇总了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();
}
示例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());
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例7: Iconize
void wxZRColaFrame::OnTaskbarIconClick(wxTaskBarIconEvent& event)
{
Iconize(false);
Show(true);
Raise();
event.Skip();
}
示例8: Raise
void Console::UnsetHandler () {
if (!SetConsoleCtrlHandler(
handler_impl,
false
)) Raise();
}
示例9: main
int main(void)
{
int m, n;
while (scanf("%d%d", &m, &n) == 2) {
printf("exp: %d\n", Raise(m, n));
}
return 0;
}
示例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();
}
示例11: Raise
bool wxPopupWindow::Show( bool show )
{
bool ret = wxWindowX11::Show( show );
Raise();
return ret;
}
示例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);
}
示例13: get
void Connection::set (enum mysql_option option, const T & arg) {
if (mysql_options(
get(),
option,
&arg
)!=0) Raise();
}
示例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
}
示例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));
}