本文整理汇总了C++中libmaus::autoarray::AutoArray::get方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::get方法的具体用法?C++ AutoArray::get怎么用?C++ AutoArray::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libmaus::autoarray::AutoArray
的用法示例。
在下文中一共展示了AutoArray::get方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: putTerm
void putTerm(uint64_t num)
{
uint8_t * p = termbuf.get() + termbuf.getN();
for ( unsigned int i = 0; i < expo; ++i )
{
*(--p) = (num % base) + 1;
num /= base;
}
assert ( p == termbuf.get() );
for ( unsigned int i = 0; i < expo; ++i )
put( *(p++) );
}
示例2: bufsize
SynchronousGenericInput(
std::string const & filename,
uint64_t const rbufsize,
uint64_t const roffset = 0,
uint64_t const rtotalwords = std::numeric_limits<uint64_t>::max()
)
: bufsize(rbufsize), buffer(bufsize,false),
pa(buffer.get()), pc(pa), pe(pa),
Pistr(new ifstream_type(filename.c_str(),std::ios::binary)),
istr(*Pistr),
totalwords ( std::min ( ::libmaus::util::GetFileSize::getFileSize(filename) / sizeof(input_type) - roffset, rtotalwords) ),
totalwordsread(0),
checkmod(true)
{
if ( ! Pistr->is_open() )
{
::libmaus::exception::LibMausException se;
se.getStream() << "Unable to open file " << filename << ": " << strerror(errno);
se.finish();
throw se;
}
Pistr->seekg(roffset * sizeof(input_type), std::ios::beg);
if ( ! istr )
{
::libmaus::exception::LibMausException se;
se.getStream() << "Unable to seek file " << filename << ": " << strerror(errno);
se.finish();
throw se;
}
}
示例3: fillBuffer
bool fillBuffer()
{
assert ( totalwordsread <= totalwords );
uint64_t const remwords = totalwords-totalwordsread;
uint64_t const toreadwords = std::min(remwords,bufsize);
istr.read ( reinterpret_cast<char *>(buffer.get()), toreadwords * sizeof(input_type));
uint64_t const bytesread = istr.gcount();
if ( checkmod && (bytesread % sizeof(input_type) != 0) )
{
::libmaus::exception::LibMausException se;
se.getStream() << "SynchronousGenericInput::fillBuffer: Number of bytes " << bytesread << " read is not a multiple of entity type." << std::endl;
se.finish();
throw se;
}
uint64_t const wordsread = bytesread / sizeof(input_type);
if ( wordsread == 0 )
{
if ( totalwordsread != totalwords )
{
std::cerr << "SynchronousGenericInput<>::getNext(): WARNING: read 0 words but there should be " <<
remwords << " left." << std::endl;
}
return false;
}
pc = pa;
pe = pa + wordsread;
return true;
}
示例4: dst
SocketOutputBufferTemplate(
::libmaus::network::SocketBase * rdst,
int const rtag,
uint64_t const bufsize)
: dst(rdst), tag(rtag), B(bufsize), pa(B.get()), pc(pa), pe(pa+B.getN())
{
}
示例5: filename
AsynchronousBufferReader ( std::string const & rfilename,
uint64_t rnumbuffers = 16, uint64_t rbufsize = 32, uint64_t roffset = 0 )
: filename(rfilename),
fd( open(filename.c_str(),O_RDONLY ) ),
numbuffers(rnumbuffers), bufsize(rbufsize),
bufferspace ( numbuffers * bufsize ),
buffers ( numbuffers ),
contexts(numbuffers), low(0), high(0), offset(roffset)
{
if ( fd < 0 )
{
::libmaus::exception::LibMausException se;
se.getStream() << "::libmaus::aio::AsynchronousBufferReader: Failed to open file " << filename << ": " << strerror(errno);
se.finish();
/*
std::cerr << se.s << std::endl;
kill ( getpid(), SIGSTOP );
*/
throw se;
}
for ( unsigned int i = 0; i < numbuffers; ++i )
buffers[i] = bufferspace.get() + i*bufsize;
while ( high < numbuffers )
enqueRead();
}
示例6: B
/**
* constructor
*
* @param rW output writer
* @param bufsize size of buffer
* @param rmetaid meta information for each written block
**/
MetaOutputBuffer8(
::libmaus::aio::AsynchronousWriter & rW,
uint64_t const bufsize,
uint64_t const rmetaid)
: B(bufsize), pa(B.get()), pc(pa), pe(pa+B.getN()), W(rW), metaid(rmetaid)
{
}
示例7: atable
CharTermTable(uint8_t c)
: atable(257), table(atable.get()+1)
{
for ( unsigned int i = 0; i < 256; ++i )
table[i] = false;
table[-1] = true;
table[c] = true;
}
示例8: ostr
SynchronousOutputBuffer8(std::string const & rfilename, uint64_t const bufsize, bool truncate = true)
: filename(rfilename), B(bufsize), pa(B.get()), pc(pa), pe(pa+B.getN())
{
if ( truncate )
{
std::ofstream ostr(filename.c_str(), std::ios::binary);
ostr.flush();
}
}
示例9: bufsize
AsynchronousBufferReader(
std::string const & filename,
uint64_t const rnumbufs,
uint64_t const rbufsize,
uint64_t const offset
)
: std::ifstream(filename.c_str()), bufsize(rnumbufs * rbufsize),
abuffer(bufsize), buffer(abuffer.get()), av(true)
{
std::ifstream::seekg(offset,std::ios::beg);
}
示例10: filename
SynchronousOutputBuffer8Posix(std::string const & rfilename, uint64_t const bufsize, bool truncate = true)
: filename(rfilename), B(bufsize), pa(B.get()), pc(pa), pe(pa+B.getN()), ptr(0)
{
if ( truncate )
{
int const tres = ::truncate(filename.c_str(),0);
if ( tres )
{
::libmaus::exception::LibMausException se;
se.getStream() << "SynchronousOutputBuffer8Posix::SynchronousOutputBuffer8Posix(): truncate() failed: " << strerror(errno) << std::endl;
se.finish();
throw se;
}
}
}
示例11: SynchronousGenericOutputPosix
SynchronousGenericOutputPosix(
std::string const & rfilename,
uint64_t const bufsize,
bool const truncate,
uint64_t const offset,
bool const rmetasync = true
)
: filename(rfilename), dirname(::libmaus::util::ArgInfo::getDirName(filename)), metasync(rmetasync),
B(bufsize), pa(B.get()), pc(pa), pe(pa+B.getN()),
fd ( -1 ),
totalwrittenbytes(0), totalwrittenwords(0)
{
while ( (fd = ::open(filename.c_str(), truncate ? (O_WRONLY|O_TRUNC|O_CREAT) : O_WRONLY , 0755 )) < 0 )
{
switch ( errno )
{
case EINTR:
{
std::cerr << "Restarting open() system call interupted by signal." << std::endl;
break;
}
default:
{
::libmaus::exception::LibMausException se;
se.getStream() << "Failed to open file "<< filename <<" in SynchronousGenericOutputPosix: " <<
strerror(errno);
se.finish();
throw se;
}
}
}
if ( lseek ( fd, offset, SEEK_SET) == static_cast<off_t>(-1) )
{
close(fd);
::libmaus::exception::LibMausException se;
se.getStream() << "Failed to seek " << filename << " in SynchronousGenericOutputPosix: " <<
strerror(errno);
se.finish();
throw se;
}
#if 0
std::cerr << "File " << filename << " opened for output in "
<< ::libmaus::util::Demangle::demangle<this_type>() << std::endl;
#endif
}
示例12: writeBuffer
void writeBuffer()
{
if ( pc-pa )
dst->writeMessage ( tag , B.get() , pc-pa );
pc = pa;
}
示例13: s
SlowCumFreq(uint64_t rs)
: s(rs), A(s,false)
{
std::fill(A.get(),A.get()+s,0);
}