1 #include "simdag/simdag.h"
2 #include "xbt/sysdep.h" /* xbt_new0 */
6 SG_link_t SG_link_create(void *data, const char *name,/* double capacity,*/ double bandwidth, double latency) {
7 /* xbt_assert0(capacity >= 0, "Invalid parameter");*/ /* or capacity > 0 ? */
9 SG_link_t link = xbt_new0(s_SG_link_t, 1);
12 link->name = xbt_strdup(name);
13 /*link->capacity = capacity;*/
14 /* link->current_bandwidth = bandwidth;
15 link->current_latency = latency;*/
20 /* Returns the user data of a link. The user data can be NULL.
22 void* SG_link_get_data(SG_link_t link) {
23 xbt_assert0(link, "Invalid parameter");
27 /* Sets the user data of a link. The data can be NULL.
29 void SG_link_set_data(SG_link_t link, void *data) {
30 xbt_assert0(link, "Invalid parameter");
34 /* Returns the name of a link. The name can be NULL.
36 const char* SG_link_get_name(SG_link_t link) {
37 xbt_assert0(link, "Invalid parameter");
41 /* Returns the capacity of a link.
44 double SG_link_get_capacity(SG_link_t link) {
45 xbt_assert0(link, "Invalid parameter");
46 return link->capacity;
49 /* Return the current bandwidth of a link.
51 double SG_link_get_current_bandwidth(SG_link_t link) {
52 xbt_assert0(link, "Invalid parameter");
56 /* return link->current_bandwidth;*/
59 /* Return the current latency of a link.
61 double SG_link_get_current_latency(SG_link_t link) {
62 xbt_assert0(link, "Invalid parameter");
66 /* return link->current_latency;*/
69 /* Destroys a link. The user data (if any) should have been destroyed first.
71 void SG_link_destroy(SG_link_t link) {
72 xbt_assert0(link, "Invalid parameter");