diff options
Diffstat (limited to 'include/gras/block.hpp')
-rw-r--r-- | include/gras/block.hpp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/include/gras/block.hpp b/include/gras/block.hpp index c33f7f9..f00a6f7 100644 --- a/include/gras/block.hpp +++ b/include/gras/block.hpp @@ -109,6 +109,22 @@ struct GRAS_API Block : Element Block(const std::string &name); /******************************************************************* + * Item sizes for ports + ******************************************************************/ + + //! Get the input item size for this port in bytes + size_t get_input_size(const size_t which_input) const; + + //! Set the input item size for this port in bytes + void set_input_size(const size_t which_input, const size_t bytes); + + //! Get the output item size for this port in bytes + size_t get_output_size(const size_t which_output) const; + + //! Set the output item size for this port in bytes + void set_output_size(const size_t which_output, const size_t bytes); + + /******************************************************************* * Deal with input and output port configuration ******************************************************************/ @@ -204,12 +220,6 @@ struct GRAS_API Block : Element * Work related routines and fail states ******************************************************************/ - //! Called when the flow graph is started, can overload - virtual bool start(void); - - //! Called when the flow graph is stopped, can overload - virtual bool stop(void); - typedef WorkBufferArray<const void *> InputItems; typedef WorkBufferArray<void *> OutputItems; @@ -308,6 +318,20 @@ struct GRAS_API Block : Element void post_output_buffer(const size_t which_output, const SBuffer &buffer); /*! + * Overload notify_active to get called when block becomes active. + * This will be called when the TopBlock start/run API call executes. + * The default implementation of notify_active is a NOP. + */ + virtual void notify_active(void); + + /*! + * Overload notify_inactive to get called when block becomes inactive. + * This will be called when the TopBlock stop/run API call executes. + * The default implementation of notify_inactive is a NOP. + */ + virtual void notify_inactive(void); + + /*! * Overload notify_topology to get called on topological changes. * Use notify_topology to perform one-time resizing operations * to avoid a conditional resizing operation inside the work(). |