当前位置: 首页>>代码示例>>C++>>正文


C++ AutoArray::end方法代码示例

本文整理汇总了C++中libmaus2::autoarray::AutoArray::end方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::end方法的具体用法?C++ AutoArray::end怎么用?C++ AutoArray::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libmaus2::autoarray::AutoArray的用法示例。


在下文中一共展示了AutoArray::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: seekoff

			::std::streampos seekpos(::std::streampos sp, ::std::ios_base::openmode which = ::std::ios_base::in | ::std::ios_base::out)
			{
				if ( which & ::std::ios_base::in )
				{
					int64_t const cur = symsread-(egptr()-gptr());
					int64_t const curlow = cur - static_cast<int64_t>(gptr()-eback());
					int64_t const curhigh = cur + static_cast<int64_t>(egptr()-gptr());
					
					// call relative seek, if target is in range
					if ( sp >= curlow && sp <= curhigh )
						return seekoff(static_cast<int64_t>(sp) - cur, ::std::ios_base::cur, which);

					// target is out of range, we really need to seek
					uint64_t tsymsread = (sp / buffersize)*buffersize;
					
					symsread = tsymsread;
					stream.clear();
					stream.seekg( (symsread * b) / 8 );
					setg(buffer.end(),buffer.end(),buffer.end());
					underflow();
					setg(eback(),gptr() + (static_cast<int64_t>(sp)-static_cast<int64_t>(tsymsread)), egptr());
				
					return sp;
				}
				
				return -1;
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:27,代码来源:PacDecoderBuffer.hpp

示例2: init

			void init(bool const repos)
			{
				// set empty buffer
				setgchecked(buffer.end(), buffer.end(), buffer.end());
				// seek
				if ( repos )
					fd->lseek(symsread,SEEK_SET);
			}
开发者ID:jameslz,项目名称:libmaus2,代码行数:8,代码来源:MemoryInputStreamBuffer.hpp

示例3: stream

			StreamWrapperBuffer(stream_type & rstream, ::std::size_t rbuffersize, std::size_t rpushbackspace)
			: stream(rstream), 
			  buffersize(rbuffersize),
			  pushbackspace(rpushbackspace),
			  buffer(buffersize+pushbackspace,false), streamreadpos(0)
			{
				setg(buffer.end(), buffer.end(), buffer.end());	
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:8,代码来源:StreamWrapperBuffer.hpp

示例4: init

			void init(bool const repos)
			{
				// set empty buffer
				setgchecked(buffer.end(), buffer.end(), buffer.end());
				// seek
				if ( repos )
					stream.lseek(symsread);
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:8,代码来源:PosixFdInputStreamBuffer.hpp

示例5: stream

			SocketInputStreamBuffer(::libmaus2::network::SocketInputInterface & rstream, uint64_t const rblocksize, uint64_t const rputbackspace = 0)
			: 
			  stream(rstream),
			  blocksize(rblocksize),
			  putbackspace(rputbackspace),
			  buffer(putbackspace + blocksize,false)
			{
				// set empty buffer
				setg(buffer.end(), buffer.end(), buffer.end());
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:10,代码来源:SocketInputStreamBuffer.hpp

示例6: CircularReverseBufferTemplate

 /**
  * constructor from input stream
  *
  * @param rstream input stream
  * @param offset start offset in file
  * @param rbuffersize size of streambuf buffer
  * @param rpushbackspace size of push back buffer
  **/
 CircularReverseBufferTemplate(std::basic_istream<char_type> & rstream, uint64_t const offset, ::std::size_t rbuffersize, std::size_t rpushbackspace)
     : Pstream(),
       stream(rstream),
       buffersize(rbuffersize),
       pushbackspace(rpushbackspace),
       buffer(buffersize+pushbackspace,false), streamreadpos(0),
       infilesize(::libmaus2::util::GetFileSize::getFileSize(stream))
 {
     stream.seekg(offset);
     base_type::setg(buffer.end(), buffer.end(), buffer.end());
 }
开发者ID:jmarshall,项目名称:libmaus2,代码行数:19,代码来源:CircularBuffer.hpp

示例7: nm

			MdStringComputationContext()
			: T0(256,false), T1(256,false), nm(0)
			{
				std::fill(T0.begin(),T0.end(),4);
				std::fill(T1.begin(),T1.end(),5);
				T0['A'] = T0['a'] =  T1['A'] = T1['a'] = 0;
				T0['C'] = T0['c'] =  T1['C'] = T1['c'] = 1;
				T0['G'] = T0['g'] =  T1['G'] = T1['g'] = 2;
				T0['T'] = T0['t'] =  T1['T'] = T1['t'] = 3;
				auxvec.set("MD");
				auxvec.set("NM");
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:12,代码来源:MdStringComputationContext.hpp

示例8: fd

			MemoryInputOutputStreamBuffer(std::string const & fn, std::ios_base::openmode const cxxmode, int64_t const rbuffersize)
			: 
			  fd(doOpen(fn,cxxmode)), 
			  buffersize(rbuffersize < 0 ? getDefaultBlockSize() : rbuffersize), 
			  buffer(buffersize,false),
			  readpos(0),
			  writepos(0)
			{
				// empty get buffer
				setg(buffer.end(),buffer.end(),buffer.end());
				// empty put buffer
				setp(buffer.begin(),buffer.end()-1);
			}
开发者ID:jmarshall,项目名称:libmaus2,代码行数:13,代码来源:MemoryInputOutputStreamBuffer.hpp

示例9: loadFile

			static libmaus2::autoarray::AutoArray<char> loadFile(std::istream & in)
			{
				libmaus2::autoarray::AutoArray<char> C(1);
				uint64_t p = 0;
				
				while ( in )
				{
					in.read(C.begin() + p, C.size()-p);
					
					if ( ! in.gcount() )
						break;

					p += in.gcount();
					
					if ( p == C.size() )
					{
						libmaus2::autoarray::AutoArray<char> Cn(2*C.size(),false);
						std::copy(C.begin(),C.end(),Cn.begin());
						C = Cn;
					}
				}
				
				libmaus2::autoarray::AutoArray<char> Cn(p,false);
				std::copy(C.begin(),C.begin()+p,Cn.begin());
				
				return Cn;
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:27,代码来源:GeneFlatFile.hpp

示例10: Pstream

			ExternalMemoryIndexGenerator(std::string const & filename)
			: Pstream(libmaus2::aio::InputOutputStreamFactoryContainer::constructUnique(filename,std::ios::in|std::ios::out|std::ios::trunc|std::ios::binary)), stream(*Pstream), 
			  ic(0), flushed(false), writeCache(1024),
			  wa(writeCache.begin()), wc(wa), we(writeCache.end())
			{
			
			}
开发者ID:jameslz,项目名称:libmaus2,代码行数:7,代码来源:ExternalMemoryIndexGenerator.hpp

示例11: underflow

			int_type underflow()
			{
				if ( gptr() < egptr() )
					return static_cast<int_type>(*uptr());
					
				assert ( gptr() == egptr() );
					
				char * midptr = buffer.begin() + pushbackspace;
				uint64_t const copyavail = 
					std::min(
						// previously read
						static_cast<uint64_t>(gptr()-eback()),
						// space we have to copy into
						static_cast<uint64_t>(midptr-buffer.begin())
					);
				::std::memmove(midptr-copyavail,gptr()-copyavail,copyavail);

				stream.read(midptr, buffer.end()-midptr);
				size_t const n = stream.gcount();
				streamreadpos += n;

				setg(midptr-copyavail, midptr, midptr+n);

				if (!n)
					return traits_type::eof();
				
				return static_cast<int_type>(*uptr());
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:28,代码来源:StreamWrapperBuffer.hpp

示例12: fd

			LinuxStreamingPosixFdOutputStreamBuffer(std::string const & fn, int64_t const rbuffersize)
			: fd(doOpen(fn)), closefd(true), 
			  optblocksize((rbuffersize < 0) ? getOptimalIOBlockSize(fd,std::string()) : rbuffersize),
			  buffersize(optblocksize),
			  buffer(buffersize,false), prevwrite(0,0)
			{
				setp(buffer.begin(),buffer.end()-1);
			}
开发者ID:jameslz,项目名称:libmaus2,代码行数:8,代码来源:LinuxStreamingPosixFdOutputStreamBuffer.hpp

示例13: fd

			MemoryOutputStreamBuffer(std::string const & fn, int64_t const rbuffersize)
			: 
			  fd(doOpen(fn)), 
			  buffersize((rbuffersize < 0) ? getDefaultBlockSize() : rbuffersize), 
			  buffer(buffersize,false)
			{
				setp(buffer.begin(),buffer.end()-1);
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:8,代码来源:MemoryOutputStreamBuffer.hpp

示例14: B

			BgzfParallelRecodeDeflateBase()
			: B(getBgzfMaxBlockSize(),false), 
			  pa(B.begin()), 
			  pc(B.begin()), 
			  pe(B.end())
			{
			
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:8,代码来源:BgzfParallelRecodeDeflateBase.hpp

示例15: exec

                        void exec()
                        {
                                pid = fork();
                                
                                if ( pid < 0 )
                                {
                                        ::libmaus2::exception::LibMausException ex;
                                        ex.getStream() << "failed to fork: " << strerror(errno);
                                        ex.finish();
                                        throw ex;
                                }
                                
                                if ( ! pid )
                                {
                                	signal(SIGCHLD,sigchildhandler);
                                
                                        while ( true )
                                        {        
                                                try
                                                {
	                                                ::libmaus2::network::SocketBase::unique_ptr_type recsock = seso->accept();
	                                                
                                                        pid_t childpid = fork();
                                                        
                                                        if ( childpid == 0 )
                                                        {
                                                        	try
                                                        	{
                                                        		char const * ptr = data.begin();
                                                        		char const * ptre = data.end();
                                                        		uint64_t const bs = 4096;
                                                        		
                                                        		while ( ptr != ptre )
                                                        		{
                                                        			uint64_t const rest = ptre-ptr;
                                                        			uint64_t const towrite = std::min(bs,rest); 
                                                        			recsock->write(ptr,towrite);
                                                        			ptr += towrite;
                                                        		}
								}
								catch(std::exception const & ex)
								{
									std::cerr << ex.what() << std::endl;
								}

                                                                _exit(0);
                                                        }
                                                }
                                                catch(std::exception const & ex)
                                                {
                                                        std::cerr << "Error in SingleFileServer: " << ex.what() << std::endl;
                                                }
                                        }
                                
                                        _exit(0);
                                }
                        }
开发者ID:dkj,项目名称:libmaus2,代码行数:57,代码来源:SingleFileServer.hpp


注:本文中的libmaus2::autoarray::AutoArray::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。