My Project
Loading...
Searching...
No Matches
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 2295 of file vspace.h.

Member Typedef Documentation

◆ Key

Definition at line 2296 of file vspace.h.

◆ Value

Definition at line 2297 of file vspace.h.

Member Function Documentation

◆ equal()

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

Definition at line 2308 of file vspace.h.

2308 {
2309 if (s1->len() != s2->len())
2310 return false;
2311 size_t len = s1->len();
2312 const char *str1 = s1->str(), *str2 = s2->str();
2313 for (size_t i = 0; i < len; i++) {
2314 if (str1[i] != str2[i])
2315 return false;
2316 }
2317 return true;
2318 }
int i
Definition: cfEzgcd.cc:132

◆ free_key()

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

Definition at line 2325 of file vspace.h.

2325 {
2326 // do nothing
2327 }

◆ free_value()

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

Definition at line 2328 of file vspace.h.

2328 {
2329 // do nothing
2330 }

◆ hash()

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

Definition at line 2298 of file vspace.h.

2298 {
2299 // DJB hash
2300 size_t len = s->len();
2301 const char *str = s->str();
2302 size_t hash = 5381;
2303 for (size_t i = 0; i < len; i++) {
2304 hash = 33 * hash + str[i];
2305 }
2306 return hash;
2307 }
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:2298

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