SDSL 3.0.1
Succinct Data Structure Library
Loading...
Searching...
No Matches
sdsl::int_vector_buffer< t_width > Class Template Reference

#include <int_vector_buffer.hpp>

Classes

class  iterator
 
class  reference
 

Public Types

typedef int_vector< t_width >::difference_type difference_type
 
typedef int_vector< t_width >::value_type value_type
 

Public Member Functions

 int_vector_buffer ()
 Constructor.
 
 int_vector_buffer (const std::string filename, std::ios::openmode mode=std::ios::in, const uint64_t buffer_size=1024 *1024, const uint8_t int_width=t_width, const bool is_plain=false)
 Constructor for int_vector_buffer.
 
 int_vector_buffer (int_vector_buffer &&ivb)
 Move constructor.
 
 ~int_vector_buffer ()
 Destructor.
 
int_vector_buffer< t_width > & operator= (int_vector_buffer &&ivb)
 Move assignment operator.
 
uint8_t width () const
 Returns the width of the integers which are accessed via the [] operator.
 
uint64_t size () const
 Returns the number of elements currently stored.
 
std::string filename () const
 Returns the filename.
 
uint64_t buffersize () const
 Returns the buffersize in bytes.
 
void buffersize (uint64_t buffersize)
 Set the buffersize in bytes.
 
bool good ()
 Returns whether state of underlying streams are good.
 
bool is_open ()
 Returns whether underlying streams are currently associated to a file.
 
void reset ()
 Delete all content and set size to 0.
 
reference operator[] (uint64_t idx)
 [] operator
 
void push_back (const uint64_t value)
 Appends the given element value to the end of the int_vector_buffer.
 
void close (bool remove_file=false)
 Close the int_vector_buffer.
 
iterator begin ()
 
iterator end ()
 

Detailed Description

template<uint8_t t_width = 0>
class sdsl::int_vector_buffer< t_width >

Definition at line 24 of file int_vector_buffer.hpp.

Member Typedef Documentation

◆ difference_type

template<uint8_t t_width = 0>
typedef int_vector<t_width>::difference_type sdsl::int_vector_buffer< t_width >::difference_type

Definition at line 28 of file int_vector_buffer.hpp.

◆ value_type

template<uint8_t t_width = 0>
typedef int_vector<t_width>::value_type sdsl::int_vector_buffer< t_width >::value_type

Definition at line 29 of file int_vector_buffer.hpp.

Constructor & Destructor Documentation

◆ int_vector_buffer() [1/3]

template<uint8_t t_width = 0>
sdsl::int_vector_buffer< t_width >::int_vector_buffer ( )
inline

Constructor.

Definition at line 113 of file int_vector_buffer.hpp.

◆ int_vector_buffer() [2/3]

template<uint8_t t_width = 0>
sdsl::int_vector_buffer< t_width >::int_vector_buffer ( const std::string  filename,
std::ios::openmode  mode = std::ios::in,
const uint64_t  buffer_size = 1024 * 1024,
const uint8_t  int_width = t_width,
const bool  is_plain = false 
)
inline

Constructor for int_vector_buffer.

Parameters
filenameFile that contains the data read from / written to.
modeOpenmode: std::ios::in opens an existing file (that must exist already), std::ios::out creates a new file (that may exist already).
buffersizeBuffersize in bytes. This has to be a multiple of 8, if not the next multiple of 8 will be taken
int_widthThe width of each integer.
is_plainIf false (default) the file will be interpreted as int_vector. If true the file will be interpreted as plain array with t_width bits per integer. In second case (is_plain==true), t_width must be 8, 16, 32 or 64.

Definition at line 125 of file int_vector_buffer.hpp.

◆ int_vector_buffer() [3/3]

template<uint8_t t_width = 0>
sdsl::int_vector_buffer< t_width >::int_vector_buffer ( int_vector_buffer< t_width > &&  ivb)
inline

Move constructor.

Definition at line 172 of file int_vector_buffer.hpp.

◆ ~int_vector_buffer()

template<uint8_t t_width = 0>
sdsl::int_vector_buffer< t_width >::~int_vector_buffer ( )
inline

Destructor.

Definition at line 198 of file int_vector_buffer.hpp.

Member Function Documentation

◆ begin()

template<uint8_t t_width = 0>
iterator sdsl::int_vector_buffer< t_width >::begin ( )
inline

Definition at line 342 of file int_vector_buffer.hpp.

◆ buffersize() [1/2]

template<uint8_t t_width = 0>
uint64_t sdsl::int_vector_buffer< t_width >::buffersize ( ) const
inline

Returns the buffersize in bytes.

Definition at line 239 of file int_vector_buffer.hpp.

◆ buffersize() [2/2]

template<uint8_t t_width = 0>
void sdsl::int_vector_buffer< t_width >::buffersize ( uint64_t  buffersize)
inline

Set the buffersize in bytes.

Definition at line 246 of file int_vector_buffer.hpp.

◆ close()

template<uint8_t t_width = 0>
void sdsl::int_vector_buffer< t_width >::close ( bool  remove_file = false)
inline

Close the int_vector_buffer.

It is not possible to read from / write into the int_vector_buffer after calling this method

Parameters
remove_fileIf true, the underlying file will be removed on closing.

Definition at line 311 of file int_vector_buffer.hpp.

◆ end()

template<uint8_t t_width = 0>
iterator sdsl::int_vector_buffer< t_width >::end ( )
inline

Definition at line 344 of file int_vector_buffer.hpp.

◆ filename()

template<uint8_t t_width = 0>
std::string sdsl::int_vector_buffer< t_width >::filename ( ) const
inline

Returns the filename.

Definition at line 236 of file int_vector_buffer.hpp.

◆ good()

template<uint8_t t_width = 0>
bool sdsl::int_vector_buffer< t_width >::good ( )
inline

Returns whether state of underlying streams are good.

Definition at line 266 of file int_vector_buffer.hpp.

◆ is_open()

template<uint8_t t_width = 0>
bool sdsl::int_vector_buffer< t_width >::is_open ( )
inline

Returns whether underlying streams are currently associated to a file.

Definition at line 269 of file int_vector_buffer.hpp.

◆ operator=()

template<uint8_t t_width = 0>
int_vector_buffer< t_width > & sdsl::int_vector_buffer< t_width >::operator= ( int_vector_buffer< t_width > &&  ivb)
inline

Move assignment operator.

Definition at line 201 of file int_vector_buffer.hpp.

◆ operator[]()

template<uint8_t t_width = 0>
reference sdsl::int_vector_buffer< t_width >::operator[] ( uint64_t  idx)
inline

[] operator

Parameters
iIndex the i-th integer of length width().
Returns
A reference to the i-th integer of length width().

Definition at line 302 of file int_vector_buffer.hpp.

◆ push_back()

template<uint8_t t_width = 0>
void sdsl::int_vector_buffer< t_width >::push_back ( const uint64_t  value)
inline

Appends the given element value to the end of the int_vector_buffer.

Definition at line 305 of file int_vector_buffer.hpp.

◆ reset()

template<uint8_t t_width = 0>
void sdsl::int_vector_buffer< t_width >::reset ( )
inline

Delete all content and set size to 0.

Definition at line 276 of file int_vector_buffer.hpp.

◆ size()

template<uint8_t t_width = 0>
uint64_t sdsl::int_vector_buffer< t_width >::size ( ) const
inline

Returns the number of elements currently stored.

Definition at line 233 of file int_vector_buffer.hpp.

◆ width()

template<uint8_t t_width = 0>
uint8_t sdsl::int_vector_buffer< t_width >::width ( ) const
inline

Returns the width of the integers which are accessed via the [] operator.

Definition at line 230 of file int_vector_buffer.hpp.


The documentation for this class was generated from the following file: