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

Method copyToSegment

GPRS/ByteVector.cpp:169–179  ·  view source on GitHub ↗

Copy part of this ByteVector to a segment of another. The specified span must not exceed our size, and it must fit in the target ByteVector. Unlike Vector, the size() of other is increased to make it fit, up to the allocated size.

Source from the content-addressed store, hash-verified

167// The specified span must not exceed our size, and it must fit in the target ByteVector.
168// Unlike Vector, the size() of other is increased to make it fit, up to the allocated size.
169void ByteVector::copyToSegment(ByteVector& other, size_t start, size_t span) const
170{
171 ByteType* base = other.mStart + start;
172 BVASSERT(start <= other.size()); // If start == size(), nothing is copied.
173 BVASSERT(base+span<=other.mAllocEnd);
174 //BVASSERT(mStart+span<=mEnd);
175 //BVASSERT(base+span<=other.mAllocEnd);
176 memcpy(base,mStart,span);
177 //if (base+span > other.mEnd) { other.mEnd = base+span; } // Increase other.size() if necessary.
178 if (other.size() < start+span) { other.mSizeBits = (start+span)*8; }
179}
180
181/** Copy all of this Vector to a segment of another Vector. */
182void ByteVector::copyToSegment(ByteVector& other, size_t start /*=0*/) const

Callers 15

transmitMethod · 0.80
initBurstsMethod · 0.80
encodeCS4Method · 0.80
decodeLowSideFunction · 0.80
L2FrameMethod · 0.80
l2WriteHighSideMethod · 0.80
processBurstMethod · 0.80
encodeFrame41Method · 0.80
XCCHL1EncoderMethod · 0.80
sendFrameMethod · 0.80
transmitMethod · 0.80
SCHL1EncoderMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected