Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Data Fields
epmem_common_statement_container Class Reference

#include <episodic_memory.h>

Inherits soar_module::sqlite_statement_container.

Public Member Functions

 epmem_common_statement_container (agent *new_agent)
- Public Member Functions inherited from soar_module::sqlite_statement_container
void add_structure (const char *new_structure)
 sqlite_statement_container (sqlite_database *new_db)
void structure ()
virtual ~sqlite_statement_container ()
- Public Member Functions inherited from soar_module::statement_container
void add (statement *new_statement)
void clean ()
void prepare ()
 statement_container ()
virtual ~statement_container ()

Data Fields

soar_module::sqlite_statementbegin
soar_module::sqlite_statementcommit
soar_module::sqlite_statementhash_add
soar_module::sqlite_statementhash_get
soar_module::sqlite_statementrit_add_left
soar_module::sqlite_statementrit_add_right
soar_module::sqlite_statementrit_truncate_left
soar_module::sqlite_statementrit_truncate_right
soar_module::sqlite_statementrollback
soar_module::sqlite_statementvar_get
soar_module::sqlite_statementvar_set

Additional Inherited Members

- Protected Attributes inherited from soar_module::sqlite_statement_container
sqlite_databasemy_db
std::list< const char * > * structures

Detailed Description

Definition at line 307 of file episodic_memory.h.

Constructor & Destructor Documentation

epmem_common_statement_container::epmem_common_statement_container ( agent new_agent)

Definition at line 527 of file episodic_memory.cpp.

References soar_module::statement_container::add(), soar_module::sqlite_statement_container::add_structure(), begin, commit, agent_struct::epmem_db, hash_add, hash_get, rit_add_left, rit_add_right, rit_truncate_left, rit_truncate_right, rollback, var_get, and var_set.

{
soar_module::sqlite_database *new_db = new_agent->epmem_db;
//
add_structure( "CREATE TABLE IF NOT EXISTS vars (id INTEGER PRIMARY KEY,value NONE)" );
add_structure( "CREATE TABLE IF NOT EXISTS rit_left_nodes (min INTEGER, max INTEGER)" );
add_structure( "CREATE TABLE IF NOT EXISTS rit_right_nodes (node INTEGER)" );
add_structure( "CREATE TABLE IF NOT EXISTS temporal_symbol_hash (id INTEGER PRIMARY KEY, sym_const NONE, sym_type INTEGER)" );
add_structure( "CREATE UNIQUE INDEX IF NOT EXISTS temporal_symbol_hash_const_type ON temporal_symbol_hash (sym_type,sym_const)" );
// workaround for tree: type 1 = IDENTIFIER_SYMBOL_TYPE
add_structure( "INSERT OR IGNORE INTO temporal_symbol_hash (id,sym_const,sym_type) VALUES (0,NULL,1)" );
// workaround for acceptable preference wmes: id 1 = "operator+"
add_structure( "INSERT OR IGNORE INTO temporal_symbol_hash (id,sym_const,sym_type) VALUES (1,'operator*',2)" );
//
begin = new soar_module::sqlite_statement( new_db, "BEGIN" );
add( begin );
commit = new soar_module::sqlite_statement( new_db, "COMMIT" );
add( commit );
rollback = new soar_module::sqlite_statement( new_db, "ROLLBACK" );
//
var_get = new soar_module::sqlite_statement( new_db, "SELECT value FROM vars WHERE id=?" );
var_set = new soar_module::sqlite_statement( new_db, "REPLACE INTO vars (id,value) VALUES (?,?)" );
//
rit_add_left = new soar_module::sqlite_statement( new_db, "INSERT INTO rit_left_nodes (min,max) VALUES (?,?)" );
rit_truncate_left = new soar_module::sqlite_statement( new_db, "DELETE FROM rit_left_nodes" );
rit_add_right = new soar_module::sqlite_statement( new_db, "INSERT INTO rit_right_nodes (node) VALUES (?)" );
rit_truncate_right = new soar_module::sqlite_statement( new_db, "DELETE FROM rit_right_nodes" );
//
hash_get = new soar_module::sqlite_statement( new_db, "SELECT id FROM temporal_symbol_hash WHERE sym_type=? AND sym_const=?" );
hash_add = new soar_module::sqlite_statement( new_db, "INSERT INTO temporal_symbol_hash (sym_type,sym_const) VALUES (?,?)" );
}

Field Documentation

soar_module::sqlite_statement* epmem_common_statement_container::begin
soar_module::sqlite_statement* epmem_common_statement_container::commit
soar_module::sqlite_statement* epmem_common_statement_container::hash_add

Definition at line 323 of file episodic_memory.h.

Referenced by epmem_common_statement_container(), and epmem_temporal_hash().

soar_module::sqlite_statement* epmem_common_statement_container::hash_get

Definition at line 322 of file episodic_memory.h.

Referenced by epmem_common_statement_container(), and epmem_temporal_hash().

soar_module::sqlite_statement* epmem_common_statement_container::rit_add_left

Definition at line 317 of file episodic_memory.h.

Referenced by epmem_common_statement_container(), and epmem_rit_add_left().

soar_module::sqlite_statement* epmem_common_statement_container::rit_add_right

Definition at line 319 of file episodic_memory.h.

Referenced by epmem_common_statement_container(), and epmem_rit_add_right().

soar_module::sqlite_statement* epmem_common_statement_container::rit_truncate_left
soar_module::sqlite_statement* epmem_common_statement_container::rit_truncate_right
soar_module::sqlite_statement* epmem_common_statement_container::rollback

Definition at line 312 of file episodic_memory.h.

Referenced by epmem_common_statement_container().

soar_module::sqlite_statement* epmem_common_statement_container::var_get

Definition at line 314 of file episodic_memory.h.

Referenced by epmem_common_statement_container(), and epmem_get_variable().

soar_module::sqlite_statement* epmem_common_statement_container::var_set

Definition at line 315 of file episodic_memory.h.

Referenced by epmem_common_statement_container(), and epmem_set_variable().


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