msg += " Existing netpoints: \n";
std::vector<simgrid::kernel::routing::NetPoint*> list;
- simgrid::s4u::Engine::instance()->netpointList(&list);
+ simgrid::s4u::Engine::getInstance()->getNetpointList(&list);
std::sort(list.begin(), list.end(),
[](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
return a->name() < b->name();
YY_BUFFER_STATE surf_input_buffer;
FILE *surf_file_to_parse = nullptr;
-/*
- * Stuff relative to storage
- */
+/* Stuff relative to storage */
void STag_surfxml_storage()
{
ZONE_TAG = 0;
XBT_DEBUG("STag_surfxml_storage");
xbt_assert(current_property_set == nullptr, "Someone forgot to reset the property set to nullptr in its closing tag (or XML malformed)");
}
+
void ETag_surfxml_storage()
{
- s_sg_platf_storage_cbarg_t storage;
- memset(&storage,0,sizeof(storage));
+ StorageCreationArgs storage;
storage.properties = current_property_set;
current_property_set = nullptr;
storage.id = A_surfxml_storage_id;
storage.type_id = A_surfxml_storage_typeId;
storage.content = A_surfxml_storage_content;
-
storage.attach = A_surfxml_storage_attach;
+
sg_platf_new_storage(&storage);
}
void STag_surfxml_storage___type()
"size of storage type", storage_type.id);
sg_platf_new_storage_type(&storage_type);
}
+
void STag_surfxml_mount()
{
XBT_DEBUG("STag_surfxml_mount");
}
+
void ETag_surfxml_mount()
{
- s_sg_platf_mount_cbarg_t mount;
- memset(&mount,0,sizeof(mount));
+ MountCreationArgs mount;
mount.name = A_surfxml_mount_name;
mount.storageId = A_surfxml_mount_storageId;
{
if (ZONE_TAG) { // We need to retrieve the most recently opened zone
XBT_DEBUG("Set zone property %s -> %s", A_surfxml_prop_id, A_surfxml_prop_value);
- simgrid::s4u::NetZone* netzone = simgrid::s4u::Engine::instance()->netzoneByNameOrNull(A_surfxml_zone_id);
+ simgrid::s4u::NetZone* netzone = simgrid::s4u::Engine::getInstance()->getNetzoneByNameOrNull(A_surfxml_zone_id);
netzone->setProperty(A_surfxml_prop_id, A_surfxml_prop_value);
}
void STag_surfxml_peer(){
parse_after_config();
- s_sg_platf_peer_cbarg_t peer;
- memset(&peer,0,sizeof(peer));
- peer.id = A_surfxml_peer_id;
- peer.speed = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id);
- peer.bw_in = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id);
- peer.bw_out = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id);
+ PeerCreationArgs peer;
+
+ peer.id = std::string(A_surfxml_peer_id);
+ peer.speed = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id.c_str());
+ peer.bw_in = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id.c_str());
+ peer.bw_out = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id.c_str());
peer.coord = A_surfxml_peer_coordinates;
peer.speed_trace = A_surfxml_peer_availability___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_availability___file) : nullptr;
peer.state_trace = A_surfxml_peer_state___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_state___file) : nullptr;
xbt_free(dir);
surf_file_to_parse = surf_fopen(file, "r");
- xbt_assert(surf_file_to_parse != nullptr, "Unable to open '%s'\n", file);
+ if (surf_file_to_parse == nullptr)
+ xbt_die("Unable to open '%s'\n", file);
surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE);
surf_parse__switch_to_buffer(surf_input_buffer);
surf_parse_lineno = 1;
}
}
-/* Call the lexer to parse the currently opened file. This pointer to function enables bypassing of the parser */
-static int _surf_parse() {
+/* Call the lexer to parse the currently opened file */
+int surf_parse()
+{
return surf_parse_lex();
}
-int_f_void_t surf_parse = &_surf_parse;
-
SG_END_DECL()