INET Framework for OMNeT++/OMNEST
inet::ChunkBuffer::Region Class Reference

#include <ChunkBuffer.h>

Public Member Functions

 Region (b offset, const Ptr< const Chunk > &data)
 
 Region (const Region &other)
 
b getStartOffset () const
 
b getEndOffset () const
 

Static Public Member Functions

static bool compareStartOffset (const Region &a, const Region &b)
 
static bool compareEndOffset (const Region &a, const Region &b)
 

Public Attributes

b offset
 
Ptr< const Chunkdata
 This chunk is always immutable to allow arbitrary peeking. More...
 

Protected Member Functions

const ChunkgetData () const
 

Friends

class ChunkBuffer__RegionDescriptor
 

Constructor & Destructor Documentation

◆ Region() [1/2]

inet::ChunkBuffer::Region::Region ( b  offset,
const Ptr< const Chunk > &  data 
)
inline
52 : offset(offset), data(data) {}

◆ Region() [2/2]

inet::ChunkBuffer::Region::Region ( const Region other)
inline
53 : offset(other.offset), data(other.data) {}

Member Function Documentation

◆ compareEndOffset()

static bool inet::ChunkBuffer::Region::compareEndOffset ( const Region a,
const Region b 
)
inlinestatic
59 { return a.getEndOffset() < b.getEndOffset(); }

Referenced by inet::ChunkBuffer::sliceRegions().

◆ compareStartOffset()

static bool inet::ChunkBuffer::Region::compareStartOffset ( const Region a,
const Region b 
)
inlinestatic
58 { return a.getStartOffset() < b.getStartOffset(); }

Referenced by inet::ChunkBuffer::replace(), and inet::ChunkBuffer::sliceRegions().

◆ getData()

const Chunk* inet::ChunkBuffer::Region::getData ( ) const
inlineprotected
49 { return data.get(); } // only for class descriptor

◆ getEndOffset()

b inet::ChunkBuffer::Region::getEndOffset ( ) const
inline
56 { return offset + data->getChunkLength(); }

Referenced by compareEndOffset(), inet::ChunkBuffer::mergeRegions(), and inet::ChunkBuffer::sliceRegions().

◆ getStartOffset()

b inet::ChunkBuffer::Region::getStartOffset ( ) const
inline

Friends And Related Function Documentation

◆ ChunkBuffer__RegionDescriptor

friend class ChunkBuffer__RegionDescriptor
friend

Member Data Documentation

◆ data

Ptr<const Chunk> inet::ChunkBuffer::Region::data

This chunk is always immutable to allow arbitrary peeking.

Nevertheless it's reused if possible to allow efficient merging with newly added chunks.

Referenced by inet::ChunkBuffer::eraseEmptyRegions(), inet::ChunkBuffer::mergeRegions(), and inet::ChunkBuffer::sliceRegions().

◆ offset

b inet::ChunkBuffer::Region::offset

The documentation for this class was generated from the following file:
inet::ChunkBuffer::Region::data
Ptr< const Chunk > data
This chunk is always immutable to allow arbitrary peeking.
Definition: ChunkBuffer.h:46
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::ChunkBuffer::Region::offset
b offset
Definition: ChunkBuffer.h:41