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

Method setSegment

GPRS/ByteVector.cpp:154–164  ·  view source on GitHub ↗

Copy other to this starting at start. The 'this' ByteVector must be allocated large enough to hold other. Unlike Vector, the size() is increased to make it fit, up to the allocated size.

Source from the content-addressed store, hash-verified

152// The 'this' ByteVector must be allocated large enough to hold other.
153// Unlike Vector, the size() is increased to make it fit, up to the allocated size.
154void ByteVector::setSegment(size_t start, ByteVector&other)
155{
156 BVASSERT(start <= size()); // If start == size(), nothing is copied.
157 BVASSERT(bitind() == 0); // This function only allowed on byte-aligned data.
158 ByteType* base = mStart + start;
159 int othersize = other.size();
160 BVASSERT(mAllocEnd - base >= othersize);
161 memcpy(base,other.mStart,othersize);
162 //if (mEnd - base < othersize) { mEnd = base + othersize; } // Grow size() if necessary.
163 if (mSizeBits/8 < start+othersize) { mSizeBits = (start+othersize)*8; }
164}
165
166// Copy part of this ByteVector to a segment of another.
167// The specified span must not exceed our size, and it must fit in the target ByteVector.

Callers 1

engineWriteHighSideMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected