ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
MMappedVector.hpp File Reference

Template implementation of MMappedVector<T>. More...

#include "MMappedVector.h"
#include <cassert>
#include <cerrno>
#include <cstring>
#include <new>
#include <stdexcept>
#include <vector>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
Include dependency graph for MMappedVector.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Template implementation of MMappedVector<T>.

Provides the out-of-line definitions of all MMappedVector<T> methods declared in MMappedVector.h. This file must be included by any translation unit that instantiates MMappedVector<T> for a specific T.

Implemented methods:

  • MMappedVector(): open/create the backing file and map it.
  • ~MMappedVector(): sync and unmap.
  • operator[](k) const: read element k.
  • operator[](k): write element k.
  • add(): append one element, growing the file if necessary.
  • sync(): flush dirty pages with msync().

Internal helpers:

  • mmap(): map (or remap) length bytes.
  • grow(): double the capacity and remap.

Definition in file MMappedVector.hpp.