2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-22 01:59:10 +00:00
qpdf/libqpdf/qpdf/SparseOHArray.hh
Jay Berkenbilt 07edf96440 Remove methods of private classes from ABI
Prior to the cmake conversion, several private classes had methods
that were exported into the shared library so they could be tested
with libtests. With cmake, we build libtests using an object library,
so this is no longer necessary. The methods that are disappearing from
the ABI were never exposed through public headers, so no code should
be using them. Removal had to wait until the window for ABI-breaking
changes was open.
2022-04-09 17:33:29 -04:00

31 lines
755 B
C++

#ifndef QPDF_SPARSEOHARRAY_HH
#define QPDF_SPARSEOHARRAY_HH
#include <qpdf/QPDFObjectHandle.hh>
#include <unordered_map>
class SparseOHArray
{
public:
SparseOHArray();
size_t size() const;
void append(QPDFObjectHandle oh);
QPDFObjectHandle at(size_t idx) const;
void remove_last();
void releaseResolved();
void setAt(size_t idx, QPDFObjectHandle oh);
void erase(size_t idx);
void insert(size_t idx, QPDFObjectHandle oh);
typedef std::unordered_map<size_t, QPDFObjectHandle>::const_iterator
const_iterator;
const_iterator begin() const;
const_iterator end() const;
private:
std::unordered_map<size_t, QPDFObjectHandle> elements;
size_t n_elements;
};
#endif // QPDF_SPARSEOHARRAY_HH