Task.h File Reference

#include <pthread.h>
#include "TaskIdList.h"
#include "DataSpace.h"
#include "cser.h"
#include "hash.h"

Include dependency graph for Task.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _task_

Defines

#define KEY_INT
#define VAL_VOID

Typedefs

typedef _task_ Task

Enumerations

enum  TaskState_t { created, running, finished }

Functions

TaskcreateTask ()
void destroyTask (Task *task)
void setTaskEndedTasks (Task *task, int endedTasks)
void setTaskState (Task *task, TaskState_t state)
void setTaskMetadata (Task *task, const char *metadata, const int metaSize)
void setTaskMyDeps (Task *task, TaskIdList *list)
void setTaskDataSpace (Task *task, DataSpace *dataSpace)
void setTaskDependsOnMe (Task *task, TaskIdList *list)
void setTaskMother (Task *task, Task *mother)
void setTaskId (Task *task, int id)
void addTaskToDependsOnMe (Task *task, int taskId)
void taskAddChild (Task *mother, int childId, Task *child)
HashIntVoid * taskTakeChildren (Task *task)
void taskMove (Task *dest, Task *src)
 Move all data from task struct src to dest, destroy dest values and src.
int getTaskEndedTasks (Task *task)
int getTaskMetasize (Task *task)
TaskState_t getTaskState (Task *task)
char * getTaskMetadata (Task *task)
TaskIdListgetTaskMyDeps (Task *task)
TaskIdListgetTaskDependsOnMe (Task *task)
HashIntVoid * getTaskChildren (Task *task)
DataSpacegetTaskDataSpace (Task *task)
TaskgetTaskMother (Task *task)
int getTaskId (Task *task)
int writeTask (FILE *outputFile, void *task)
void * readTask (FILE *inputFile)
int writeChildTask (FILE *outputFile, void *task)
 writeChildTask() writes only the necessary to
void * readChildTask (FILE *inputFile)
int compareTasks (Task *task1, Task *task2)
 if ret == 0 task1 is equal to task2 else no


Define Documentation

#define KEY_INT
 

Definition at line 11 of file Task.h.

#define VAL_VOID
 

Definition at line 12 of file Task.h.


Typedef Documentation

typedef struct _task_ Task
 


Enumeration Type Documentation

enum TaskState_t
 

Enumerator:
created 
running 
finished 

Definition at line 18 of file Task.h.


Function Documentation

void addTaskToDependsOnMe Task task,
int  taskId
 

Definition at line 92 of file Task.c.

References _task_::dependsOnMe, dependsOnMeMutex, taskIdListAdd(), and taskIdListCreate().

Here is the call graph for this function:

int compareTasks Task task1,
Task task2
 

if ret == 0 task1 is equal to task2 else no

Definition at line 382 of file Task.c.

References _task_::children, compareTasks(), _task_::dependsOnMe, _task_::endedTasks, _task_::id, _task_::metadata, _task_::metaSize, _task_::myDeps, _task_::state, taskIdListCompare(), and taskIdListGetSize().

Referenced by compareTasks().

Here is the call graph for this function:

Task* createTask  ) 
 

Definition at line 15 of file Task.c.

References _task_::children, created, createDataSpace(), _task_::dataSpace, _task_::dependsOnMe, _task_::endedTasks, _task_::metadata, _task_::metaSize, _task_::mother, readChildTask(), _task_::state, and writeChildTask().

Referenced by cachePutData(), readChildTask(), and readTask().

Here is the call graph for this function:

void destroyTask Task task  ) 
 

Definition at line 35 of file Task.c.

References _task_::children, _task_::dependsOnMe, _task_::metadata, _task_::myDeps, and taskIdListDestroy().

Referenced by cacheRecoverTasks().

Here is the call graph for this function:

HashIntVoid* getTaskChildren Task task  ) 
 

Definition at line 209 of file Task.c.

References _task_::children.

DataSpace* getTaskDataSpace Task task  ) 
 

Definition at line 213 of file Task.c.

References _task_::dataSpace.

Referenced by cacheGetData(), cachePutData(), cacheRemoveData(), and writeTask().

TaskIdList* getTaskDependsOnMe Task task  ) 
 

Definition at line 200 of file Task.c.

References _task_::dependsOnMe.

int getTaskEndedTasks Task task  ) 
 

Definition at line 158 of file Task.c.

References _task_::endedTasks.

Referenced by writeTask().

int getTaskId Task task  ) 
 

Definition at line 221 of file Task.c.

References _task_::id.

Referenced by writeChildTask(), and writeTask().

char* getTaskMetadata Task task  ) 
 

Definition at line 182 of file Task.c.

References _task_::metadata.

Referenced by writeChildTask(), and writeTask().

int getTaskMetasize Task task  ) 
 

Definition at line 166 of file Task.c.

References _task_::metaSize.

Referenced by writeChildTask(), and writeTask().

Task* getTaskMother Task task  ) 
 

Definition at line 217 of file Task.c.

References _task_::mother.

TaskIdList* getTaskMyDeps Task task  ) 
 

Definition at line 191 of file Task.c.

References _task_::myDeps.

Referenced by cacheGetTaskDeps().

TaskState_t getTaskState Task task  ) 
 

Definition at line 174 of file Task.c.

References _task_::state.

Referenced by cacheEndTask(), cacheGetData(), cacheSetCurrentTask(), and writeTask().

void* readChildTask FILE *  inputFile  ) 
 

Definition at line 341 of file Task.c.

References createTask(), READ_BEGIN, READ_BYTES, READ_END, READ_NUM, readTaskIdList(), setTaskDependsOnMe(), setTaskId(), setTaskMetadata(), setTaskMyDeps(), and taskIdListDestroy().

Referenced by createTask().

Here is the call graph for this function:

void* readTask FILE *  inputFile  ) 
 

Definition at line 258 of file Task.c.

References _task_::children, createDataSpace(), createTask(), _task_::mother, READ_BEGIN, READ_BYTES, READ_END, READ_NUM, readDataSpace(), readTaskIdList(), setTaskDataSpace(), setTaskDependsOnMe(), setTaskEndedTasks(), setTaskId(), setTaskMetadata(), setTaskMyDeps(), setTaskState(), and taskIdListDestroy().

Referenced by cacheRecoverTasks().

Here is the call graph for this function:

void setTaskDataSpace Task task,
DataSpace dataSpace
 

Definition at line 76 of file Task.c.

References _task_::dataSpace.

Referenced by readTask().

void setTaskDependsOnMe Task task,
TaskIdList list
 

Definition at line 80 of file Task.c.

References _task_::dependsOnMe, dependsOnMeMutex, and taskIdListCopy().

Referenced by readChildTask(), and readTask().

Here is the call graph for this function:

void setTaskEndedTasks Task task,
int  endedTasks
 

Definition at line 53 of file Task.c.

References _task_::endedTasks.

Referenced by readTask().

void setTaskId Task task,
int  id
 

Definition at line 120 of file Task.c.

References _task_::id.

Referenced by readChildTask(), and readTask().

void setTaskMetadata Task task,
const char *  metadata,
const int  metaSize
 

Definition at line 65 of file Task.c.

References _task_::metadata, and _task_::metaSize.

Referenced by readChildTask(), and readTask().

void setTaskMother Task task,
Task mother
 

Definition at line 116 of file Task.c.

References _task_::mother.

void setTaskMyDeps Task task,
TaskIdList list
 

Definition at line 61 of file Task.c.

References _task_::myDeps, and taskIdListCopy().

Referenced by readChildTask(), and readTask().

Here is the call graph for this function:

void setTaskState Task task,
TaskState_t  state
 

Definition at line 57 of file Task.c.

References _task_::state.

Referenced by cacheEndTask(), cacheRecoverTasks(), cacheRunTask(), and readTask().

void taskAddChild Task mother,
int  childId,
Task child
 

Definition at line 103 of file Task.c.

References _task_::children, and _task_::mother.

Referenced by cacheRecoverTasks().

void taskMove Task dest,
Task src
 

Move all data from task struct src to dest, destroy dest values and src.

Definition at line 125 of file Task.c.

References _task_::children, _task_::dataSpace, _task_::dependsOnMe, destroyDataSpace(), _task_::endedTasks, _task_::id, _task_::metadata, _task_::metaSize, _task_::mother, _task_::myDeps, _task_::state, and taskIdListDestroy().

Here is the call graph for this function:

HashIntVoid* taskTakeChildren Task task  ) 
 

Definition at line 109 of file Task.c.

References _task_::children.

Referenced by cacheRecoverTasks().

int writeChildTask FILE *  outputFile,
void *  task
 

writeChildTask() writes only the necessary to

Definition at line 320 of file Task.c.

References _task_::dependsOnMe, dependsOnMeMutex, getTaskId(), getTaskMetadata(), getTaskMetasize(), _task_::myDeps, WRITE_BYTES, WRITE_NUM, and writeTaskIdList().

Referenced by createTask().

Here is the call graph for this function:

int writeTask FILE *  outputFile,
void *  task
 

Definition at line 227 of file Task.c.

References _task_::children, _task_::dependsOnMe, dependsOnMeMutex, getTaskDataSpace(), getTaskEndedTasks(), getTaskId(), getTaskMetadata(), getTaskMetasize(), getTaskState(), _task_::myDeps, WRITE_BYTES, WRITE_NUM, writeDataSpace(), and writeTaskIdList().

Referenced by writerThread().

Here is the call graph for this function:


Generated on Tue Jan 17 19:27:16 2006 for Void by  doxygen 1.4.6