Beispiel #1
0
    Slice::Slice(Shard& shard, std::istream& input)
        : m_shard(shard),
          m_capacity(shard.GetSliceCapacity()),
          m_refCount(1),
          m_buffer(shard.LoadSliceBuffer(input)),
          m_unallocatedCount(StreamUtilities::ReadField<DocIndex>(input)),
          m_commitPendingCount(StreamUtilities::ReadField<DocIndex>(input)),
          m_expiredCount(StreamUtilities::ReadField<DocIndex>(input))
    {
        // Initializes the slice buffer, place pointer to a Slice at the 
        // specific offset as indicated by Shard.
        Initialize();

        // Perform loading of the DocTable contents which is not part of the 
        // SliceBuffer.
        GetDocTable().LoadVariableSizeBlobs(m_buffer, input);

        // No need to initialize RowTable buffers since they are simply part of 
        // the SliceBuffer which has been already loaded by the call to ReadBytes
        // above.
    }