Multilevel Deduplication Engine (MDE)
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
mde.hpp File Reference

Defines the MDENode structure and related tools. More...

#include "mde_common.hpp"
#include "profiling.hpp"
#include <tuple>
#include <utility>
#include <algorithm>
Include dependency graph for mde.hpp:

Go to the source code of this file.

Classes

struct  mde::OperationNode
 This struct contains the information about the operands of an operation (union, intersection, etc.) More...
 
struct  std::hash< mde::OperationNode >
 
struct  mde::SetLess< OrderedSetT, ElementT, PropertyLess >
 Generic Less-than comparator for set types. More...
 
struct  mde::SetHash< SetT, ElementT, ElementHash >
 Hasher for set types. More...
 
struct  mde::SetEqual< SetT, ElementT, PropertyEqual >
 Generic Equality comparator for set types. More...
 
struct  mde::AssertError
 Struct that is thrown on an assertion failure. More...
 
struct  mde::Unreachable
 Thrown if code region is unreachable. More...
 
struct  mde::NestingNone< PropertyT >
 The nesting type for non-nested data structures. Act as "leaf" nodes in a tree of nested MDEs. More...
 
struct  mde::NestingNone< PropertyT >::PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >
 Base-case type for the elements for a property set. The template arguments are for the 'key' type. More...
 
struct  mde::NestingNone< PropertyT >::PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::Hash
 
struct  mde::NestingNone< PropertyT >::PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::FullEqual
 This forces a comparison of both the key and the value instead of only the key. Required in instances where distinguishing this is necessary (like in the property set storage array). More...
 
struct  mde::NestingBase< PropertyT, ChildT >
 Describes the standard nesting structure. Act as "non-leaf" nodes in a tree of nested MDEs. More...
 
struct  mde::NestingBase< PropertyT, ChildT >::PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >
 Type for the elements for a property set in the nested. The template arguments are for the 'key' type. More...
 
struct  mde::NestingBase< PropertyT, ChildT >::PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::Hash
 
struct  mde::NestingBase< PropertyT, ChildT >::PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >::FullEqual
 This forces a comparison of both the key and the value instead of only the key. Required in instances where distinguishing this is necessary (like in the property set storage array) More...
 
class  mde::MapAdapter< MapClass >
 
struct  mde::OperationPerf
 Operation performance Statistics. More...
 
struct  mde::MDEConfig< T >
 
class  mde::MDENode< Config, NestingT >
 The main MDENode structure. This class can be used as-is with a type or derived for additional functionality as needed. More...
 
struct  mde::MDENode< Config, NestingT >::Index
 Index returned by an operation. Being defined inside the class ensures type safety and possible future extensions. More...
 
struct  mde::MDENode< Config, NestingT >::Index::Hash
 
struct  mde::MDENode< Config, NestingT >::PropertySetHolder
 
class  mde::MDENode< Config, NestingT >::PropertySetStorage
 
struct  mde::Deduplicator< PropertyT, PropertyHash, PropertyEqual, PropertyPrinter >
 An straightforward deduplicator for scalar values. It does not implement any special operations besides deduplication. Unlike MDE, this does NOT enforce constness on the data items registered. However, a mutable access must always be marked. More...
 
struct  mde::Deduplicator< PropertyT, PropertyHash, PropertyEqual, PropertyPrinter >::Index
 Index returned by the class. Being defined inside the class ensures type safety and possible future extensions. More...
 
struct  mde::Deduplicator< PropertyT, PropertyHash, PropertyEqual, PropertyPrinter >::Index::Hash
 
struct  mde::Deduplicator< PropertyT, PropertyHash, PropertyEqual, PropertyPrinter >::PropertyPtrHash
 
struct  mde::Deduplicator< PropertyT, PropertyHash, PropertyEqual, PropertyPrinter >::PropertyPtrEqual
 

Namespaces

namespace  mde
 

Macros

#define __MDE_EXCEPT(__msg)   AssertError(__msg " [At: " __FILE__ ":" __MDE_STR(__LINE__) "]")
 
#define __MDE_ASSERT(__cond, __msg_arg)    { if (!(__cond)) { __MDE_EXCEPT(__msg_arg); } }
 
#define MDE_PROPERTY_SET_INTEGRITY_VALID(__set)    verify_property_set_integrity<PropertySet, PropertyElement>(__set);
 Macro and switch for verify_property_set_integrity inside MDE.
 
#define MDE_PROPERTY_SET_INDEX_VALID(__index)
 Check whether the index is a valid index within the property set.
 
#define MDE_PROPERTY_SET_PAIR_VALID(__index1, __index2)
 Check whether the pair of indexes is a valid within the property set.
 
#define MDE_PROPERTY_SET_PAIR_UNEQUAL(__index1, __index2)
 Check whether the pair of indexes are unequal. Used for sanity checking.
 
#define MDE_PARALLEL(__x)
 
#define MDE_EVICTION(__x)
 
#define MDE_PUSH_ONE(__cont, __val)   (__cont).push_back((__val))
 Pushes one element to a PropertySet. Use this when implementing operations.
 
#define MDE_PUSH_RANGE(__cont, __start, __end)   (__cont).insert((__cont).end(), (__start), (__end))
 Pushes a range of elements to a PropertySet using an iterator. Use this when implementing operations.
 
#define MDE_REGISTER_SET_INTERNAL(__set, __cold)   register_set<MDE_DISABLE_INTERNAL_INTEGRITY_CHECK>((__set), (__cold))
 Registers a set with behaviours defined for internal processing.
 
#define MDE_BINARY_NESTED_OPERATION(__op_name)
 Declares a struct that enables the recursive/nesting behaviour of an operation.
 
#define MDE_PERFORM_BINARY_NESTED_OPERATION(__op_name, __reflist, __arg1, __arg2)    ((__arg1) . template apply<__NestingOperation_ ## __op_name>((__reflist), (__arg2)))
 Actually enables the nesting. this must be placed in the operation body where the nested behaviour is needed.
 
#define MDE_PERF_INC(__oper, __category)   (perf[__MDE_STR(__oper)] . __category ++)
 Increments the invocation count of the given category and operator.
 
#define MDE_PROPERTY_INDEX_VALID(__index)
 

Typedefs

template<typename K , typename V >
using mde::InternalMap = MapAdapter< HashMap< K, V > >
 
template<typename T >
using mde::OperationMap = InternalMap< T, IndexValue >
 

Functions

std::ostream & mde::operator<< (std::ostream &os, const OperationNode &op)
 

Detailed Description

Defines the MDENode structure and related tools.

Definition in file mde.hpp.

Macro Definition Documentation

◆ __MDE_ASSERT

#define __MDE_ASSERT (   __cond,
  __msg_arg 
)     { if (!(__cond)) { __MDE_EXCEPT(__msg_arg); } }

Definition at line 205 of file mde.hpp.

◆ __MDE_EXCEPT

#define __MDE_EXCEPT (   __msg)    AssertError(__msg " [At: " __FILE__ ":" __MDE_STR(__LINE__) "]")

Definition at line 202 of file mde.hpp.

◆ MDE_BINARY_NESTED_OPERATION

#define MDE_BINARY_NESTED_OPERATION (   __op_name)
Value:
struct __NestingOperation_ ## __op_name { \
template<typename ArgIndex, typename MDE> \
void operator()(ArgIndex &ret, MDE &mde, const ArgIndex &c, const ArgIndex &d) { \
ret = mde . __op_name (c, d); \
} \
};
Definition mde.hpp:16

Declares a struct that enables the recursive/nesting behaviour of an operation.

Parameters
__op_nameThe operation name. Must match the function name (e.g. set_union, set_intersection etc.)
Returns
The set declaration.

Definition at line 481 of file mde.hpp.

◆ MDE_EVICTION

#define MDE_EVICTION (   __x)

Definition at line 315 of file mde.hpp.

◆ MDE_PARALLEL

#define MDE_PARALLEL (   __x)

Definition at line 309 of file mde.hpp.

◆ MDE_PERF_INC

#define MDE_PERF_INC (   __oper,
  __category 
)    (perf[__MDE_STR(__oper)] . __category ++)

Increments the invocation count of the given category and operator.

Note
Conditionally enabled if MDE_ENABLE_PERFORMANCE_METRICS is set.
Parameters
__operThe operator (e.g. unions)
__categoryThe category (e.g. hits)

Definition at line 910 of file mde.hpp.

◆ MDE_PERFORM_BINARY_NESTED_OPERATION

#define MDE_PERFORM_BINARY_NESTED_OPERATION (   __op_name,
  __reflist,
  __arg1,
  __arg2 
)     ((__arg1) . template apply<__NestingOperation_ ## __op_name>((__reflist), (__arg2)))

Actually enables the nesting. this must be placed in the operation body where the nested behaviour is needed.

Parameters
__op_nameThe operation name.
__reflistThe reference list of the MDE
__arg1LHS argument of the binary operation
__arg2RHS argument of the binary operation

Definition at line 500 of file mde.hpp.

◆ MDE_PROPERTY_INDEX_VALID

#define MDE_PROPERTY_INDEX_VALID (   __index)
Value:
{ \
_Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"") \
if ((__index.value) < 0 || ((__index.value) > property_list.size() - 1)) { \
throw __MDE_EXCEPT("Invalid index supplied"); \
} \
_Pragma("GCC diagnostic pop") \
}
#define __MDE_EXCEPT(__msg)
Definition mde.hpp:202

Check whether the index is a valid index within the current state of the deduplicator

Definition at line 2433 of file mde.hpp.

◆ MDE_PROPERTY_SET_INDEX_VALID

#define MDE_PROPERTY_SET_INDEX_VALID (   __index)
Value:
{ \
_Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"") \
if ((__index.value) < 0 || ((__index.value) > property_sets.size() - 1)) { \
throw __MDE_EXCEPT("Invalid index supplied"); \
} \
_Pragma("GCC diagnostic pop") \
}

Check whether the index is a valid index within the property set.

Note
Signed/unsigned is made to be ignored here for the sanity checking.

Check whether the index is a valid index within the current MDE state.

Note
Signed/unsigned is made to be ignored here for the sanity checking.

Definition at line 278 of file mde.hpp.

◆ MDE_PROPERTY_SET_INTEGRITY_VALID

#define MDE_PROPERTY_SET_INTEGRITY_VALID (   __set)     verify_property_set_integrity<PropertySet, PropertyElement>(__set);

Macro and switch for verify_property_set_integrity inside MDE.

Parameters
__setThe property set.

Definition at line 251 of file mde.hpp.

◆ MDE_PROPERTY_SET_PAIR_UNEQUAL

#define MDE_PROPERTY_SET_PAIR_UNEQUAL (   __index1,
  __index2 
)
Value:
if ((__index1) == (__index2)) { \
throw __MDE_EXCEPT("Equal set condition not handled by caller"); \
}

Check whether the pair of indexes are unequal. Used for sanity checking.

Definition at line 293 of file mde.hpp.

◆ MDE_PROPERTY_SET_PAIR_VALID

#define MDE_PROPERTY_SET_PAIR_VALID (   __index1,
  __index2 
)
Value:
MDE_PROPERTY_SET_INDEX_VALID(__index2);
#define MDE_PROPERTY_SET_INDEX_VALID(__index)
Check whether the index is a valid index within the property set.
Definition mde.hpp:278

Check whether the pair of indexes is a valid within the property set.

Definition at line 288 of file mde.hpp.

◆ MDE_PUSH_ONE

#define MDE_PUSH_ONE (   __cont,
  __val 
)    (__cont).push_back((__val))

Pushes one element to a PropertySet. Use this when implementing operations.

Parameters
__contThe container object
__valThe value

Definition at line 327 of file mde.hpp.

◆ MDE_PUSH_RANGE

#define MDE_PUSH_RANGE (   __cont,
  __start,
  __end 
)    (__cont).insert((__cont).end(), (__start), (__end))

Pushes a range of elements to a PropertySet using an iterator. Use this when implementing operations.

Parameters
__contThe container object
__startThe start of the range (e.g. input.begin())
__endThe end of the range (e.g. input.end())

Definition at line 339 of file mde.hpp.

◆ MDE_REGISTER_SET_INTERNAL

#define MDE_REGISTER_SET_INTERNAL (   __set,
  __cold 
)    register_set<MDE_DISABLE_INTERNAL_INTEGRITY_CHECK>((__set), (__cold))

Registers a set with behaviours defined for internal processing.

Parameters
__setThe set
__coldWhether this was a cold miss or not (pointer to bool)

Definition at line 349 of file mde.hpp.