Esempio n. 1
0
 public void EndVisit(
     IntSeqKey controllerPath,
     BiConsumer<ContextControllerInitTermPartitionKey, int> partKeyAndCPId)
 {
     foreach (var entry in endConditions) {
         if (controllerPath.IsParentTo(entry.Key)) {
             partKeyAndCPId.Invoke(entry.Value.PartitionKey, entry.Value.SubpathIdOrCPId);
         }
     }
 }
 public void EndVisitConditions(
     IntSeqKey controllerPath,
     BiConsumer<ContextControllerConditionNonHA, int> partKeyAndCPId)
 {
     foreach (var entry in endConditions) {
         if (controllerPath.IsParentTo(entry.Key)) {
             partKeyAndCPId.Invoke(entry.Value.TerminationCondition, entry.Value.SubpathIdOrCPId);
         }
     }
 }
Esempio n. 3
0
        public ICollection<ContextControllerInitTermSvcEntry> EndDeleteByParentPath(IntSeqKey controllerPath)
        {
            var entries = new List<ContextControllerInitTermSvcEntry>();

            endConditions
                .Where(entry => controllerPath.IsParentTo(entry.Key))
                .ToList()
                .ForEach(
                    entry => {
                        entries.Add(entry.Value);
                        endConditions.Remove(entry.Key);
                    });

            return entries;
        }
        public ICollection<int> Deactivate(IntSeqKey controllerPath)
        {
            var mgmtInfo = _mgmt.Delete(controllerPath);

            if (_optionalHashes == null) {
                return MgmtInfoToIds(mgmtInfo);
            }

            var result = new List<int>();
            var entries = _optionalHashes
                .Where(entry => controllerPath.IsParentTo(entry.Key))
                .ToList();

            entries.ForEach(
                entry => {
                    result.Add(entry.Value);
                    _optionalHashes.Remove(entry.Key);
                });

            return result;
        }
        public void HashVisit(
            IntSeqKey controllerPath,
            BiConsumer<int, int> hashAndCPId)
        {
            if (_optionalHashes == null) {
                var mgmtInfo = _mgmt.Get(controllerPath);
                if (mgmtInfo == null || mgmtInfo.SubpathOrCPIdsPreallocate == null) {
                    return;
                }

                var subpathOrCPIds = mgmtInfo.SubpathOrCPIdsPreallocate;
                for (var i = 0; i < subpathOrCPIds.Length; i++) {
                    hashAndCPId.Invoke(i, subpathOrCPIds[i]);
                }

                return;
            }

            foreach (var entry in _optionalHashes) {
                if (controllerPath.IsParentTo(entry.Key)) {
                    hashAndCPId.Invoke(entry.Key.Last, entry.Value);
                }
            }
        }