本文整理汇总了C++中Task::Complete方法的典型用法代码示例。如果您正苦于以下问题:C++ Task::Complete方法的具体用法?C++ Task::Complete怎么用?C++ Task::Complete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::Complete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleComplete
void WorkQueue::HandleComplete(int Limit) {
// handle all complete tasks
int Handled = 0;
while (Handled < Limit) {
Task * task = GetFinishTask();
if (!task) {
return;
}
// call complete
task->Complete();
task->Recycle();
Handled++;
}
}
示例2: 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;
}