Speclib  0.1.2
The library for writing better CUDA libraries
sp::StringViewBatch< CharT, IntPairT > Class Template Reference

Represents a batch of StringViews that all share the same underlying string buffer. More...

#include <StringViewBatch.hpp>

Public Member Functions

 StringViewBatch (int concatenatedLength, sp::Vector< CharT > &&stringBuffer, sp::Vector< IntPairT > &&stringOffsetsAndLengths)
 
int size () const
 Get the number of string views in the batch. More...
 
sp::Vec< int, 2 > orderedPair (int i) const
 Get the (offset, length) ordered pair for the nth StringView. More...
 
sp::StringView< CharT > read (int i) const
 Read the i'th StringView out of this container. More...
 
int getTotalLength () const
 

Detailed Description

template<typename CharT, typename IntPairT>
class sp::StringViewBatch< CharT, IntPairT >

Represents a batch of StringViews that all share the same underlying string buffer.

These objects are constructed using the deviceView, hostView, mutableDeviceView and mutableHostView methods of StringBatch, and consequently share the same memory layout as StringBatch.

Member Function Documentation

◆ orderedPair()

template<typename CharT , typename IntPairT >
sp::Vec< int, 2 > sp::StringViewBatch< CharT, IntPairT >::orderedPair ( int  i) const

Get the (offset, length) ordered pair for the nth StringView.

◆ read()

template<typename CharT , typename IntPairT >
sp::StringView< CharT > sp::StringViewBatch< CharT, IntPairT >::read ( int  i) const

Read the i'th StringView out of this container.

◆ size()

template<typename CharT , typename IntPairT >
int sp::StringViewBatch< CharT, IntPairT >::size ( ) const

Get the number of string views in the batch.