本文整理汇总了C++中BitArray::putAll方法的典型用法代码示例。如果您正苦于以下问题:C++ BitArray::putAll方法的具体用法?C++ BitArray::putAll怎么用?C++ BitArray::putAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitArray
的用法示例。
在下文中一共展示了BitArray::putAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
void FullContainerKey::deserialize(util::StackAllocator &alloc,
FullContainerKeyComponents &components,
BitArray &upperCaseBit,
bool unNormalized) const {
try {
if (isEmpty()) {
GS_THROW_USER_ERROR(GS_ERROR_DS_DS_CONTAINER_NAME_INVALID,
"container/table name is empty");
}
components.clear();
upperCaseBit.clear();
ContainerKeyInStream in(util::ArrayInStream(body_, size_));
const char8_t *normalizedStr[3] = { NULL, NULL, NULL };
uint8_t flag;
in >> flag;
if (flag & DBID_EXISTS) {
in >> components.dbId_;
}
else {
components.dbId_ = GS_PUBLIC_DB_ID;
}
components.baseNameSize_ = decodeVarInt(in);
normalizedStr[0] = reinterpret_cast<const char8_t*>(body_ + in.base().position());
in.base().position(in.base().position() + components.baseNameSize_);
if (flag & LARGE_CONTAINERID_EXISTS) {
components.largeContainerId_ = decodeVarLong(in);
}
if (flag & NODE_AFFINITY_NUM) {
components.affinityNumber_ = decodeVarLong(in);
}
else if (flag & NODE_AFFINITY_STR) {
components.affinityStringSize_ = decodeVarInt(in);
normalizedStr[1] = reinterpret_cast<const char8_t*>(body_ + in.base().position());
in.base().position(in.base().position() + components.affinityStringSize_);
}
if (flag & SYSTEM_PART_ID_NUM) {
components.systemPartId_ = decodeVarLong(in);
}
else if (flag & SYSTEM_PART_ID_STR) {
components.systemPartSize_ = decodeVarInt(in);
normalizedStr[2] = reinterpret_cast<const char8_t*>(body_ + in.base().position());
in.base().position(in.base().position() + components.systemPartSize_);
}
const uint64_t strLength = components.baseNameSize_
+ components.affinityStringSize_
+ components.systemPartSize_;
if (in.base().remaining() != strLengthToBitLength(strLength)) {
GS_THROW_USER_ERROR(GS_ERROR_DS_DS_CONTAINER_NAME_INVALID,
"size of container/table name is invalid");
}
else {
upperCaseBit.reserve(strLength);
upperCaseBit.putAll(body_ + in.base().position(), strLength);
in.base().position(in.base().position() + in.base().remaining());
}
if (in.base().position() != size_) {
GS_THROW_USER_ERROR(GS_ERROR_DS_DS_CONTAINER_NAME_INVALID,
"size of container/table name is invalid");
}
if (unNormalized) {
util::XArray<char8_t> buf(alloc);
buf.resize(static_cast<size_t>(strLength), '\0');
uint64_t startPos = 0;
createOriginalString(normalizedStr[0], components.baseNameSize_,
buf.data()+startPos, upperCaseBit, startPos);
components.baseName_ = buf.data()+startPos;
startPos += components.baseNameSize_;
if (components.affinityStringSize_ > 0) {
createOriginalString(normalizedStr[1], components.affinityStringSize_,
buf.data()+startPos, upperCaseBit, startPos);
components.affinityString_ = buf.data()+startPos;
startPos += components.affinityStringSize_;
}
if (components.systemPartSize_ > 0) {
createOriginalString(normalizedStr[2], components.systemPartSize_,
buf.data()+startPos, upperCaseBit, startPos);
components.systemPart_ = buf.data()+startPos;
startPos += components.systemPartSize_;
}
}
else {
components.baseName_ = normalizedStr[0];
if (components.affinityStringSize_ > 0) {
//.........这里部分代码省略.........