Example #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine($"x64={Environment.Is64BitProcess}");

            FlatBufferSerializer inPlaceSorter = new FlatBufferSerializer(new FlatBufferSerializerOptions());

            Random             r         = new Random();
            SortedVector <int> intVector = new SortedVector <int>
            {
                Item = Enumerable.Range(0, 25).Select(x => new SortedVectorItem <int> {
                    Item = r.Next()
                }).ToList()
            };

            SortedVector <string> stringVector = new SortedVector <string>
            {
                Item = Enumerable.Range(0, 25).Select(x => new SortedVectorItem <string> {
                    Item = Guid.NewGuid().ToString()
                }).ToList()
            };

            UnsortedVector <string> unsortedString = new UnsortedVector <string> {
                Item = stringVector.Item
            };
            UnsortedVector <int> unsortedInt = new UnsortedVector <int> {
                Item = intVector.Item
            };

            byte[] buffer = new byte[10 * 1024 * 1024];
            var    items  = new (string, Action)[]
Example #2
0
 public void SortedVector()
 {
     int[] localData = new int[4] { 3, 7, 5, 8 };
     SortedVector<int> vector = new SortedVector<int>(localData);
     int actualValue = vector.Find(7);
     Assert.AreEqual(2, actualValue);
     int obj = 6;
     int[] expectedValue = {3, 5, 6, 7, 8, 0, 0, 0 };
     vector.Add(obj);
     CollectionAssert.AreEqual(expectedValue, vector.GetData());
 }