dictionary_types.h File Reference

Description

Types used for dictionaries.

Author
Graeme Douglas, Scott Fazackerley

This file exists mostly to avoid circular dependencies.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1.Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2.Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3.Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file dictionary_types.h.

Include dependency graph for dictionary_types.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  ion_dictionary_config_info_t
 Struct containing details for opening a dictionary previously created. More...
 
struct  dictionary_handler
 A dictionary_handler is responsible for dealing with the specific interface for an underlying dictionary, but is decoupled from a specific implementation. More...
 
struct  dictionary
 A dictionary contains information regarding an instance of the storage element and the associated handler. More...
 
struct  dictionary_parent
 This is the super type for all dictionaries. More...
 
struct  equality_statement
 This is a predicate data object for equality queries. More...
 
struct  range_statement
 This is a predicate data object for range queries. More...
 
struct  ion_all_records_statement
 Predicate type for cursors that iterate over all records in set. More...
 
struct  other_predicate_statement
 Predicate type for predicate (conditional) queries. More...
 
union  predicate_statement
 This is used to pass predicate into a cursor-based query over a dictionary. More...
 
struct  predicate
 A supertype for cursor predicate objects. More...
 
struct  dictionary_cursor
 A supertype for dictionary cursor objects. More...
 
struct  hash_bucket
 Struct used to maintain individual records in the hashmap. More...
 

Typedefs

typedef unsigned int ion_dictionary_id_t
 A type used to identify dictionaries, specifically in the master table. More...
 
typedef ion_byte_t ion_dict_use_t
 A type describing how a dictionary is used. More...
 
typedef int ion_hash_t
 The position in the hashmap. More...
 
typedef struct dictionary ion_dictionary_t
 A dictionary instance variable. More...
 
typedef struct dictionary_handler ion_dictionary_handler_t
 Struct defining all dictionary handling methods. More...
 
typedef char(* ion_dictionary_compare_t) (ion_key_t, ion_key_t, ion_key_size_t)
 Function pointer type for dictionary comparison methods. More...
 
typedef struct dictionary_cursor ion_dict_cursor_t
 The dictionary cursor type. More...
 
typedef struct predicate ion_predicate_t
 The dictionary predicate type. More...
 
typedef union predicate_statement ion_predicate_statement_t
 The dictionary predicate statement type. More...
 
typedef struct dictionary_parent ion_dictionary_parent_t
 The dictionary parent type. More...
 
typedef enum ION_COMPARISON ion_comparsion_t
 A comparison result type that describes the result of a comparison. More...
 
typedef char ion_cursor_status_t
 A type for the status of a cursor. More...
 
typedef char ion_dictionary_status_t
 A short status describing the current status of a dictionary. More...
 
typedef char ion_predicate_type_t
 A type for storing predicate type data. More...
 
typedef struct equality_statement ion_equality_statement_t
 This is a predicate data object for equality queries. More...
 
typedef struct range_statement ion_range_statement_t
 This is a predicate data object for range queries. More...
 
typedef struct ion_all_records_statement ion_all_records_statement_t
 Predicate type for cursors that iterate over all records in set. More...
 
typedef struct other_predicate_statement ion_other_predicate_statement_t
 Predicate type for predicate (conditional) queries. More...
 
typedef char ion_write_concern_t
 A type for write concern information used by hash table based dictionaries which limit insert/update of values. More...
 
typedef struct hash_bucket ion_hash_bucket_t
 Struct used to maintain individual records in the hashmap. More...
 
typedef void(* ion_handler_initializer_t) (ion_dictionary_handler_t *)
 Function signature for all init functions. More...
 

Enumerations

enum  ION_COMPARISON { A_lt_B = -1, A_equ_B = 0, A_gt_B = 1 }
 A comparison result type that describes the result of a comparison. More...
 
enum  ION_CURSOR_STATUS {
  cs_invalid_index = -1, cs_invalid_cursor, cs_end_of_results, cs_cursor_initialized,
  cs_cursor_uninitialized, cs_cursor_active, cs_possible_data_inconsistency
}
 A status type describing the current state of an initialized cursor. More...
 
enum  ION_DICTIONARY_STATUS { ion_dictionary_status_ok, ion_dictionary_status_closed, ion_dictionary_status_error }
 The status codes describing various states a dictionary can be in. More...
 
enum  ION_PREDICATE_TYPE { predicate_equality, predicate_range, predicate_all_records, predicate_predicate }
 The predicate type flag list. More...
 
enum  ION_WRITE_CONCERN { wc_update, wc_insert_unique, wc_duplicate }
 The list of write concern options for supported dictionary implementations. More...
 

Typedef Documentation

Predicate type for cursors that iterate over all records in set.

This is to be used by the user to setup a predicate for evaluation.

A comparison result type that describes the result of a comparison.

typedef char ion_cursor_status_t

A type for the status of a cursor.

This allows us to control the size of the status type, rather than depending on the enum.

Definition at line 157 of file dictionary_types.h.

The dictionary cursor type.

See also
dictionary_cursor

Definition at line 93 of file dictionary_types.h.

A type describing how a dictionary is used.

This type allows users of the library to find certain dictionaries in the key-value store that might be special. See ion_find_by_use_master_table.

Definition at line 59 of file dictionary_types.h.

typedef char(* ion_dictionary_compare_t) (ion_key_t, ion_key_t, ion_key_size_t)

Function pointer type for dictionary comparison methods.

Definition at line 83 of file dictionary_types.h.

Struct defining all dictionary handling methods.

See also
dictionary_handler

Definition at line 78 of file dictionary_types.h.

typedef unsigned int ion_dictionary_id_t

A type used to identify dictionaries, specifically in the master table.

Definition at line 51 of file dictionary_types.h.

The dictionary parent type.

See also
dictionary_parent

Definition at line 111 of file dictionary_types.h.

A short status describing the current status of a dictionary.

Definition at line 177 of file dictionary_types.h.

typedef struct dictionary ion_dictionary_t

A dictionary instance variable.

Does not describe the function pointers of a dictionary implementation.

See also
dictionary

Definition at line 72 of file dictionary_types.h.

This is a predicate data object for equality queries.

This is to be used by the user to setup a predicate for evaluation.

typedef void(* ion_handler_initializer_t) (ion_dictionary_handler_t *)

Function signature for all init functions.

Definition at line 453 of file dictionary_types.h.

Struct used to maintain individual records in the hashmap.

typedef int ion_hash_t

The position in the hashmap.

Definition at line 64 of file dictionary_types.h.

Predicate type for predicate (conditional) queries.

This is to be used by the user to setup a predicate for evaluation.

The dictionary predicate statement type.

See also
predicate_statement

Definition at line 105 of file dictionary_types.h.

typedef struct predicate ion_predicate_t

The dictionary predicate type.

See also
predicate

Definition at line 99 of file dictionary_types.h.

typedef char ion_predicate_type_t

A type for storing predicate type data.

Definition at line 297 of file dictionary_types.h.

This is a predicate data object for range queries.

This is to be used by the user to setup a predicate for evaluation.

typedef char ion_write_concern_t

A type for write concern information used by hash table based dictionaries which limit insert/update of values.

Definition at line 440 of file dictionary_types.h.

Enumeration Type Documentation

A comparison result type that describes the result of a comparison.

Enumerator
A_lt_B 

The result for the comparison operation is A <= B.

A_equ_B 

The result for the comparison operation is A == B.

A_gt_B 

The result for the comparison operation is A >= B.

Definition at line 116 of file dictionary_types.h.

116  {
117  A_lt_B = -1,
118  A_equ_B = 0,
119  A_gt_B = 1
enum ION_COMPARISON ion_comparsion_t
A comparison result type that describes the result of a comparison.

A status type describing the current state of an initialized cursor.

Enumerator
cs_invalid_index 

A cursor status stating that the cursor has an invalid index.

cs_invalid_cursor 

A cursor status stating that the cursor is generally invalid.

cs_end_of_results 

A cursor status stating that the the cursor has reached the end of the results.

cs_cursor_initialized 

A cursor status stating that the cursor has been initialized but has data that hasn't yet been accessed. Cursor is valid but data has need been accessed.

cs_cursor_uninitialized 

A cursor status stating that the cursor has not yet been attached to a predicate statement and associated data.

cs_cursor_active 

A cursor status stating that the cursor is active and is traversing data.

cs_possible_data_inconsistency 

A cursor status stating that the data in the underlying dictionary has been changed, making the cursor invalid.

Definition at line 125 of file dictionary_types.h.

The status codes describing various states a dictionary can be in.

Enumerator
ion_dictionary_status_ok 

A status describing the situation when a dictionary is ready to be used.

ion_dictionary_status_closed 

A status describing the situation when a dictionary has been closed.

ion_dictionary_status_error 

A status describing the situation when a dictionary operation modifying

the dictionary has failed.

Definition at line 163 of file dictionary_types.h.

The predicate type flag list.

These type flags tell internal code what type of predicate is being described.

Enumerator
predicate_equality 

Predicate type for equality cursors.

predicate_range 

Predicate tyoe for range cursors.

predicate_all_records 

Predicate type for cursors over all records.

predicate_predicate 

Predicate type for predicate cursors.

Definition at line 304 of file dictionary_types.h.

The list of write concern options for supported dictionary implementations.

The write concern level describes dictionary behaviour when multiple values are inserted with the same key. Not all implementations are required to support different write concern levels.

Enumerator
wc_update 

Write concern which allows for values to be overwritten if their associated key already exists in the dictionary.

wc_insert_unique 

Write concern which allows for unique inserts only (no overwrite).

wc_duplicate 

Write concern which allows for duplicate keys to be inserted into dictionary.

Definition at line 426 of file dictionary_types.h.