本文整理汇总了C++中Task::SetPriority方法的典型用法代码示例。如果您正苦于以下问题:C++ Task::SetPriority方法的具体用法?C++ Task::SetPriority怎么用?C++ Task::SetPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::SetPriority方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OperatorControl
void OperatorControl(){
myRobot->ResetDisplacement();
Drive->SetPriority(1);
Drive->join();
Shooter_Intake->SetPriority(2);
Shooter_Intake->join();
while(IsOperatorControl() && IsEnabled()){
Wait(2);
printf("Teleop");
}
}
示例2: ScheduleAll
void RateMonotonicScheduler::ScheduleAll() {
vector<Task*>::iterator it;
Task* leastPeriodTask = NULL;
for (it = m_tasks.begin(); it < m_tasks.end(); it++) {
(*it)->SetPriority(1);
if ( (*it)->GetRemaining()>0 && (leastPeriodTask == NULL || ((*it)->GetPeriod() < leastPeriodTask->GetPeriod()))) {
leastPeriodTask = *it;
}
}
if (leastPeriodTask != NULL) {
leastPeriodTask->SetPriority(59);
}
}
示例3: FileToTask
Task* TaskFS::FileToTask(entry_ref theEntryRef)
{
Task* newTask =new Task();
//needed for the "attribute stuff
BFile theFile(&theEntryRef,B_READ_ONLY);
//needed to get out the name
BEntry theEntry(&theEntryRef);
bool completed;
char name[B_FILE_NAME_LENGTH];
BString taskListID;
BString notes;
uint32 priority;
time_t due;
BString id;
BString url;
//maby do a check if everything went ok and only if so set the values
theFile.ReadAttr("META:completed",B_BOOL_TYPE, 0, &completed, sizeof(completed));
theEntry.GetName(name);
theFile.ReadAttrString("META:tasks",&taskListID);
theFile.ReadAttrString("META:notes",¬es);
theFile.ReadAttr("META:priority", B_UINT32_TYPE, 0, &priority, sizeof(priority));
theFile.ReadAttr("META:due", B_TIME_TYPE, 0, &due, sizeof(due));
theFile.ReadAttrString("META:task_id", &id);
theFile.ReadAttrString("META:task_url",&url);
//** find TaskList from ID//
TaskList *newTaskList = new TaskList("");
newTaskList->SetID(taskListID);
newTask->Complete(completed);
newTask->SetTitle(BString(name));
newTask->SetTaskList(newTaskList);
newTask->SetNotes(notes);
newTask->SetPriority(priority);
newTask->SetDueTime(due);
newTask->SetID(id);
newTask->SetURL(url);
BMessage *msg = new BMessage();
msg->AddPointer("task",newTask);
Looper()->SendNotices(ADD_TASK,msg);
return newTask;
}