cheshirekow  v0.1.0
kw::Tag Class Reference

constexpr string, used to implement tagging with strings More...

#include <kwargs/kwargs.h>

Public Member Functions

constexpr uint64_t Hash (int i, uint64_t hash)
 Donald Knuth's hash function TODO: validate or replace this hash function. More...
 
constexpr uint64_t Hash ()
 return a hash of the string More...
 
constexpr char operator[] (uint32_t i)
 return the character at index i More...
 
constexpr uint32_t size ()
 return the number of characters in the string, including the terminal null More...
 
template<uint32_t N>
constexpr Tag (const char(&string)[N])
 Construct from a string literal. More...
 
constexpr Tag (const char *string, size_t len)
 

Private Attributes

const char *const m_ptr
 
const uint32_t m_size
 

Detailed Description

constexpr string, used to implement tagging with strings

via Scott Schurr's C++ Now 2012 presentation

Definition at line 147 of file kwargs.h.

Constructor & Destructor Documentation

template<uint32_t N>
constexpr kw::Tag::Tag ( const char(&)  string[N])
inline

Construct from a string literal.

Definition at line 151 of file kwargs.h.

constexpr kw::Tag::Tag ( const char *  string,
size_t  len 
)
inline

Definition at line 156 of file kwargs.h.

Member Function Documentation

constexpr uint64_t kw::Tag::Hash ( int  i,
uint64_t  hash 
)
inline

Donald Knuth's hash function TODO: validate or replace this hash function.

Definition at line 176 of file kwargs.h.

constexpr uint64_t kw::Tag::Hash ( )
inline

return a hash of the string

Definition at line 182 of file kwargs.h.

constexpr char kw::Tag::operator[] ( uint32_t  i)
inline

return the character at index i

Definition at line 162 of file kwargs.h.

constexpr uint32_t kw::Tag::size ( )
inline

return the number of characters in the string, including the terminal null

Definition at line 170 of file kwargs.h.

Member Data Documentation

const char* const kw::Tag::m_ptr
private

Definition at line 187 of file kwargs.h.

const uint32_t kw::Tag::m_size
private

Definition at line 188 of file kwargs.h.


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