MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / segment

Method segment

GPRS/ByteVector.cpp:120–136  ·  view source on GitHub ↗

Return a segment of a ByteVector that shares the same memory as the original.

Source from the content-addressed store, hash-verified

118
119// Return a segment of a ByteVector that shares the same memory as the original.
120ByteVector ByteVector::segment(size_t start, size_t span) const
121{
122#if NEW_SEGMENT_SEMANTICS
123 BVASSERT(start+span <= size());
124 ByteVector result(*this);
125 result.mStart = mStart + start;
126 result.mSizeBits = span*8;
127 //result.mEnd = result.mStart + span;
128 //BVASSERT(result.mEnd<=mEnd);
129 return result;
130#else
131 ByteType* wStart = mStart + start;
132 ByteType* wEnd = wStart + span;
133 BVASSERT(wEnd<=mEnd);
134 return ByteVector(wStart,wEnd);
135#endif
136}
137
138// This returns a segment that does not share ownership of the original memory,
139// so when the original is deleted, this is destroyed also, and without warning.

Callers 15

engineUpAdvanceWindowMethod · 0.80
GprsEncoderMethod · 0.80
transmitMethod · 0.80
decodeCS4Method · 0.80
parseDLUnitDataBodyMethod · 0.80
generateMidambleFunction · 0.80
getNormalSNRMethod · 0.80
writeVMethod · 0.80
parseBodyMethod · 0.80
writeLowSideRxMethod · 0.80
SharedL1DecoderMethod · 0.80
SharedL1EncoderMethod · 0.80

Calls 1

ByteVectorClass · 0.85

Tested by 1

origTestFunction · 0.64