本文整理汇总了C++中UserData类的典型用法代码示例。如果您正苦于以下问题:C++ UserData类的具体用法?C++ UserData怎么用?C++ UserData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: read_user_data
UserData read_user_data(std::istream& is)
{
UserData userData;
userData.setText(read_string(is));
userData.setColor(read32(is));
return userData;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例7: WinThreadFunction
static DWORD WINAPI WinThreadFunction(LPVOID lpParam)
{
UserData* userData = static_cast<UserData*>(lpParam);
userData->func(userData->param);
return 0;
}
示例8: PThreadFunction
static void* PThreadFunction(void* lpParam)
{
UserData* userData = static_cast<UserData*>(lpParam);
userData->func(userData->param);
return 0;
}
示例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);
}
}
}
示例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);
}
示例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();
}
示例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());
}
示例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!");
}
示例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));
}
}
示例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;
}
}