本文整理汇总了C++中IsDefined函数的典型用法代码示例。如果您正苦于以下问题:C++ IsDefined函数的具体用法?C++ IsDefined怎么用?C++ IsDefined使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsDefined函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenRequest
HINTERNET OpenRequest(LPCSTR lpszVerb, LPCSTR lpszObjectName,
LPCSTR lpszVersion, LPCSTR lpszReferer,
LPCSTR *lplpszAcceptTypes,
DWORD dwFlags,
DWORD_PTR dwContext) const {
assert(IsDefined());
return ::HttpOpenRequestA(Get(),
lpszVersion, lpszObjectName,
lpszVersion, lpszReferer,
lplpszAcceptTypes,
dwFlags,
dwContext);
}
示例2: GetScreenPosition
/**
* Returns the position on the screen.
*/
gcc_pure
const PixelRect GetScreenPosition() const
{
assert(IsDefined());
PixelRect rc;
#ifndef USE_WINUSER
rc = GetPosition();
ToScreen(rc);
#else
::GetWindowRect(hWnd, &rc);
#endif
return rc;
}
示例3: assert
//------------------------------------------------------------------------------
void
Canvas::Stretch(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
const Bitmap &_src)
{
#if 0
assert(IsDefined());
assert(_src.IsDefined());
ConstImageBuffer src = _src.GetNative();
Stretch(dest_x, dest_y, dest_width, dest_height,
src, 0, 0, src.width, src.height);
#endif
}
示例4: assert
void
Canvas::Stretch(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
const Bitmap &src,
int src_x, int src_y,
unsigned src_width, unsigned src_height)
{
assert(IsDefined());
assert(src.IsDefined());
Stretch(dest_x, dest_y, dest_width, dest_height,
src.GetNative(),
src_x, src_y, src_width, src_height);
}
示例5: assert
bool
FileDescriptor::CreateEventFD(unsigned initval)
{
assert(!IsDefined());
#ifdef __BIONIC__
/* Bionic provides the eventfd() function only since Android 2.3,
therefore we must roll our own system call here */
fd = syscall(__NR_eventfd2, initval, O_NONBLOCK|O_CLOEXEC);
#else
fd = ::eventfd(initval, EFD_NONBLOCK|EFD_CLOEXEC);
#endif
return fd >= 0;
}
示例6: assert
void
Canvas::Stretch(PixelScalar dest_x, PixelScalar dest_y,
UPixelScalar dest_width, UPixelScalar dest_height,
const Bitmap &src,
PixelScalar src_x, PixelScalar src_y,
UPixelScalar src_width, UPixelScalar src_height,
DWORD dwRop)
{
assert(IsDefined());
assert(src.IsDefined());
Stretch(dest_x, dest_y, dest_width, dest_height,
src.GetNative(), src_x, src_y, src_width, src_height,
dwRop);
}
示例7: assert
void
Pen::Reset()
{
assert(!IsDefined() || IsScreenInitialized());
if (pen != NULL) {
#ifndef NDEBUG
bool success =
#endif
::DeleteObject(pen);
assert(success);
pen = NULL;
}
}
示例8: assert
bool
IOThread::Start()
{
assert(!IsDefined());
assert(loop.IsEmpty());
quit = false;
if (!pipe.Create())
return false;
loop.Add(pipe.GetReadFD(), READ, *this);
return Thread::Start();
}
示例9: assert
bool
IOThread::Start()
{
assert(!IsDefined());
assert(files.empty());
modified = quit = running = false;
if (!pipe.Create())
return false;
poll.SetMask(pipe.GetReadFD(), Poll::READ);
return Thread::Start();
}
示例10: assert
void
DockWindow::SetWidget(Widget *_widget)
{
assert(IsDefined());
assert(widget == nullptr);
widget = _widget;
if (widget != nullptr) {
const PixelRect rc = GetClientRect();
widget->Initialise(*this, rc);
widget->Prepare(*this, rc);
widget->Show(rc);
}
}
示例11: assert
void
Thread::Join()
{
assert(IsDefined());
assert(!IsInside());
#ifdef HAVE_POSIX
pthread_join(handle, NULL);
defined = false;
#else
::WaitForSingleObject(handle, INFINITE);
::CloseHandle(handle);
handle = NULL;
#endif
}
示例12: GetSize
gcc_pure
const PixelSize GetSize() const
{
assert(IsDefined());
#ifdef USE_GDI
PixelRect rc = GetClientRect();
PixelSize s;
s.cx = rc.right;
s.cy = rc.bottom;
return s;
#else
return size;
#endif
}
示例13: assert
void
Brush::Reset()
{
assert(!IsDefined() || IsScreenInitialized());
if (brush != nullptr) {
#ifndef NDEBUG
bool success =
#endif
::DeleteObject(brush);
assert(success);
brush = nullptr;
}
}
示例14: assert
void
StandbyThread::WaitStopped()
{
assert(!IsInside());
assert(mutex.IsLockedByCurrent());
assert(stop);
if (!IsDefined())
/* was never started */
return;
/* mutex must be unlocked because Thread::Join() blocks */
const ScopeUnlock unlock(mutex);
Thread::Join();
}
示例15: assert
void
Canvas::Copy(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
HBITMAP src, int src_x, int src_y,
DWORD dwRop)
{
assert(IsDefined());
assert(src != nullptr);
HDC virtual_dc = GetCompatibleDC();
HBITMAP old = (HBITMAP)::SelectObject(virtual_dc, src);
Copy(dest_x, dest_y, dest_width, dest_height,
virtual_dc, src_x, src_y,
dwRop);
::SelectObject(virtual_dc, old);
}