Class cell2D_fsm

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

  • public rpfsm::simple_fsm

  • public rer::client< cell2D_fsm >

Class Documentation

class cell2D_fsm : public rpfsm::simple_fsm, public rer::client<cell2D_fsm>

Per-cell FSM containing the current state of the cell (empty, has a block, has a cache, unknown, etc.). Used by cads::arena_grid.

Public Types

using state = cell2D_state

Public Functions

cell2D_fsm(const cell2D_fsm &other)

Initialize a COPY of a class instance via copy construction.

This function is necessary to use this class with rcppsw::ds::stacked_grid, because the boost::multi_array it is built on only calls the constructor for the cell object type ONCE, and then uses the copy constructor to initialize the rest of the cells.

My FSM paradigm uses MEMBER function pointers, so you need to initialize the state map cleanly WITHOUT copy construction (even though this is the copy constructor), otherwise all copies of the object will use the other object’s state map (default behavior in default copy constructor). If other is destructed, then you will get a segfault due to dangling pointers.

cell2D_fsm(void)
~cell2D_fsm(void) override = default
inline size_t block_count(void) const
void event_block_drop(void)
void event_block_extent(void)
void event_block_pickup(void)
void event_cache_extent(void)
void event_empty(void)
void event_nest_extent(void)
void event_unknown(void)
cell2D_fsm &operator=(const cell2D_fsm&) = delete
inline bool state_has_block(void) const
inline bool state_has_cache(void) const
inline bool state_in_block_extent(void) const
inline bool state_in_cache_extent(void) const
inline bool state_in_nest_extent(void) const
inline bool state_is_empty(void) const
inline bool state_is_known(void) const