Пример #1
0
 public void WriteBinary(BinaryWriter w)
 {
     ConvertToImmutable();
     if (_existingValues == null)
     {
         _existingValues = new ImmutableStringStore(new String8Set(String8.Empty, 1, new PartialArray <int>()));
     }
     _existingValues.WriteBinary(w);
 }
Пример #2
0
        public void ReadBinary(BinaryReader r)
        {
            // All values are serialized in immutable form, so only an ImmutableStringStore is created on load
            ImmutableStringStore store = new ImmutableStringStore();

            store.ReadBinary(r);

            _addedValues    = null;
            _existingValues = store;
        }
Пример #3
0
        public bool ConvertToImmutable()
        {
            // If there are added values, we need to convert for serialization
            if (_addedValues != null)
            {
                if (_existingValues != null)
                {
                    // Need to implement index merging for this
                    throw new NotImplementedException();
                }
                else
                {
                    // Convert AddedValues to immutable form
                    _existingValues = _addedValues.ConvertToImmutable(out _addedIdentifierToExistingIdentifier);
                    _addedValues    = null;
                    return(true);
                }
            }

            return(false);
        }
Пример #4
0
 public void Clear()
 {
     _existingValues = null;
     _addedValues    = null;
     _addedIdentifierToExistingIdentifier = null;
 }