-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,395 additions
and
655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ flamegraph.svg | |
|
||
# MacOS desktop attributes file | ||
.DS_Store | ||
|
||
# Development data | ||
/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "doc"] | ||
path = doc | ||
url = [email protected]:GamesCrafters/GamesmanNova.wiki.git |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
//! under which all database implementations' errors can be grouped into). | ||
//! | ||
//! #### Authorship | ||
//! | ||
//! - Max Fierro, 2/24/2024 ([email protected]) | ||
use std::{error::Error, fmt}; | ||
|
@@ -106,6 +105,7 @@ impl fmt::Display for DatabaseError { | |
table, | ||
} => { | ||
let rule = match data { | ||
Datatype::BOOL => "of exactly 1 bit", | ||
Datatype::DPFP => "of exactly 64 bits", | ||
Datatype::SPFP => "of exactly 32 bits", | ||
Datatype::SINT => "greater than 1 bit", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
//! solution set data, hopefully in an efficient and scalable way. | ||
//! | ||
//! #### Authorship | ||
//! | ||
//! - Max Fierro, 4/14/2023 ([email protected]) | ||
use anyhow::Result; | ||
|
@@ -14,6 +13,10 @@ use std::path::Path; | |
|
||
use crate::{model::State, solver::RecordType}; | ||
|
||
/* RE-EXPORTS */ | ||
|
||
pub use util::SchemaBuilder; | ||
|
||
/* UTILITY MODULES */ | ||
|
||
#[cfg(test)] | ||
|
@@ -45,15 +48,6 @@ pub struct Schema { | |
size: usize, | ||
} | ||
|
||
/// Builder pattern intermediary for constructing a schema declaratively out of | ||
/// provided attributes. This is here to help ensure schemas are not changed | ||
/// accidentally after being instantiated. | ||
pub struct SchemaBuilder { | ||
attributes: Vec<Attribute>, | ||
record: Option<RecordType>, | ||
size: usize, | ||
} | ||
|
||
/// Represents a triad of a name string, a size in bits corresponding to an | ||
/// "attribute" or "feature" associated with a database record, and the type | ||
/// of the data it represents. | ||
|
@@ -67,6 +61,7 @@ pub struct Attribute { | |
/// Specifies the type of data being stored within a record within a specific | ||
/// contiguous subset of bits. This is used for interpretation. Here is the | ||
/// meaning of each variant, with its possible sizes in bits: | ||
/// - `BOOL`: Boolean of size exactly 1. | ||
/// - `ENUM`: Enumeration of arbitrary size. | ||
/// - `UINT`: Unsigned integer of arbitrary size. | ||
/// - `SINT`: Signed integer of size greater than 1. | ||
|
@@ -75,6 +70,7 @@ pub struct Attribute { | |
/// - `CSTR`: C-style string (ASCII character array) of a size divisible by 8. | ||
#[derive(Debug, Copy, Clone)] | ||
pub enum Datatype { | ||
BOOL, | ||
ENUM, | ||
UINT, | ||
SINT, | ||
|
@@ -87,10 +83,10 @@ pub enum Datatype { | |
|
||
/// Represents the behavior of a Key-Value Store. No assumptions are made about | ||
/// the size of the records being used, but keys are taken to be fixed-length. | ||
pub trait KVStore<R: Record> { | ||
fn put(&mut self, key: State, record: &R); | ||
pub trait KVStore { | ||
fn put<R: Record>(&mut self, key: State, record: &R); | ||
fn get(&self, key: State) -> Option<&BitSlice<u8, Msb0>>; | ||
fn del(&self, key: State); | ||
fn del(&mut self, key: State); | ||
} | ||
|
||
/// Allows a database to be evicted to persistent media. Implementing this trait | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
//! # Database Test Module | ||
//! # Database Test Utilities Module | ||
//! | ||
//! This module provides integration tests for the database module. | ||
//! | ||
//! #### Authorship | ||
//! | ||
//! - Benjamin Riley Zimmerman, 3/8/2024 ([email protected]) | ||
// #[test] | ||
|
Oops, something went wrong.