LCOV - code coverage report
Current view: top level - builds/DaniloBorquez/flex-net-sim/src - allocator.cpp (source / functions) Hit Total Coverage
Test: commit SHA1 Lines: 19 22 86.4 %
Date: 2025-08-25 21:30:02 Functions: 7 8 87.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #include "allocator.hpp"
       2             : #include "defragmentator.hpp"
       3             : 
       4           3 : Allocator::Allocator(std::shared_ptr<Network> network) {
       5           3 :   this->network = network;
       6           3 :   this->name = std::string("No name");
       7           3 :   this->defragmentator = nullptr;
       8           3 : }
       9             : 
      10           2 : allocationStatus Allocator::exec(int src, int dst, BitRate bitRate,
      11             :                                  Connection &con) {
      12             :   throw std::runtime_error(
      13             :       "You must implement a method to allocate resources. You can do this "
      14           2 :       "making an inherited class from Allocator, or ...");
      15             : }
      16             : 
      17          12 : std::string Allocator::getName(void) { return this->name; }
      18             : 
      19          53 : Allocator::Allocator(void) {
      20          53 :   this->network = nullptr;
      21          53 :   this->path = nullptr;
      22          53 :   this->defragmentator = nullptr;
      23          53 : }
      24             : 
      25          14 : void Allocator::setNetwork(std::shared_ptr<Network> network) { this->network = network; }
      26             : 
      27          14 : void Allocator::setPaths(std::shared_ptr<Paths> path) {
      28          14 :   this->path = path;
      29          14 : }
      30             : 
      31           0 : void Allocator::setDefragmentator(std::unique_ptr<Defragmentator> defragmentator) {
      32           0 :   this->defragmentator = std::move(defragmentator);
      33           0 : }
      34             : 
      35       53426 : std::unique_ptr<Defragmentator> &Allocator::getDefragmentator(void) {
      36       53426 :   return this->defragmentator;
      37             : }

Generated by: LCOV version 1.13