本文整理汇总了C++中OBJLIST::find方法的典型用法代码示例。如果您正苦于以下问题:C++ OBJLIST::find方法的具体用法?C++ OBJLIST::find怎么用?C++ OBJLIST::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBJLIST
的用法示例。
在下文中一共展示了OBJLIST::find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getContactCache
CContactCache* CContactCache::getContactCache(HANDLE hContact)
{
CContactCache *cc = arContacts.find((CContactCache*)&hContact);
if (cc == NULL) {
cc = new CContactCache(hContact);
arContacts.insert(cc);
}
return cc;
}
示例2: FindProto
static ProtoInfo* FindProto(const char *proto)
{
ProtoInfo *p = arProtos.find((ProtoInfo*)&proto);
if (p)
return p;
HICON hIcon = LoadSkinnedProtoIcon(proto, ID_STATUS_ONLINE);
if (hIcon == NULL)
return NULL;
HANDLE hImage = ExtraIcon_Add(hIcon);
if (hImage == INVALID_HANDLE_VALUE)
return NULL;
p = new ProtoInfo(proto, hImage);
arProtos.insert(p);
return p;
}
示例3: AddCacheImage
ImageBase* AddCacheImage(const CMString& file, int index)
{
CMString tmpfile(file); tmpfile.AppendFormat(_T("#%d"), index);
unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(TCHAR));
WaitForSingleObject(g_hMutexIm, 3000);
ImageBase srch(id);
ImageBase *img = g_imagecache.find(&srch);
if (img == NULL) {
int ind = file.ReverseFind('.');
if (ind == -1)
return NULL;
CMString ext = file.Mid(ind+1);
ext.MakeLower();
if (ext == _T("dll") || ext == _T("exe"))
img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoDll) : (ImageBase*)new IconType(id, file, index, icoDll);
else if (ext == _T("ico"))
img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, 0, icoFile) : (ImageBase*)new IconType(id, file, 0, icoFile);
else if (ext == _T("icl"))
img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoIcl) : (ImageBase*)new IconType(id, file, index, icoIcl);
else if (ext == _T("gif"))
img = new ImageType(id, file, NULL);
else if (fei == NULL || ext == _T("tif") || ext == _T("tiff"))
img = new ImageType(id, file, NULL);
else
img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, NULL) : (ImageBase*)new ImageFType(id, file);
g_imagecache.insert(img);
if (timerId == 0) {
timerId = 0xffffffff;
CallFunctionAsync(sttMainThreadCallback, NULL);
}
}
else img->AddRef();
ReleaseMutex(g_hMutexIm);
return img;
}
示例4: IsSameTime
MIR_CORE_DLL(HANDLE) TimeZone_CreateByName(LPCTSTR tszName, DWORD dwFlags)
{
if (tszName == NULL)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
if (mir_tstrcmp(myInfo.myTZ.tszName, tszName) == 0)
return (dwFlags & TZF_DIFONLY) ? NULL : &myInfo.myTZ;
MIM_TIMEZONE tzsearch;
tzsearch.hash = mir_hashstrT(tszName);
MIM_TIMEZONE *tz = g_timezones.find(&tzsearch);
if (tz == NULL)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
if (dwFlags & TZF_DIFONLY)
return IsSameTime(tz) ? NULL : tz;
return tz;
}