LatticeHashForest
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter > Struct Template Reference

An LHF-like structure for scalar values. It does not implement any special operations besides deduplication. More...

#include <lhf.hpp>

Collaboration diagram for lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >:
Collaboration graph
[legend]

Classes

struct  Index
 Index returned by an operation. The struct ensures type safety and possible future extensions. More...
 

Public Types

using PropertyMap = std::unordered_map< PropertyT *, IndexValue, PropertyHash, PropertyEqual >
 

Public Member Functions

Index register_value (const PropertyT &c)
 Inserts a (or gets an existing) element into property storage.
 

Public Attributes

Vector< UniquePointer< PropertyT > > property_list = {}
 
PropertyMap property_map = {}
 

Detailed Description

template<typename PropertyT, typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>>
struct lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >

An LHF-like structure for scalar values. It does not implement any special operations besides deduplication.

Template Parameters
PropertyTThe type of the property. The property type must satisfy the following:
  • It must be hashable with std::hash
  • It must be less-than comparable
  • It can be checked for equality
PropertyLessCustom less-than comparator (if required)
PropertyEqualCustom equality comaparator (if required)
PropertyPrinterPropertyT string representation generator

Definition at line 1893 of file lhf.hpp.

Member Typedef Documentation

◆ PropertyMap

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>>
using lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::PropertyMap = std::unordered_map< PropertyT *, IndexValue, PropertyHash, PropertyEqual>

Definition at line 1925 of file lhf.hpp.

Member Function Documentation

◆ register_value()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>>
Index lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::register_value ( const PropertyT &  c)
inline

Inserts a (or gets an existing) element into property storage.

Parameters
[in]cThe single-element property set.
Returns
Index of the newly created/existing set.
Todo:
Check whether the cache hit check can be removed.

Definition at line 1947 of file lhf.hpp.

Member Data Documentation

◆ property_list

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>>
Vector<UniquePointer<PropertyT> > lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::property_list = {}

◆ property_map

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>>
PropertyMap lhf::Deduplicator< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::property_map = {}

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