Tree Compression with Top Trees Revisited
Public Member Functions | Public Attributes | List of all members
Labels< Value > Struct Template Reference

A key-value label storage. More...

#include <Labels.h>

Inheritance diagram for Labels< Value >:
Inheritance graph
[legend]
Collaboration diagram for Labels< Value >:
Collaboration graph
[legend]

Public Member Functions

 Labels (int sizeHint=0)
 
const Value & operator[] (uint index) const
 
void set (uint id, const Value &value)
 
uint size () const
 
uint numKeys () const
 

Public Attributes

std::vector< int > keys
 
std::vector< const Value * > valueIndex
 
std::unordered_map< Value, int > values
 

Detailed Description

template<typename Value>
struct Labels< Value >

A key-value label storage.

A double-indexed key-value label storage, allowing efficient access by ID and efficient non-duplicating setting of labels

Definition at line 107 of file Labels.h.

Constructor & Destructor Documentation

template<typename Value>
Labels< Value >::Labels ( int  sizeHint = 0)
inline

Definition at line 108 of file Labels.h.

Member Function Documentation

template<typename Value>
uint Labels< Value >::numKeys ( ) const
inline

Definition at line 136 of file Labels.h.

template<typename Value>
const Value& Labels< Value >::operator[] ( uint  index) const
inlinevirtual

Access operator

Parameters
indexthe index of the label to look up
Returns
the label value for the given index

Implements LabelsT< Value >.

Definition at line 112 of file Labels.h.

template<typename Value>
void Labels< Value >::set ( uint  id,
const Value &  value 
)
inlinevirtual

Set a label

Parameters
idthe index of the label to set
valuethe value to set the label to

Implements LabelsT< Value >.

Definition at line 116 of file Labels.h.

template<typename Value>
uint Labels< Value >::size ( ) const
inline

Definition at line 132 of file Labels.h.

Member Data Documentation

template<typename Value>
std::vector<int> Labels< Value >::keys

Definition at line 140 of file Labels.h.

template<typename Value>
std::vector<const Value *> Labels< Value >::valueIndex

Definition at line 141 of file Labels.h.

template<typename Value>
std::unordered_map<Value, int> Labels< Value >::values

Definition at line 142 of file Labels.h.


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