ModErn Text Analysis
META Enumerates Textual Applications
Classes | Namespaces | Macros
identifiers.h File Reference
#include <functional>
#include "util/comparable.h"

Go to the source code of this file.

Classes

struct  meta::util::numeric
 Empty helper class to denote that something is numeric. More...
 
struct  meta::util::hash_wrapper< Wrapped >
 Helper class that allows the wrapped type to be hashed into standard library containers such as unordered_map or unordered_set. More...
 
struct  meta::util::identifier< Derived, T >
 CRTP base template that denotes an identifier. More...
 
struct  meta::util::numerical_identifier< Derived, T >
 A CRTP template base that adds numeric functionality to the identifier type. More...
 
struct  std::hash< meta::util::hash_wrapper< Wrapped > >
 A partial specialization that allows for hashing of hash_wrapper types based on their base type. More...
 

Namespaces

 meta
 The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
 
 meta::util
 Shared resources and utilities.
 

Macros

#define MAKE_USER_DEFINED_LITERAL(ident_name, base_type, suffix)
 
#define MAKE_USER_DEFINED_NUMERIC_LITERAL(ident_name, base_type, suffix)
 
#define MAKE_OPAQUE_IDENTIFIER(ident_name, base_type)
 
#define MAKE_OPAQUE_NUMERIC_IDENTIFIER(ident_name, base_type)
 
#define MAKE_IDENTIFIER(ident_name, base_type)   MAKE_OPAQUE_IDENTIFIER(ident_name, base_type)
 
#define MAKE_NUMERIC_IDENTIFIER(ident_name, base_type)   MAKE_OPAQUE_NUMERIC_IDENTIFIER(ident_name, base_type)
 
#define MAKE_IDENTIFIER_UDL(ident_name, base_type, suffix)
 
#define MAKE_NUMERIC_IDENTIFIER_UDL(ident_name, base_type, suffix)
 

Detailed Description

Author
Chase Geigle Defines CRTP base classes that allow for the creation of type-safe "typedef" classes that serve as identifiers in the project.

All files in META are dual-licensed under the MIT and NCSA licenses. For more details, consult the file LICENSE.mit and LICENSE.ncsa in the root of the project.

Macro Definition Documentation

#define MAKE_USER_DEFINED_LITERAL (   ident_name,
  base_type,
  suffix 
)
Value:
inline ident_name operator"" suffix(const char* str, std::size_t len) \
{ \
return ident_name{base_type{str, len}}; \
}
#define MAKE_USER_DEFINED_NUMERIC_LITERAL (   ident_name,
  base_type,
  suffix 
)
Value:
inline ident_name operator"" suffix(unsigned long long int val) \
{ \
return ident_name{base_type(val)}; \
}
#define MAKE_OPAQUE_IDENTIFIER (   ident_name,
  base_type 
)
Value:
template <class Wrapper> \
struct ident_name##_dummy \
{ \
}; \
Helper class that allows the wrapped type to be hashed into standard library containers such as unord...
Definition: identifiers.h:35
CRTP base template that denotes an identifier.
Definition: identifiers.h:53
#define MAKE_OPAQUE_NUMERIC_IDENTIFIER (   ident_name,
  base_type 
)
Value:
template <class Wrapper> \
struct ident_name##_dummy \
{ \
numerical_identifier; \
}; \
A CRTP template base that adds numeric functionality to the identifier type.
Definition: identifiers.h:182
Helper class that allows the wrapped type to be hashed into standard library containers such as unord...
Definition: identifiers.h:35
#define MAKE_IDENTIFIER_UDL (   ident_name,
  base_type,
  suffix 
)
Value:
MAKE_OPAQUE_IDENTIFIER(ident_name, base_type) \
MAKE_USER_DEFINED_LITERAL(ident_name, base_type, suffix)
#define MAKE_NUMERIC_IDENTIFIER_UDL (   ident_name,
  base_type,
  suffix 
)
Value:
MAKE_OPAQUE_NUMERIC_IDENTIFIER(ident_name, base_type) \
MAKE_USER_DEFINED_NUMERIC_LITERAL(ident_name, base_type, suffix)