本文整理汇总了C++中AutoArray::get方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::get方法的具体用法?C++ AutoArray::get怎么用?C++ AutoArray::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoArray
的用法示例。
在下文中一共展示了AutoArray::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
void write(iterator rsa, iterator rse)
{
lock.lock();
expandBuf(rse-rsa);
std::copy ( rsa, rse, buf.get() );
u_int8_t const * sa = buf.get();
u_int8_t const * se = sa + (rse-rsa);
while ( sa != se )
{
ssize_t const wr = ::write(fd,sa,se-sa);
if ( wr <= 0 )
{
switch ( errno )
{
case EINTR:
break;
default:
std::cerr << "write() failed with error code " << errno << ": " << strerror(errno) << " wr " << wr << std::endl;
throw std::runtime_error("write() failed.");
break;
}
}
else
{
sa += wr;
}
}
lock.unlock();
}
示例2: RangeVector
RangeVector(std::vector < std::pair < std::string, u_int64_t > > const & rranges)
: ranges(rranges), AB ( fillRange(ranges) ), B ( AB.get() ),
R(B, ((ranges.at(ranges.size()-1).second+1+63)/64)*64 )
{
#if 0
for ( u_int64_t i = 0; i <= ranges.back().second; ++i )
std::cerr << Rank::getBit(B,i) << "(" << R.rank1(i)-1 << ")";
std::cerr << std::endl;
#endif
}
示例3: setup
void setup(unsigned int npatl)
{
if ( npatl > maxpatl )
{
ABstraight = AutoArray<u_int64_t>(RestMatch<sse4>::getRestWords(npatl,seedl));
Bstraight = ABstraight.get();
ABreverse = AutoArray<u_int64_t>(RestMatch<sse4>::getRestWords(npatl,seedl));
Breverse = ABreverse.get();
maxpatl = npatl;
}
if ( npatl != patl )
{
patl = npatl;
numrestwords = RestMatch<sse4>::getRestWords(patl,seedl);
fullrestwords = RestMatch<sse4>::getFullRestWords(patl, seedl);
fracrestsyms = RestMatch<sse4>::getFracRestSyms(patl, seedl, fullrestwords);
straighttextrestoffset = RestMatch<sse4>::getTextRestOffset(patl, seedl, false);
reversetextrestoffset = RestMatch<sse4>::getTextRestOffset(patl, seedl, true);
straightmatchoffset = RestMatch<sse4>::getMatchOffset(patl, seedl, false);
reversematchoffset = RestMatch<sse4>::getMatchOffset(patl, seedl, true);
}
}
示例4: get
void get(ReadIterator & source, PlanetNodeStatusMessageData &d)
{
get(source,d.m_x);
get(source,d.m_z);
get(source,d.m_loaded);
AutoArray<uint32> temp;
get(source,temp);
d.m_servers=temp.get();
AutoArray<int> temp2;
get(source,temp2);
d.m_subscriptionCounts=temp2.get();
}
示例5: fillRange
static AutoArray<u_int64_t> fillRange(
std::vector < std::pair < std::string, u_int64_t > > const & ranges
)
{
AutoArray<u_int64_t> AB ( (ranges.at(ranges.size()-1).second+1+63)/64 );
for ( u_int64_t i = 0; i < (ranges.at(ranges.size()-1).second+1+63)/64; ++i )
AB[i] = 0;
Rank::BitWriter8 W(AB.get());
for ( unsigned int j = 0; j+1 < ranges.size(); ++j )
{
u_int64_t len = ranges[j+1].second-ranges[j].second;
W.writeBit(true);
for ( u_int64_t i = 1; i < len; ++i )
W.writeBit(false);
}
W.writeBit(true);
W.flush();
return AB;
}