LILAC
|
#include <engineimp.h>
Public Member Functions | |
void | write_dat () |
Writes formatted data to disk and clears from ram. | |
void | add_writer (const std::shared_ptr< writer > &wval) |
Adds a new writer to the engine. | |
void | needs_updating (std::string name) |
void | needs_updating (std::shared_ptr< item > p) |
void | remove_item (std::string name) |
Returns the current count for updating, aka removing items. | |
void | run () |
Runs the engine. | |
bool | item_exists (std::shared_ptr< item > val) const |
Queries whether an item exists or not. | |
bool | item_exists (const std::string &val) const |
engineimp (const std::string &fname, const std::string &outname, const std::string &index) | |
Constructor, reads from an input file. | |
~engineimp () | |
Deletes data. |
Public Attributes | |
size_t | index |
Private Member Functions | |
void | read (std::istream &fstr) |
void | _read (std::istream &fstr) |
void | sort_pp () |
void | execute_command (std::string inval) |
void | update () |
Private Attributes | |
std::thread | write_thread |
std::mutex | data_lock |
std::mutex | condition_lock |
std::condition_variable | write_cond |
volatile std::atomic_size_t | datas_queued |
volatile std::atomic_char | is_over |
std::string | curdir |
FILE * | ofile |
std::map< size_t, std::list < std::shared_ptr< writer > > > | writers |
std::list< std::map< size_t, std::list< std::shared_ptr < writer > > > > | async_write_queue |
std::map< std::string, item_wrapper > | values |
std::map< std::string, input > | inputs |
std::set< std::shared_ptr< item > > | update_vars |
Friends | |
class | engine |
class | item |
class | variable |
item_wrapper | eval_lisp (std::string in_cmd, std::string base_name, std::map< std::string, input > &inv, engineimp *en) |
This class is the actual engime implementation. It is kept separate from the engine class to allow editing without having to recompile large portions of the program. It also makes interfacing safer as one has limited access to the internals of the engine.
In the future, there may be different types of engine (MPI-based engines, pure learning engines, etc) and this will make it much easier to implement and work on those w/o exposing the logic to the rest of the program. I do need to move some of the engineimp functions to the engine class, however. But for now, I need to get the c-elegans code running and some proper tutorials written
Definition at line 47 of file engineimp.h.
engineimp::engineimp | ( | const std::string & | fname, |
const std::string & | outname, | ||
const std::string & | index | ||
) |
Constructor, reads from an input file.
Definition at line 30 of file engine.cpp.
engineimp::~engineimp | ( | ) |
|
private |
Definition at line 27 of file engine_read.cpp.
void engineimp::add_writer | ( | const std::shared_ptr< writer > & | wval | ) |
Adds a new writer to the engine.
Definition at line 22 of file engine_write.cpp.
|
private |
Definition at line 78 of file engine_read.cpp.
bool engineimp::item_exists | ( | std::shared_ptr< item > | val | ) | const |
Queries whether an item exists or not.
Definition at line 68 of file engine.cpp.
bool engineimp::item_exists | ( | const std::string & | val | ) | const |
Definition at line 79 of file engine.cpp.
void engineimp::needs_updating | ( | std::string | name | ) |
Adds an item to the list of items that require updating
name | Name of the item that requires updating |
Definition at line 96 of file engine.cpp.
void engineimp::needs_updating | ( | std::shared_ptr< item > | inval | ) |
Adds an item to the list of items that require updating Goes by pointer so that items that are not part of the engine can be updated. Useful for wrapper classes such as the integrators
inval | Pointer to the item that requires updating |
Definition at line 113 of file engine.cpp.
|
private |
Definition at line 23 of file engine_read.cpp.
void engineimp::remove_item | ( | std::string | name | ) |
Returns the current count for updating, aka removing items.
void engineimp::run | ( | ) |
Runs the engine.
Definition at line 21 of file engine_run.cpp.
|
private |
Sorts the items in order of dependencies and performs all of the postprocessing
Definition at line 66 of file engine_read.cpp.
|
private |
Updates items which reference variables that require changing, and resets the list of items which require updating
Definition at line 86 of file engine.cpp.
void engineimp::write_dat | ( | ) |
Writes formatted data to disk and clears from ram.
Definition at line 26 of file engine_write.cpp.
|
friend |
Definition at line 83 of file engineimp.h.
|
friend |
Definition at line 75 of file eval_lisp.cpp.
|
friend |
Definition at line 84 of file engineimp.h.
|
friend |
Definition at line 85 of file engineimp.h.
|
private |
Definition at line 62 of file engineimp.h.
|
private |
Definition at line 50 of file engineimp.h.
|
private |
Definition at line 59 of file engineimp.h.
|
private |
Definition at line 49 of file engineimp.h.
|
private |
Definition at line 52 of file engineimp.h.
size_t engineimp::index |
Definition at line 71 of file engineimp.h.
|
private |
Definition at line 64 of file engineimp.h.
|
private |
Definition at line 53 of file engineimp.h.
|
private |
Definition at line 60 of file engineimp.h.
|
private |
Definition at line 65 of file engineimp.h.
|
private |
Definition at line 63 of file engineimp.h.
|
private |
Definition at line 51 of file engineimp.h.
|
private |
Definition at line 48 of file engineimp.h.
|
private |
Definition at line 61 of file engineimp.h.