本文整理汇总了C++中HList类的典型用法代码示例。如果您正苦于以下问题:C++ HList类的具体用法?C++ HList怎么用?C++ HList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __mlibc_filelist_get
FILE* __mlibc_filelist_get(void *p, int n)
{
HList<FILE*>* list;
if( p == NULL ) p = __mlibc_filelist_initializer(p);
list = (HList<FILE*>*)p;
if( list->size() <= n ) return NULL;
return list->get(n);
}
示例2: __mlibc_filelist_remove_by_element
int __mlibc_filelist_remove_by_element(void *p, FILE* f)
{
HList<FILE*>* list;
if( p == NULL ) p = __mlibc_filelist_initializer(p);
list = (HList<FILE*>*)p;
if( !list->hasElement(f) ) return 0;
list->remove(f);
return 1;
}
示例3: __mlibc_filelist_remove_by_index
int __mlibc_filelist_remove_by_index(void *p, int n)
{
HList<FILE*>* list;
if( p == NULL ) p = __mlibc_filelist_initializer(p);
list = (HList<FILE*>*)p;
if( list->size() <= n ) return 0;
list->removeAt(n);
return 1;
}
示例4: __mlibc_filelist_add
int __mlibc_filelist_add(void *p, FILE* f)
{
HList<FILE*>* list;
if( p == NULL ) p = __mlibc_filelist_initializer(p);
list = (HList<FILE*>*)p;
if( list->size() >= FOPEN_MAX ) return 0;
list->add(f);
return 1;
}
示例5: DisposeWindowFromThreadID
void DisposeWindowFromThreadID(uint32_t tid)
{
for (int i = 0; i < captures.size(); i++)
{
if (captures[i]->ThreadID == tid)
{
captures.removeAt(i);
i--;
}
}
for (int i = 0; i < windows.size(); i++)
{
guiserver_window* w = windows[i];
if (w->ThreadID == tid)
{
if (prevWindow == w) prevWindow = NULL;
if (activeWindow == w) {
activeWindow = NULL;
// ActivateWindow(NULL);
}
if (w->FormBufferHandle != 0)
{
w->Visible = false;
DrawWindow(w);
}
windows.removeAt(i);
MemoryMap::unmap(w->Handle);
i--;
}
}
if (activeWindow == NULL) ActivateWindow(GetFrontWindow());
}
示例6: DisposeWindow
bool DisposeWindow(uint32_t handle)
{
if (prevWindow != NULL && prevWindow->Handle == handle) prevWindow = NULL;
if (activeWindow != NULL && activeWindow->Handle == handle) ActivateWindow(NULL);
int size_c = captures.size();
for (int i = 0; i < size_c; i++)
{
if (captures[i]->Handle == handle)
{
captures.removeAt(i);
break;
}
}
int size_w = windows.size();
for (int i = 0; i < size_w; i++)
{
guiserver_window* w = windows[i];
if (w->Handle == handle)
{
if (w->__internal2) DestructionEffect(w);
windows.removeAt(i);
MemoryMap::unmap(handle);
if (activeWindow == NULL) ActivateWindow(GetFrontWindow());
return true;
}
}
return false;
}
示例7: GetTargetWindow
guiserver_window* GetTargetWindow(int x, int y)
{
int size = captures.size();
if (size > 0)
{
return captures[size - 1];
}
for (int i = windows.size() - 1; i >= 0; i--)
{
guiserver_window* w = windows[i];
if (w->Parent != 0 || (w->Flags & WINDOWFLAGS_TOPMOST) == 0) continue;
if (IsInWindow(w, x, y)) return w;
}
for (int i = windows.size() - 1; i >= 0; i--)
{
guiserver_window* w = windows[i];
if (w->Parent != 0 || (w->Flags & WINDOWFLAGS_TOPMOST) != 0 || (w->Flags & WINDOWFLAGS_BOTTOMMOST) != 0) continue;
if (IsInWindow(w, x, y)) return w;
}
for (int i = windows.size() - 1; i >= 0; i--)
{
guiserver_window* w = windows[i];
if (w->Parent != 0 || (w->Flags & WINDOWFLAGS_TOPMOST) != 0 || (w->Flags & WINDOWFLAGS_BOTTOMMOST) == 0) continue;
if (IsInWindow(w, x, y)) return w;
}
return NULL;
}
示例8: ActivateWindow
static void ActivateWindow(guiserver_window* w)
{
if (activeWindow != NULL) {
if (Message::send(activeWindow->ThreadID, MSG_GUISERVER_DEACTIVATE, activeWindow->Handle) != M_OK) {
monapi_warn("can't activate window(%x), ignored.", w);
if (w != NULL) {
DisposeWindow(w->Handle);
}
return;
}
}
if (w != NULL) {
if (Message::send(w->ThreadID, MSG_GUISERVER_ACTIVATED, w->Handle) != M_OK) {
DisposeWindow(w->Handle);
monapi_warn("can't activate window(%x), ignored. message failed", w);
return;
}
}
activeWindow = w;
if (w == NULL) return;
windows.remove(w);
windows.add(w);
if (w->Protocol == 0) DrawWindow(w);
}
示例9: registerReceiver
static void registerReceiver(uint32_t tid)
{
int size = receivers.size();
for (int i = 0; i < size; i++)
{
if (receivers[i] == tid) return;
}
receivers.add(tid);
}
示例10: unregisterReceiver
static void unregisterReceiver(uint32_t tid)
{
int size = receivers.size();
for (int i = 0; i < size; i++)
{
if (receivers[i] != tid) continue;
receivers.removeAt(i);
return;
}
}
示例11: sendToClients
void sendToClients(MessageInfo* msg)
{
for (int i = clients_.size() - 1; i >= 0; i--)
{
if (Message::send(clients_[i], msg) != M_OK)
{
monapi_warn("send error to pid = %x", clients_[i]);
uint32_t temp;
clients_.removeAt(i, &temp);
}
}
}
示例12: DisposeBitmap
bool DisposeBitmap(uint32_t handle)
{
int size = bitmaps.size();
for (int i = 0; i < size; i++)
{
if (bitmaps[i]->Handle == handle)
{
bitmaps.removeAt(i);
MemoryMap::unmap(handle);
return true;
}
}
return false;
}
示例13: GetFrontWindow
static guiserver_window* GetFrontWindow()
{
for (int i = windows.size() - 1; i >= 0; i--)
{
guiserver_window* w = windows[i];
if (w->Parent == 0 && (w->Flags & WINDOWFLAGS_BOTTOMMOST) == 0) return w;
}
for (int i = windows.size() - 1; i >= 0; i--)
{
guiserver_window* w = windows[i];
if (w->Parent == 0 && (w->Flags & WINDOWFLAGS_BOTTOMMOST) != 0) return w;
}
return NULL;
}
示例14: ParseConfig
void Monitor::ParseConfig(CString content)
{
_A<CString> lines = content.split_lines();
FOREACH(CString, line, lines)
{
if (!line.startsWith("SERVER=")) continue;
_A<CString> p = line.split("=");
if (p.get_Length() < 2) continue;
CString path = p[p.get_Length() - 1];
_A<CString> q = path.split("/");
CString name = q[q.get_Length() - 1];
this->paths.add(path);
this->servers.add(name);
}
END_FOREACH
alive = new bool[servers.size()];
return;
}
示例15: notifyProcessCreated
void notifyProcessCreated(uint32_t tid, uint32_t parent, const CString& path)
{
int i = 0;
while (i < receivers.size())
{
if (Message::send(receivers[i], MSG_PROCESS_CREATED, tid, parent, 0, path) == M_OK)
{
i++;
}
else
{
_printf("%s: can not connect to %d\n", SVR, receivers[i]);
removeProcessInfo(receivers[i]);
receivers.removeAt(i);
}
}
}