本文整理汇总了C++中UList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ UList::begin方法的具体用法?C++ UList::begin怎么用?C++ UList::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UList
的用法示例。
在下文中一共展示了UList::begin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Foam::processorLduInterface::receive
(
const Pstream::commsTypes commsType,
UList<Type>& f
) const
{
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
{
IPstream::read
(
commsType,
neighbProcNo(),
reinterpret_cast<char*>(f.begin()),
f.byteSize(),
tag()
);
}
else if (commsType == Pstream::nonBlocking)
{
memcpy(f.begin(), receiveBuf_.begin(), f.byteSize());
}
else
{
FatalErrorIn("processorLduInterface::receive")
<< "Unsupported communications type " << commsType
<< exit(FatalError);
}
}
示例2: if
void Foam::processorLduInterface::send
(
const Pstream::commsTypes commsType,
const UList<Type>& f
) const
{
label nBytes = f.byteSize();
if
(
commsType == Pstream::commsTypes::blocking
|| commsType == Pstream::commsTypes::scheduled
)
{
OPstream::write
(
commsType,
neighbProcNo(),
reinterpret_cast<const char*>(f.begin()),
nBytes,
tag(),
comm()
);
}
else if (commsType == Pstream::commsTypes::nonBlocking)
{
resizeBuf(receiveBuf_, nBytes);
IPstream::read
(
commsType,
neighbProcNo(),
receiveBuf_.begin(),
nBytes,
tag(),
comm()
);
resizeBuf(sendBuf_, nBytes);
memcpy(sendBuf_.begin(), f.begin(), nBytes);
OPstream::write
(
commsType,
neighbProcNo(),
sendBuf_.begin(),
nBytes,
tag(),
comm()
);
}
else
{
FatalErrorInFunction
<< "Unsupported communications type " << int(commsType)
<< exit(FatalError);
}
}
示例3: if
bool Foam::UList<T>::operator<(const UList<T>& a) const
{
for
(
const_iterator vi = begin(), ai = a.begin();
vi < end() && ai < a.end();
vi++, ai++
)
{
if (*vi < *ai)
{
return true;
}
else if (*vi > *ai)
{
return false;
}
}
if (this->size_ < a.size_)
{
return true;
}
else
{
return false;
}
}
示例4: shuffle
void Foam::shuffle(UList<T>& a)
{
std::random_shuffle(a.begin(), a.end());
}
示例5: stableSort
void Foam::stableSort(UList<T>& a, const Cmp& cmp)
{
std::stable_sort(a.begin(), a.end(), cmp);
}