#include "srterrno.h"#include "srttypes.h"
Go to the source code of this file.
Data Structures | |
| struct | srt_data_attr |
| struct | srt_task_attr |
| struct | srt_job_attr |
Typedefs | |
| typedef bool(* | schd_checker )(const float u, const u_int n) |
Functions | |
| SRT_DATA * | srt_data_create (const char *label, const char *kind) |
| srt_status | srt_data_set_attr (SRT_DATA *data, srt_data_attr attr) |
| srt_status | srt_data_get_attr (SRT_DATA *data, srt_data_attr *pattr) |
| SRT_RESOURCE * | srt_res_create (const char *label, bool available) |
| srt_status | srt_res_add_provision (SRT_RESOURCE *res, SRT_DATA *data) |
| srt_status | srt_res_set_attr (SRT_RESOURCE *res, bool available) |
| SRT_JOB * | srt_job_create (const char *label, SRT_POLICY policy) |
| srt_status | srt_job_add_data (SRT_JOB *job, SRT_DATA *data) |
| srt_status | srt_job_remove_data (SRT_JOB *job, SRT_DATA *data) |
| srt_status | srt_job_add_task (SRT_JOB *job, SRT_TASK *task) |
| srt_status | srt_job_remove_task (SRT_JOB *job, SRT_TASK *task) |
| srt_status | srt_job_set_attr (SRT_JOB *job, srt_job_attr attr) |
| srt_status | srt_job_get_attr (SRT_JOB *job, srt_job_attr *pattr) |
| SRT_DISJUNCTION * | srt_disj_create (const char *label) |
| srt_status | srt_disj_add_data (SRT_DISJUNCTION *disj, SRT_DATA *data) |
| srt_status | srt_disj_add_disj (SRT_DISJUNCTION *disj, SRT_DISJUNCTION *disj2) |
| srt_status | srt_disj_add_conj (SRT_DISJUNCTION *disj, SRT_CONJUNCTION *conj) |
| SRT_CONJUNCTION * | srt_conj_create (const char *label) |
| srt_status | srt_conj_add_data (SRT_CONJUNCTION *conj, SRT_DATA *data) |
| srt_status | srt_conj_add_disj (SRT_CONJUNCTION *conj, SRT_DISJUNCTION *disj) |
| srt_status | srt_conj_add_conj (SRT_CONJUNCTION *conj, SRT_CONJUNCTION *conj2) |
| SRT_TASK * | srt_task_create (const char *label, u_int consumption) |
| srt_status | srt_task_set_attr (SRT_TASK *task, srt_task_attr attr) |
| srt_status | srt_task_get_attr (SRT_TASK *task, srt_task_attr *pattr) |
| srt_status | srt_task_add_disj_input (SRT_TASK *task, SRT_DISJUNCTION *disj) |
| srt_status | srt_task_add_conj_input (SRT_TASK *task, SRT_CONJUNCTION *conj) |
| srt_status | srt_task_add_data_input (SRT_TASK *task, SRT_DATA *data) |
| srt_status | srt_task_add_output (SRT_TASK *task, SRT_DATA *data) |
| srt_status | srt_task_set_descriptor (SRT_TASK *task, void *descriptor) |
| void * | srt_get_entity_by_name (const char *name) |
| srt_status | srt_init (void) |
| srt_status | srt_finish (void) |
| srt_status | srt_chek_kb (void) |
| srt_status | srt_test_solution (void) |
| srt_status | srt_set_maxreason_time (long max_time) |
| srt_status | srt_switch_context (void *os_data) |
| srt_status | srt_set_sched_checker (schd_checker check_func) |
| srt_status | srt_export_kb2dot (const char *filename) |
SeART APIs for initialization, Knowledge base description and manipulation, context switching and scheduling.
| typedef bool(* schd_checker)(const float u, const u_int n) |
User defined routine for schedulability test .
| u | utilization factor | |
| n | number of tasks |
| srt_status srt_chek_kb | ( | void | ) |
Checking for the consistency of the SeART knowledge-base;
| srt_status srt_conj_add_conj | ( | SRT_CONJUNCTION * | conj, | |
| SRT_CONJUNCTION * | conj2 | |||
| ) |
Add CONJUNCTION entity to a DISJUNCTION
| conj | a pointer to SRT_CONJUNCTION structure | |
| conj2 | a pointer to SRT_CONJUNCTION structure |
| srt_status srt_conj_add_data | ( | SRT_CONJUNCTION * | conj, | |
| SRT_DATA * | data | |||
| ) |
Add DATA entity to a CONJUNCTION
| conj | a pointer to SRT_CONJUNCTION structure | |
| data | a pointer to SRT_DATA structure |
| srt_status srt_conj_add_disj | ( | SRT_CONJUNCTION * | conj, | |
| SRT_DISJUNCTION * | disj | |||
| ) |
Add DISJUNCTION entity to a CONJUNCTION
| conj | a pointer to SRT_CONJUNCTION structure | |
| disj | a pointer to SRT_DISJUNCTION structure |
| SRT_CONJUNCTION* srt_conj_create | ( | const char * | label | ) |
Create a CONJUNCTION concept in SeART Knowledge Base
| label | label |
| SRT_DATA* srt_data_create | ( | const char * | label, | |
| const char * | kind | |||
| ) |
Create a DATA concept in SeART Knowledge Base
| label | label | |
| kind | type of data |
| srt_status srt_data_get_attr | ( | SRT_DATA * | data, | |
| srt_data_attr * | pattr | |||
| ) |
Get the attribute of Data
| data | a pointer to SRT_DATA structure | |
| pattr | a pointer to srt_data_attr structure to save the attributes |
| srt_status srt_data_set_attr | ( | SRT_DATA * | data, | |
| srt_data_attr | attr | |||
| ) |
Set the attribute of a DATA
| data | a pointer to SRT_DATA structure | |
| attr | srt_data_attr structure |
| srt_status srt_disj_add_conj | ( | SRT_DISJUNCTION * | disj, | |
| SRT_CONJUNCTION * | conj | |||
| ) |
Add CONJUNCTION entity to a DISJUNCTION
| disj | a pointer to SRT_DISJUNCTION structure | |
| conj | a pointer to SRT_CONJUNCTION structure |
| srt_status srt_disj_add_data | ( | SRT_DISJUNCTION * | disj, | |
| SRT_DATA * | data | |||
| ) |
Add DATA entity to a DISJUNCTION
| disj | a pointer to SRT_DISJUNCTION structure | |
| data | a pointer to SRT_DATA structure |
| srt_status srt_disj_add_disj | ( | SRT_DISJUNCTION * | disj, | |
| SRT_DISJUNCTION * | disj2 | |||
| ) |
Add DISJUNCTION entity to a DISJUNCTION
| disj | a pointer to SRT_DISJUNCTION structure | |
| disj2 | a pointer to SRT_DISJUNCTION structure |
| SRT_DISJUNCTION* srt_disj_create | ( | const char * | label | ) |
Create a DISJUNCTION concept in SeART Knowledge Base
| label | label |
| srt_status srt_export_kb2dot | ( | const char * | filename | ) |
Export SeART knowledge-base to a DOT graph file.
| filename | name of the output DOT file. |
| srt_status srt_finish | ( | void | ) |
Ending SeART;
NOTE: srt_finish() must be called at the end of you program.
| void* srt_get_entity_by_name | ( | const char * | name | ) |
Retrieve a SeART entity by its name;
| name | label of the entity |
NOTE: User must be aware of the type of the entity requested by its name!
| srt_status srt_init | ( | void | ) |
Initializing SeART;
NOTE: srt_init() must be called before any other SeART APIs.
| srt_status srt_job_add_data | ( | SRT_JOB * | job, | |
| SRT_DATA * | data | |||
| ) |
Add DATA necessity to a JOB
| job | a pointer to SRT_JOB structure | |
| data | a pointer to SRT_DATA structure |
| srt_status srt_job_add_task | ( | SRT_JOB * | job, | |
| SRT_TASK * | task | |||
| ) |
Add TASK necessity to a JOB
| job | a pointer to SRT_JOB structure | |
| task | a pointer to SRT_TASK structure |
| SRT_JOB* srt_job_create | ( | const char * | label, | |
| SRT_POLICY | policy | |||
| ) |
Create a JOB concept in SeART Knowledge Base
| label | label | |
| policy | ploicy concerning reasoning of job |
| srt_status srt_job_get_attr | ( | SRT_JOB * | job, | |
| srt_job_attr * | pattr | |||
| ) |
Set the attribute of Job
| job | a pointer to SRT_JOB structure | |
| pattr | a pointer to srt_job_attr structure to save the attributes |
| srt_status srt_job_remove_data | ( | SRT_JOB * | job, | |
| SRT_DATA * | data | |||
| ) |
Remove DATA necessity from a JOB
| job | a pointer to SRT_JOB structure | |
| data | a pointer to SRT_DATA structure |
| srt_status srt_job_remove_task | ( | SRT_JOB * | job, | |
| SRT_TASK * | task | |||
| ) |
Remove TASK necessity from a JOB
| job | a pointer to SRT_JOB structure | |
| task | a pointer to SRT_TASK structure |
| srt_status srt_job_set_attr | ( | SRT_JOB * | job, | |
| srt_job_attr | attr | |||
| ) |
Set the attribute of Job
| job | a pointer to SRT_JOB structure | |
| attr | srt_job_attr structure |
| srt_status srt_res_add_provision | ( | SRT_RESOURCE * | res, | |
| SRT_DATA * | data | |||
| ) |
Add provision to a RESOURCE
| res | a pointer to SRT_RESOURCE structure | |
| data | a pointer to SRT_DATA structure |
| SRT_RESOURCE* srt_res_create | ( | const char * | label, | |
| bool | available | |||
| ) |
Create a RESOURCE concept in SeART Knowledge Base
| label | label | |
| available | availability of resource |
| srt_status srt_res_set_attr | ( | SRT_RESOURCE * | res, | |
| bool | available | |||
| ) |
Set availability attribute of a resource
| res | a pointer to SRT_RESOURCE structure | |
| available | attribute of resource |
| srt_status srt_set_maxreason_time | ( | long | max_time | ) |
Sets maximum allowed reasoning relative time. The reasoner will return the optimal solution has been found until max_time.
| srt_status srt_set_sched_checker | ( | schd_checker | check_func | ) |
Set a user defined routine for schedulability test.
| check_func | a pointer to schd_checker function |
| srt_status srt_switch_context | ( | void * | os_data | ) |
Reason the current SeART knowledge-base and switch to new context if any solution exists.
| os_data | OS dependent required data for low-level task manipulating. please refer to the document for the specific OS in the /arch folder. |
| srt_status srt_task_add_conj_input | ( | SRT_TASK * | task, | |
| SRT_CONJUNCTION * | conj | |||
| ) |
Add CONJUNCTION entity to the input of the task
| task | a pointer to SRT_TASK structure | |
| conj | a pointer to SRT_CONJUNCTION structure |
| srt_status srt_task_add_data_input | ( | SRT_TASK * | task, | |
| SRT_DATA * | data | |||
| ) |
Add DATA entity to the input of the task
| task | a pointer to SRT_TASK structure | |
| data | a pointer to SRT_DATA structure |
| srt_status srt_task_add_disj_input | ( | SRT_TASK * | task, | |
| SRT_DISJUNCTION * | disj | |||
| ) |
Add DISJUNCTION entity to the input of the task
| task | a pointer to SRT_TASK structure | |
| disj | a pointer to SRT_DISJUNCTION structure |
| srt_status srt_task_add_output | ( | SRT_TASK * | task, | |
| SRT_DATA * | data | |||
| ) |
Add Data entity to the output of a task
| task | a pointer to SRT_TASK structure | |
| data | a pointer to SRT_DATA structure |
| SRT_TASK* srt_task_create | ( | const char * | label, | |
| u_int | consumption | |||
| ) |
Create a TASK concept in SeART Knowledge Base
| label | label | |
| consumption | task worst case execution time |
| srt_status srt_task_get_attr | ( | SRT_TASK * | task, | |
| srt_task_attr * | pattr | |||
| ) |
Retrieve the attribute of a TASK
| task | a pointer to SRT_TASK structure | |
| pattr | a pointer to srt_task_attr structure to save the attributes |
| srt_status srt_task_set_attr | ( | SRT_TASK * | task, | |
| srt_task_attr | attr | |||
| ) |
Set the attribute of TASK
| task | a pointer to SRT_TASK structure | |
| attr | srt_task_attr structure |
| srt_status srt_task_set_descriptor | ( | SRT_TASK * | task, | |
| void * | descriptor | |||
| ) |
Set the OS dependent task descriptor. This descriptor will be used by SeART core to make relation between TASK concepts defined in the SeART knowledge-base and real operating system tasks.
| task | a pointer to SRT_TASK structure | |
| descriptor | a pointer to a OS dependent task descriptor. for detailed information about the type and structure of this descriptor, please refer to the document for the specific OS in the /arch folder. |
| srt_status srt_test_solution | ( | void | ) |
Checks whether any solution exist in SeART knowledge-base by the reasoner or not.
1.7.1