Esempio n. 1
0
Gateway*
NetworkManager::GetGatewayByID (int idGW)
{
  std::vector<Gateway*>* gatewayContainer = GetGatewayContainer ();
  std::vector<Gateway*>::iterator iter;
  Gateway *gateway;

  for (iter = gatewayContainer->begin ();
      iter !=gatewayContainer->end (); iter++)
    {
    gateway = *iter;
    if (gateway->GetIDNetworkNode() == idGW)
      {
      return gateway;
      }
    }
  return false;
}
Esempio n. 2
0
NetworkNode*
NetworkManager::GetNetworkNodeByID (int id)
{
  std::vector<ENodeB*>* eNodeBContainer = GetENodeBContainer ();
  std::vector<ENodeB*>::iterator iter2;
  ENodeB *eNodeB;
  for (iter2 = eNodeBContainer->begin ();
      iter2 !=eNodeBContainer->end (); iter2++)
    {
    eNodeB = *iter2;
    if (eNodeB->GetIDNetworkNode() == id)
      {
      return eNodeB;
      }
    }

  std::vector<UserEquipment*>* userEquipmentContainer = GetUserEquipmentContainer ();
  std::vector<UserEquipment*>::iterator iter3;
  UserEquipment *userEquipment;
  for (iter3 = userEquipmentContainer->begin ();
      iter3 !=userEquipmentContainer->end (); iter3++)
    {
    userEquipment = *iter3;
    if (userEquipment->GetIDNetworkNode() == id)
      {
      return userEquipment;
      }
    }

  std::vector<Gateway*>* gatewayContainer = GetGatewayContainer ();
  std::vector<Gateway*>::iterator iter;
  Gateway *gateway;

  for (iter = gatewayContainer->begin ();
      iter !=gatewayContainer->end (); iter++)
    {
    gateway = *iter;
    if (gateway->GetIDNetworkNode() == id)
      {
      return gateway;
      }
    }
  return false;
}