My Project
Public Types | Static Public Member Functions
vspace::DictSpec Struct Reference

#include <vspace.h>

Public Types

typedef VString Key
 
typedef VString Value
 

Static Public Member Functions

static size_t hash (const VString *s)
 
static bool equal (const VString *s1, const VString *s2)
 
static void free_key (VRef< Key > key)
 
static void free_value (VRef< Value > value)
 

Detailed Description

Definition at line 960 of file vspace.h.

Member Typedef Documentation

◆ Key

Definition at line 961 of file vspace.h.

◆ Value

Definition at line 962 of file vspace.h.

Member Function Documentation

◆ equal()

static bool vspace::DictSpec::equal ( const VString s1,
const VString s2 
)
inlinestatic

Definition at line 973 of file vspace.h.

973 {
974 if (s1->len() != s2->len())
975 return false;
976 size_t len = s1->len();
977 const char *str1 = s1->str(), *str2 = s2->str();
978 for (size_t i = 0; i < len; i++) {
979 if (str1[i] != str2[i])
980 return false;
981 }
982 return true;
983 }
int i
Definition: cfEzgcd.cc:132

◆ free_key()

static void vspace::DictSpec::free_key ( VRef< Key key)
inlinestatic

Definition at line 990 of file vspace.h.

990 {
991 // do nothing
992 }

◆ free_value()

static void vspace::DictSpec::free_value ( VRef< Value value)
inlinestatic

Definition at line 993 of file vspace.h.

993 {
994 // do nothing
995 }

◆ hash()

static size_t vspace::DictSpec::hash ( const VString s)
inlinestatic

Definition at line 963 of file vspace.h.

963 {
964 // DJB hash
965 size_t len = s->len();
966 const char *str = s->str();
967 size_t hash = 5381;
968 for (size_t i = 0; i < len; i++) {
969 hash = 33 * hash + str[i];
970 }
971 return hash;
972 }
const CanonicalForm int s
Definition: facAbsFact.cc:51
char * str(leftv arg)
Definition: shared.cc:704
static size_t hash(const VString *s)
Definition: vspace.h:963

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