OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::AtomStorage Class Reference

#include <AtomStorage.h>

Public Member Functions

 AtomStorage (const std::string &dbname, const std::string &username, const std::string &authentication)
 
 AtomStorage (const char *dbname, const char *username, const char *authentication)
 
 AtomStorage (const AtomStorage &)=delete
 
AtomStorageoperator= (const AtomStorage &)=delete
 
 ~AtomStorage ()
 
bool connected (void)
 
void kill_data (void)
 
void storeSingleAtom (AtomPtr)
 
void storeAtom (AtomPtr, bool synchronous=false)
 
void flushStoreQueue ()
 
bool atomExists (Handle)
 
AtomPtr getAtom (Handle)
 
std::vector< HandlegetIncomingSet (Handle)
 
NodePtr getNode (Type, const char *)
 
NodePtr getNode (const Node &n)
 
LinkPtr getLink (Type, const std::vector< Handle > &)
 
LinkPtr getLink (const Link &l)
 
void loadType (AtomTable &, Type)
 
void load (AtomTable &)
 
void store (const AtomTable &)
 
void reserve (void)
 

Private Member Functions

ODBCConnectionget_conn ()
 
void put_conn (ODBCConnection *)
 
void init (const char *, const char *, const char *)
 
AtomPtr makeAtom (Response &, Handle)
 
AtomPtr getAtom (const char *, int)
 
int get_height (AtomPtr)
 
void setMaxHeight (int)
 
int getMaxHeight (void)
 
int do_store_atom (AtomPtr)
 
void vdo_store_atom (AtomPtr &)
 
void do_store_single_atom (AtomPtr, int)
 
std::string oset_to_string (const HandleSeq &, int)
 
void storeOutgoing (AtomPtr, Handle)
 
void getOutgoing (HandleSeq &, Handle)
 
bool store_cb (AtomPtr)
 
void rename_tables (void)
 
void create_tables (void)
 
void add_id_to_cache (UUID)
 
void get_ids (void)
 
std::unique_lock< std::mutex > maybe_create_id (UUID)
 
UUID getMaxObservedUUID (void)
 
int getMaxObservedHeight (void)
 
bool idExists (const char *)
 
void load_typemap (void)
 
void setup_typemap (void)
 
void set_typemap (int, const char *)
 

Private Attributes

concurrent_stack
< ODBCConnection * > 
conn_pool
 
int max_height
 
std::atomic< unsigned long > load_count
 
std::atomic< unsigned long > store_count
 
std::mutex id_cache_mutex
 
bool local_id_cache_is_inited
 
std::set< UUIDlocal_id_cache
 
std::mutex id_create_mutex
 
std::set< UUIDid_create_cache
 
int storing_typemap [TYPEMAP_SZ]
 
Type loading_typemap [TYPEMAP_SZ]
 
char * db_typename [TYPEMAP_SZ]
 
bool type_map_was_loaded
 
async_caller< AtomStorage,
AtomPtr
_write_queue
 

Detailed Description

Definition at line 48 of file AtomStorage.h.

Constructor & Destructor Documentation

opencog::AtomStorage::AtomStorage ( const std::string &  dbname,
const std::string &  username,
const std::string &  authentication 
)
opencog::AtomStorage::AtomStorage ( const char *  dbname,
const char *  username,
const char *  authentication 
)
opencog::AtomStorage::AtomStorage ( const AtomStorage )
delete
opencog::AtomStorage::~AtomStorage ( )

Member Function Documentation

void opencog::AtomStorage::add_id_to_cache ( UUID  )
private
bool opencog::AtomStorage::atomExists ( Handle  )
bool opencog::AtomStorage::connected ( void  )

+ Here is the caller graph for this function:

void opencog::AtomStorage::create_tables ( void  )
private
int opencog::AtomStorage::do_store_atom ( AtomPtr  )
private
void opencog::AtomStorage::do_store_single_atom ( AtomPtr  ,
int   
)
private
void opencog::AtomStorage::flushStoreQueue ( )

+ Here is the caller graph for this function:

ODBCConnection* opencog::AtomStorage::get_conn ( )
private
int opencog::AtomStorage::get_height ( AtomPtr  )
private
void opencog::AtomStorage::get_ids ( void  )
private
AtomPtr opencog::AtomStorage::getAtom ( const char *  ,
int   
)
private

+ Here is the caller graph for this function:

AtomPtr opencog::AtomStorage::getAtom ( Handle  )
std::vector<Handle> opencog::AtomStorage::getIncomingSet ( Handle  )

+ Here is the caller graph for this function:

LinkPtr opencog::AtomStorage::getLink ( Type  ,
const std::vector< Handle > &   
)

+ Here is the caller graph for this function:

LinkPtr opencog::AtomStorage::getLink ( const Link l)
inline
int opencog::AtomStorage::getMaxHeight ( void  )
private
int opencog::AtomStorage::getMaxObservedHeight ( void  )
private
UUID opencog::AtomStorage::getMaxObservedUUID ( void  )
private
NodePtr opencog::AtomStorage::getNode ( Type  ,
const char *   
)

+ Here is the caller graph for this function:

NodePtr opencog::AtomStorage::getNode ( const Node n)
inline

Definition at line 150 of file AtomStorage.h.

References opencog::Node::getName(), getNode(), and opencog::Atom::getType().

void opencog::AtomStorage::getOutgoing ( HandleSeq ,
Handle   
)
private
bool opencog::AtomStorage::idExists ( const char *  )
private
void opencog::AtomStorage::init ( const char *  ,
const char *  ,
const char *   
)
private
void opencog::AtomStorage::kill_data ( void  )
void opencog::AtomStorage::load ( AtomTable )

+ Here is the caller graph for this function:

void opencog::AtomStorage::load_typemap ( void  )
private
void opencog::AtomStorage::loadType ( AtomTable ,
Type   
)

+ Here is the caller graph for this function:

AtomPtr opencog::AtomStorage::makeAtom ( Response &  ,
Handle   
)
private
std::unique_lock<std::mutex> opencog::AtomStorage::maybe_create_id ( UUID  )
private
AtomStorage& opencog::AtomStorage::operator= ( const AtomStorage )
delete
std::string opencog::AtomStorage::oset_to_string ( const HandleSeq ,
int   
)
private
void opencog::AtomStorage::put_conn ( ODBCConnection )
private
void opencog::AtomStorage::rename_tables ( void  )
private
void opencog::AtomStorage::reserve ( void  )

+ Here is the caller graph for this function:

void opencog::AtomStorage::set_typemap ( int  ,
const char *   
)
private
void opencog::AtomStorage::setMaxHeight ( int  )
private
void opencog::AtomStorage::setup_typemap ( void  )
private
void opencog::AtomStorage::store ( const AtomTable )

+ Here is the caller graph for this function:

bool opencog::AtomStorage::store_cb ( AtomPtr  )
private
void opencog::AtomStorage::storeAtom ( AtomPtr  ,
bool  synchronous = false 
)

+ Here is the caller graph for this function:

void opencog::AtomStorage::storeOutgoing ( AtomPtr  ,
Handle   
)
private
void opencog::AtomStorage::storeSingleAtom ( AtomPtr  )
void opencog::AtomStorage::vdo_store_atom ( AtomPtr )
private

Member Data Documentation

async_caller<AtomStorage, AtomPtr> opencog::AtomStorage::_write_queue
private

Definition at line 124 of file AtomStorage.h.

concurrent_stack<ODBCConnection*> opencog::AtomStorage::conn_pool
private

Definition at line 54 of file AtomStorage.h.

char* opencog::AtomStorage::db_typename[TYPEMAP_SZ]
private

Definition at line 109 of file AtomStorage.h.

std::mutex opencog::AtomStorage::id_cache_mutex
private

Definition at line 84 of file AtomStorage.h.

std::set<UUID> opencog::AtomStorage::id_create_cache
private

Definition at line 91 of file AtomStorage.h.

std::mutex opencog::AtomStorage::id_create_mutex
private

Definition at line 90 of file AtomStorage.h.

std::atomic<unsigned long> opencog::AtomStorage::load_count
private

Definition at line 77 of file AtomStorage.h.

Type opencog::AtomStorage::loading_typemap[TYPEMAP_SZ]
private

Definition at line 108 of file AtomStorage.h.

std::set<UUID> opencog::AtomStorage::local_id_cache
private

Definition at line 86 of file AtomStorage.h.

bool opencog::AtomStorage::local_id_cache_is_inited
private

Definition at line 85 of file AtomStorage.h.

int opencog::AtomStorage::max_height
private

Definition at line 65 of file AtomStorage.h.

std::atomic<unsigned long> opencog::AtomStorage::store_count
private

Definition at line 78 of file AtomStorage.h.

int opencog::AtomStorage::storing_typemap[TYPEMAP_SZ]
private

Definition at line 107 of file AtomStorage.h.

bool opencog::AtomStorage::type_map_was_loaded
private

Definition at line 111 of file AtomStorage.h.


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