-namespace simgrid {
-namespace kernel {
-namespace resource {
-
-/* List of links */
-std::unordered_map<std::string, LinkImpl*>* LinkImpl::links = new std::unordered_map<std::string, LinkImpl*>();
-
-LinkImpl* LinkImpl::by_name(std::string name)
-{
- auto link = links->find(name);
- return link == links->end() ? nullptr : link->second;
-}
-/** @brief Returns the amount of links in the platform */
-int LinkImpl::linksCount()
-{
- return links->size();
-}
-void LinkImpl::linksList(std::vector<s4u::Link*>* linkList)
-{
- for (auto const& kv : *links) {
- linkList->push_back(&kv.second->piface_);
- }
-}
-
-/** @brief Returns a list of all existing links */
-LinkImpl** LinkImpl::linksList()
-{
- LinkImpl** res = xbt_new(LinkImpl*, (int)links->size());
- int i = 0;
- for (auto const& kv : *links) {
- res[i] = kv.second;
- i++;
- }
- return res;
-}
-/** @brief destructor of the static data */
-void LinkImpl::linksExit()
-{
- for (auto const& kv : *links)
- (kv.second)->destroy();
- delete links;
-}
-}
-}
-} // namespace simgrid
-