本文整理汇总了C++中UserData类的典型用法代码示例。如果您正苦于以下问题:C++ UserData类的具体用法?C++ UserData怎么用?C++ UserData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: memset
int Container::insertFileList(FileList *fl,UserData *parent)
{
UserData *ud;
UserData *first;
int i,num_items;
HPOINTER the_icon;
num_items = fl->getNumFiles();
// Build up insertion information
RECORDINSERT ri;
memset(&ri,0,sizeof(RECORDINSERT));
ri.cb = sizeof(RECORDINSERT);
ri.zOrder = CMA_END; // add on top of siblings
// ri.fInvalidateRecord = TRUE; // re-arrange after insert
ri.pRecordParent = (PRECORDCORE)parent; // set tree hierarchy
ri.pRecordOrder = (RECORDCORE*)CMA_END; // add to end of list
if (num_items > 0)
{
ri.cRecordsInsert = num_items; // number of records to insert
first = allocateRecords(num_items);
ud = first;
if (ud)
{
for (i=0; i<num_items; i++)
{
num_objects++;
ud->setName(fl->getFile(i));
the_icon = determineIcon(fl->getFile(i));
ud->setIcons(the_icon,the_icon);
ud->setType(TYPE_FILE);
ud->setParent(parent);
// NEW STUFF
/*
char *kkk = new char[4096];
strcpy(kkk,fl->getBasePath());
strcat(kkk,fl->getFile(i));
the_icon = WinLoadFileIcon(kkk,FALSE);
if (the_icon != NULL)
{
ud->setIcons(the_icon,the_icon);
WinSendMsg(cont,CM_INVALIDATERECORD,MPFROMP(&ud),MPFROM2SHORT(1,CMA_TEXTCHANGED|CMA_REPOSITION));
}
delete[] kkk;
*/
// ENDE NEW STUFF
PRECORDCORE pr = (PRECORDCORE)ud;
ud = (UserData*)pr->preccNextRecord;
}
MRESULT rc = WinSendMsg(cont,CM_INSERTRECORD,MPFROMP((PRECORDCORE)first),MPFROMP(&ri));
return 1;
}
}
return 0;
}
开发者ID:OS2World,项目名称:APP-INTERNET-News-Harvest,代码行数:60,代码来源:container.cpp
示例2: read_user_data
UserData read_user_data(std::istream& is)
{
UserData userData;
userData.setText(read_string(is));
userData.setColor(read32(is));
return userData;
}
开发者ID:4144,项目名称:aseprite,代码行数:7,代码来源:user_data_io.cpp
示例3: getUserContacts
//! Get user contacts in comma separated names' string.
bool StorageServer::getUserContacts( unsigned int userID, int sessionID, std::string& contacts )
{
if ( !_connectionEstablished )
return false;
std::map< int, UserState* >::iterator p_user = _userCache.find( sessionID );
if ( p_user == _userCache.end() )
{
log_warning << "*** StorageServer: request for user contacts cannot be processed, invalid session ID " << sessionID << std::endl;
return false;
}
if ( p_user->second->_userAccount._userID != userID )
{
log_warning << "*** StorageServer: request for user accounts cannot be processed, user / session ID mismatch!" << std::endl;
return false;
}
UserData data;
if ( !_p_storage->getUserData( userID, data ) )
return false;
contacts = data.getContacts();
return true;
}
开发者ID:BackupTheBerlios,项目名称:yag2002-svn,代码行数:27,代码来源:vrc_storageserver.cpp
示例4: debuggerCallback
/**
* Debugger callback that handles events that are necessary for profiling.
**/
int debuggerCallback(void *user_data, int notification_code, va_list va)
{
UserData* userData = (UserData*)user_data;
IdaFile file;
Debugger debugger = file.getDebugger();
if (notification_code == Debugger::EVENT_BREAKPOINT)
{
// Get the Thread ID
thread_id_t tid = va_arg(va, thread_id_t);
// Get the address of where the breakpoint was hit
ea_t addr = va_arg(va, ea_t);
_timeb timebuffer;
_ftime64_s( &timebuffer );
userData->getEventList().addEvent(Event(addr, timebuffer));
debugger.resumeProcess(true);
}
else if (notification_code == Debugger::EVENT_PROCESS_SUSPENDED)
{
setBreakpoints();
msg("Resuming target process...\n");
debugger.resumeProcess(true);
}
else if (notification_code == Debugger::EVENT_PROCESS_EXIT)
{
handleExitProcess(userData);
}
return 0;
}
开发者ID:IDA-RE-things,项目名称:Hotch,代码行数:38,代码来源:hotch.cpp
示例5: push
bool push(const uuid& u) {
State st(state);
UserData ud = st.newUserData<uuid>(std::move(u));
ud.set(uuid_registry_key);
ud.index = 0;
return true;
}
开发者ID:suxue,项目名称:luamm,代码行数:7,代码来源:uuid.cpp
示例6: if
// if container content-object name does not container the cull string
// then cull it.
void Container::filter(char *cull_string)
{
UserData *current;
UserData *first = NULL;
// find the first item (top-level)
current = (UserData*)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(NULL),MPFROM2SHORT(CMA_FIRST,CMA_ITEMORDER));
if (num_objects > 0)
do
{
if (current != NULL)
{
if (!(((PRECORDCORE)current)->flRecordAttr & CRA_FILTERED))
{
if (strstr(current->getName(),cull_string) == NULL)
{
((PRECORDCORE)current)->flRecordAttr |= CRA_FILTERED;
}
else if (first == NULL)
{
first = current;
emphasis(current);
// message("Setting emphasis on %s",current->getName());
}
}
// find all the other servers
current = (UserData*)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(current),MPFROM2SHORT(CMA_NEXT,CMA_ITEMORDER));
}
} while(current != NULL);
}
开发者ID:OS2World,项目名称:APP-INTERNET-News-Harvest,代码行数:35,代码来源:container.cpp
示例7: WinThreadFunction
static DWORD WINAPI WinThreadFunction(LPVOID lpParam)
{
UserData* userData = static_cast<UserData*>(lpParam);
userData->func(userData->param);
return 0;
}
开发者ID:112000,项目名称:opencv,代码行数:8,代码来源:stereo_multi.cpp
示例8: PThreadFunction
static void* PThreadFunction(void* lpParam)
{
UserData* userData = static_cast<UserData*>(lpParam);
userData->func(userData->param);
return 0;
}
开发者ID:112000,项目名称:opencv,代码行数:8,代码来源:stereo_multi.cpp
示例9: strSplit
void CCommandLayer::updateSelectCity(CCity *data)
{
CCSprite *build = (CCSprite*)(m_comLayer->findWidgetById("build"));
CCTexture2D *textTure = CCTextureCache::sharedTextureCache()->addImage(CCString::createWithFormat("command/%d.jpg",data->cityId*10+1)->getCString());
if (textTure)
{
build->setTexture(textTure);
}
CLabel *food = (CLabel*)(m_comLayer->findWidgetById("food"));
food->setString(ToString(data->lvFood));
CLabel *heronum = (CLabel*)(m_comLayer->findWidgetById("heronum"));
heronum->setString(CCString::createWithFormat("%d/%d",data->haveHeroNum,data->heroNum)->getCString());
CLabel *note1 = (CLabel*)(m_comLayer->findWidgetById("func1"));
CLabel *note2 = (CLabel*)(m_comLayer->findWidgetById("func2"));
CCArray *strArr = strSplit(data->note.c_str(),"|");
if (strArr->count()==1)
{
note1->setString(((CCString*)strArr->objectAtIndex(0))->getCString());
note2->setString("");
}
else if (strArr->count()==2)
{
note1->setString(((CCString*)strArr->objectAtIndex(0))->getCString());
note2->setString(((CCString*)strArr->objectAtIndex(1))->getCString());
}
CButton *command = (CButton*)(m_comLayer->findWidgetById("strengthen"));
UserData *user = DataCenter::sharedData()->getUser()->getUserData();
if (data->cityId != m_commandData.cityInfo.cityId)
{
if (user->getRoleFood()>=data->lvFood&&data->level< m_commandData.cityInfo.level)
{
command->setEnabled(true);
}
else
{
command->setEnabled(false);
}
}
else
{
if (user->getRoleFood()>=data->lvFood)
{
command->setEnabled(true);
}
else
{
command->setEnabled(false);
}
}
}
开发者ID:54993306,项目名称:Classes,代码行数:58,代码来源:CommandLayer.cpp
示例10: sRHS
void DC2DT6::BoundaryRHS(UserData<real_t>& ud)
{
_ln->setLocal(-1.0);
sRHS(1) += OFELI_THIRD*_ln->getDet()*ud.SurfaceForce((*_theSide)(1)->getCoord(),_theSide->getCode(1),_time);
_ln->setLocal(0.0);
sRHS(2) += OFELI_THIRD*_ln->getDet()*ud.SurfaceForce((*_theSide)(2)->getCoord(),_theSide->getCode(1),_time);
_ln->setLocal(1.0);
sRHS(3) += 4*OFELI_THIRD*_ln->getDet()*ud.SurfaceForce((*_theSide)(3)->getCoord(),_theSide->getCode(1),_time);
}
开发者ID:rtouzani,项目名称:ofeli,代码行数:9,代码来源:DC2DT6.cpp
示例11: beginInsertRows
void UserModel::addUser(const QString &licensePlateNumber, int parkingSpotNumber)
{
beginInsertRows(QModelIndex(), mUsers.size(), mUsers.size());
UserData userData;
userData.setLicensePlateNumber(licensePlateNumber);
userData.setParkingSpotNumber(parkingSpotNumber);
mUsers.append(userData);
endInsertRows();
}
开发者ID:mitchcurtis,项目名称:payment-terminal,代码行数:9,代码来源:usermodel.cpp
示例12: setProfileName
void IEToolbar::retrieveInitialData() {
const UserData loggedInUser =
UserDataObserver::getInstance().getLoggedInUser();
setProfileName(loggedInUser.getName());
setStatusText(loggedInUser.getStatusMessage());
setPokesCount(UserDataObserver::getInstance().getPokesCount());
setRequestsCount(UserDataObserver::getInstance().getRequestsCount());
setMessagesCount(UserDataObserver::getInstance().getMessagesCount());
setEventInvsCount(UserDataObserver::getInstance().getEventsCount());
setGroupInvsCount(UserDataObserver::getInstance().getGroupsInvsCount());
}
开发者ID:Inzaghi2012,项目名称:ie-toolbar,代码行数:11,代码来源:IEToolbar.cpp
示例13: checkIn
UserData* UserController :: checkIn(std::string ID, std::string passwd)
{
Logging log("UserController :: checkIn",true);
UserData* toReturn = findUser(ID);
if(toReturn)
{
if(toReturn->Password() == passwd)
return toReturn;
else
throw PasswordNotCorrectException((std::string)"password wrong!");
}
else throw ItemNotFoundException((std::string)"user not exist!");
}
开发者ID:OOPtaskgroup,项目名称:dictionary,代码行数:13,代码来源:usercontroller.cpp
示例14: updateActionTime
void CTopLayer::updateActionTime(float dt)
{
UserData *data = DataCenter::sharedData()->getUser()->getUserData();
if (data->getRoleAction() < data->getActionLimit())
{
data->setRoleAction(data->getRoleAction()+1);
CLabel *action = (CLabel*)(m_ui->findWidgetById("action"));
action->setString(CCString::createWithFormat("%d/%d",data->getRoleAction(),data->getActionLimit())->getCString());
data->setActionTime(data->getActionTime() + data->getInterval()*60*60);
}
else
{
this->unschedule(schedule_selector(CTopLayer::updateActionTime));
}
}
开发者ID:54993306,项目名称:Classes,代码行数:15,代码来源:TopLayer.cpp
示例15: new
//ʹÓÃmap³õʼ»¯
UserData* UserData::create(Value& value)
{
UserData* pRet = new(std::nothrow) UserData();
if (pRet && pRet->init(value))
{
pRet->autorelease();
return pRet;
}
else
{
delete pRet;
pRet = NULL;
return NULL;
}
}
开发者ID:lookdczar,项目名称:alfaProDev,代码行数:16,代码来源:UserData.cpp
示例16: switch
void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result) {
const MTPDmessages_chatFull &d(result.c_messages_chatFull());
const MTPDchatFull &f(d.vfull_chat.c_chatFull());
const QVector<MTPChat> &vc(d.vchats.c_vector().v);
bool badVersion = (!vc.isEmpty() && vc.at(0).type() == mtpc_chat && vc.at(0).c_chat().vversion.v < peer->asChat()->version);
App::feedUsers(d.vusers, false);
App::feedChats(d.vchats, false);
App::feedParticipants(f.vparticipants, false, false);
const QVector<MTPBotInfo> &v(f.vbot_info.c_vector().v);
for (QVector<MTPBotInfo>::const_iterator i = v.cbegin(), e = v.cend(); i < e; ++i) {
switch (i->type()) {
case mtpc_botInfo: {
const MTPDbotInfo &b(i->c_botInfo());
UserData *user = App::userLoaded(b.vuser_id.v);
if (user) {
user->setBotInfo(*i);
App::clearPeerUpdated(user);
emit fullPeerUpdated(user);
}
}
break;
}
}
PhotoData *photo = App::feedPhoto(f.vchat_photo);
ChatData *chat = peer->asChat();
if (chat) {
if (photo) {
chat->photoId = photo->id;
photo->chat = chat;
} else {
chat->photoId = 0;
}
chat->invitationUrl = (f.vexported_invite.type() == mtpc_chatInviteExported) ? qs(f.vexported_invite.c_chatInviteExported().vlink) : QString();
}
App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), f.vnotify_settings);
_fullPeerRequests.remove(peer);
if (badVersion) {
peer->asChat()->version = vc.at(0).c_chat().vversion.v;
requestPeer(peer);
}
App::clearPeerUpdated(peer);
emit fullPeerUpdated(peer);
App::emitPeerUpdated();
}
开发者ID:sseshachala,项目名称:tdesktop,代码行数:48,代码来源:apiwrap.cpp
示例17: CCLOG
void CChangeHeadImg::addGridCell(unsigned int uIdx, CGridViewCell* pCell)
{
CLayout *lay = UICloneMgr::cloneLayout(m_cell);
for (int i=1; i<=2; i++)
{
CCNode *child = lay->getChildByTag(i);
lay->removeChild(child);
pCell->addChild(child);
if (i==1)
{
if (m_headIconList.at(uIdx)>0)
{
CImageView* pHead = CImageView::create(CCString::createWithFormat("headImg/%d.png", m_headIconList.at(uIdx))->getCString());
if(!pHead)
{
pHead = CImageView::create("headImg/null.png");
CCLOG("ERROR_____CChangeHeadImg::addGridCell");
}
child->addChild(pHead);
NodeFillParent(pHead);
}
else
{
UserData *data = DataCenter::sharedData()->getUser()->getUserData();
string fbName = data->getFbId() +".jpg";
string fullName = CCFileUtils::sharedFileUtils()->fullPathForFilename(fbName.c_str());
bool isFileExist = CCFileUtils::sharedFileUtils()->isFileExist(fullName);
if(isFileExist)
{
CCSprite* spr =CCSprite::create(fullName.c_str());
child->addChild(spr);
NodeFillParent(spr);
}
}
}
else if(i==2)
{
CImageView* pBtn = (CImageView*)child;
pBtn->setTouchEnabled(true);
pBtn->setUserData(&m_headIconList.at(uIdx));
pBtn->setOnClickListener(this,ccw_click_selector(CChangeHeadImg::onChangHeadImg));
}
}
}
开发者ID:54993306,项目名称:Classes,代码行数:47,代码来源:ChangeHeadImg.cpp
示例18: handleInjectedBundleMessage
void WebProcess::handleInjectedBundleMessage(const String& messageName, const UserData& messageBody)
{
InjectedBundle* injectedBundle = WebProcess::singleton().injectedBundle();
if (!injectedBundle)
return;
injectedBundle->didReceiveMessage(messageName, transformHandlesToObjects(messageBody.object()).get());
}
开发者ID:GaoHuijian,项目名称:webkit,代码行数:8,代码来源:WebProcess.cpp
示例19: onRecvTask
void CHeroExpItem::onRecvTask(CCObject* pSender)
{
CEvolQuest *evol = (CEvolQuest*)((CCNode*)pSender)->getUserData();
UserData *data = DataCenter::sharedData()->getUser()->getUserData();
if (evol->open&&data->getRoleAction()>=evol->action)
{
CPlayerControl::getInstance().sendEnterStage(evol->stageId,0,0,0, 0);
}
else if (!evol->open)
{
ShowPopTextTip(GETLANGSTR(183));
}
else if (data->getRoleAction()<evol->action)
{
ShowPopTextTip(GETLANGSTR(184));
}
}
开发者ID:54993306,项目名称:Classes,代码行数:18,代码来源:HeroExpItem.cpp
示例20: CObject
CLiftableObject::CLiftableObject(Ogre::SceneNode *pNode, CObjectManager &objectManager, btCollisionObject *pCollisionObject, ELiftableObjectTypes eLiftableObjectType, bool bRecreateOnLift, const UserData &userData)
: CObject(objectManager,LIFTABLE_OBJECT, pCollisionObject, userData.getStringUserData("id")), m_eLiftableObjectType(eLiftableObjectType), m_bRecreateOnLift(bRecreateOnLift) {
m_eState = LOS_AT_DEFAULT_LOCATION;
m_InnerObject = InnerObjectGenerator::getInnerObjectByName(userData.getStringUserData("innerObject", "default"));
switch (eLiftableObjectType) {
case LOT_VASE:
m_uiInnerObjectCreateEvent = IOCE_DESTROYED;
break;
case LOT_SIGN:
case LOT_BOMB:
m_uiInnerObjectCreateEvent = IOCE_NEVER;
break;
default:
m_uiInnerObjectCreateEvent = IOCE_DESTROYED | IOCE_LIFT;
break;
}
}
开发者ID:ChWick,项目名称:Zelda,代码行数:18,代码来源:LiftableObject.cpp
注:本文中的UserData类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论