#include "../include/Data.h"

namespace environment {
namespace data {

  Entity Data::entity (uint32_t address, uint32_t size)
  {
    for (uint32_t num_seg = 0; num_seg < nb_seg; num_seg ++)
      if (segment[num_seg]->test (address,size) == true)
	return Entity (true,segment[num_seg]);
    
    return Entity (false);
  }
  
  Entity Data::entity (std::string name)
  {
    for (uint32_t num_seg = 0; num_seg < nb_seg; num_seg ++)
      if (segment[num_seg]->test(name) == true)
	return Entity (true,segment[num_seg]);
    
    return Entity (false);
  }

};
};
