diff options
author | Josh Blum | 2013-06-05 21:28:17 -0700 |
---|---|---|
committer | Josh Blum | 2013-06-05 21:28:17 -0700 |
commit | 58a54c2cc19113d7644b80ec032b89fa1c38a54a (patch) | |
tree | 145b5b28011410166401e3a01361f77fa4dbadca /lib/gras_impl/block_actor.hpp | |
parent | 7889847eed1e8bc003b88b0d6ad4f7904873d2ac (diff) | |
download | sandhi-58a54c2cc19113d7644b80ec032b89fa1c38a54a.tar.gz sandhi-58a54c2cc19113d7644b80ec032b89fa1c38a54a.tar.bz2 sandhi-58a54c2cc19113d7644b80ec032b89fa1c38a54a.zip |
gras: separate actor data to struct to aid migration
Diffstat (limited to 'lib/gras_impl/block_actor.hpp')
-rw-r--r-- | lib/gras_impl/block_actor.hpp | 65 |
1 files changed, 3 insertions, 62 deletions
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp index a7ed6c5..005855e 100644 --- a/lib/gras_impl/block_actor.hpp +++ b/lib/gras_impl/block_actor.hpp @@ -4,21 +4,12 @@ #define INCLUDED_LIBGRAS_IMPL_BLOCK_ACTOR_HPP #include <gras_impl/debug.hpp> -#include <gras_impl/bitset.hpp> -#include <gras/gras.hpp> #include <gras/block.hpp> #include <gras/top_block.hpp> #include <gras/thread_pool.hpp> #include <Apology/Worker.hpp> -#include <gras_impl/token.hpp> -#include <gras_impl/stats.hpp> #include <gras_impl/messages.hpp> -#include <gras_impl/output_buffer_queues.hpp> -#include <gras_impl/input_buffer_queues.hpp> -#include <gras_impl/interruptible_thread.hpp> -#include <vector> -#include <set> -#include <map> +#include <gras_impl/block_data.hpp> namespace gras { @@ -32,12 +23,13 @@ struct PropertyRegistryPair struct BlockActor : Apology::Worker { - BlockActor(void); + BlockActor(const ThreadPool &tp = ThreadPool()); ~BlockActor(void); Block *block_ptr; std::string name; //for debug ThreadPool thread_pool; Token prio_token; + boost::shared_ptr<BlockData> data; //do it here so we can match w/ the handler declarations void register_handlers(void) @@ -116,62 +108,11 @@ struct BlockActor : Apology::Worker bool is_input_done(const size_t index); bool is_work_allowed(void); - //per port properties - std::vector<InputPortConfig> input_configs; - std::vector<OutputPortConfig> output_configs; - - //work buffers for the new work interface - Block::InputItems input_items; - Block::OutputItems output_items; - - //track the subscriber counts - std::vector<Token> input_tokens; - std::vector<Token> output_tokens; - BitSet inputs_done; - BitSet outputs_done; - std::set<Token> token_pool; - - //buffer queues and ready conditions - InputBufferQueues input_queues; - OutputBufferQueues output_queues; - std::vector<bool> produce_outputs; - BitSet inputs_available; - std::vector<time_ticks_t> time_input_not_ready; - std::vector<time_ticks_t> time_output_not_ready; - - //tag and msg tracking - std::vector<bool> input_tags_changed; - std::vector<std::vector<Tag> > input_tags; - std::vector<size_t> num_input_msgs_read; - std::vector<std::vector<PMCC> > input_msgs; - - //interruptible thread stuff - bool interruptible_work; - SharedThreadGroup thread_group; - boost::shared_ptr<InterruptibleThread> interruptible_thread; - //work helpers inline void task_work(void) { block_ptr->work(this->input_items, this->output_items); } - - //is the fg running? - enum - { - BLOCK_STATE_INIT, - BLOCK_STATE_LIVE, - BLOCK_STATE_DONE, - } block_state; - long buffer_affinity; - - std::vector<std::vector<OutputHintMessage> > output_allocation_hints; - - //property stuff - std::map<std::string, PropertyRegistryPair> property_registry; - PMCC prop_access_dispatcher(const std::string &key, const PMCC &value, const bool set); - - BlockStats stats; }; //-------------- common functions from this BlockActor class ---------// |