private void CreateIfNotRegistered(WorkerAddress worker)
 {
     if (!m_workersFullInfoGathering.ContainsKey(worker.GetWorkerId()))
     {
         m_workersFullInfoGathering.Add(worker.GetWorkerId(), new WorkerLinkedData <T>(worker, null));
     }
 }
    public void Set(WorkerAddress worker, T info)
    {
        bool found = m_workersFullInfoGathering.ContainsKey(worker.GetWorkerId());

        if (!found)
        {
            CheckThatWorkerExist(worker);
        }
        m_workersFullInfoGathering[worker.GetWorkerId()].SetLinkedData(info);
    }
 public void Get(WorkerAddress workerId, out bool found, out WorkerLinkedData <T> fullInfo)
 {
     found = m_workersFullInfoGathering.ContainsKey(workerId.GetWorkerId());
     if (found)
     {
         fullInfo = m_workersFullInfoGathering[workerId.GetWorkerId()];
     }
     else
     {
         fullInfo = null;
     }
 }
    public void CheckThatWorkerExist(WorkerAddress worker)
    {
        if (worker == null)
        {
            return;
        }
        string id = worker.GetWorkerId();

        CreateIfNotRegistered(worker);
        WorkerLinkedData <T> info = m_workersFullInfoGathering[id];

        info.SetLinkedData(null);
    }
 public bool Has(WorkerAddress workerId)
 {
     return(m_workersFullInfoGathering.ContainsKey(workerId.GetWorkerId()));
 }
Beispiel #6
0
 public string GetWorkerId()
 {
     return(m_workerTargeted.GetWorkerId());
 }