public:
virtual ~NetCard(){};
virtual int id()=0; // Our rank in the vertices_ array of our containing AS.
- virtual int *getIdPtr()=0;
virtual void setId(int id)=0;
virtual char *name()=0;
virtual As *containingAS()=0; // This is the AS in which I am
{}
~NetCardImpl() { xbt_free(name_);};
- int id() {return id_;}
- int *getIdPtr() {return &id_;}
- void setId(int id) {id_ = id;}
- char *name() {return name_;}
- As *containingAS() {return containingAS_;}
- e_surf_network_element_type_t getRcType() {return componentType_;}
+ int id() override {return id_;}
+ void setId(int id) override {id_ = id;}
+ char *name() override {return name_;}
+ As *containingAS() override {return containingAS_;}
+ e_surf_network_element_type_t getRcType() override {return componentType_;}
private:
int id_ = -1;
char *name_;
/* set utils vars */
srcDstCheck(src, dst);
- int *src_id = src->getIdPtr();
- int *dst_id = dst->getIdPtr();
-
- if (!src_id || !dst_id)
- THROWF(arg_error,0,"No route from '%s' to '%s'",src->name(),dst->name());
+ int src_id = src->id();
+ int dst_id = dst->id();
int *pred_arr = NULL;
sg_platf_route_cbarg_t e_route;
xbt_dynar_t nodes = xbt_graph_get_nodes(p_routeGraph);
/* Use the graph_node id mapping set to quickly find the nodes */
- graph_node_map_element_t src_elm = nodeMapSearch(*src_id);
- graph_node_map_element_t dst_elm = nodeMapSearch(*dst_id);
+ graph_node_map_element_t src_elm = nodeMapSearch(src_id);
+ graph_node_map_element_t dst_elm = nodeMapSearch(dst_id);
int src_node_id = ((graph_node_data_t) xbt_graph_node_get_data(src_elm->node))->graph_id;
int dst_node_id = ((graph_node_data_t) xbt_graph_node_get_data(dst_elm->node))->graph_id;