Mixins

https://michael-afanasiev.github.io/2016/08/03/Combining-Static-and-Dynamic-Polymorphism-with-C++-Template-Mixins.html

http://www.thinkbottomup.com.au/site/blog/C%20%20_Mixins_-_Reuse_through_inheritance_is_good

See section: 3 Component Programming with C++ Mix-ins: Pragmatic Considerations on Pg. 5…

https://www.cs.utexas.edu/ftp/predator/gcse2000.pdf

See section “Mixins with CRTP”…

https://www.modernescpp.com/index.php/c-is-still-lazy

https://stackoverflow.com/questions/26486456/two-different-mixin-patterns-in-c-mixin-crtp

———————————————————

Ideal situation, would allow for Mixins to be parameterized from the state.h file such as…

ROTATE_DEGREES<90>, NAVIGATE_FORWARD<10>, ROTATE_DEGREES<65>, NAVIGATE_FORWARD<25>.

https://en.wikipedia.org/wiki/Data,_context_and_interaction

————————————————-

https://meetingcpp.com/mcpp/slides/

Using Odin’s terminology…

  • Abilities = Orthogonals, or more accurately components, maybe substates.
  • Interface Mixins (will be called from state.h files)
  • Implementation Mixins would be substates?

—————————————————————————–

https://stackoverflow.com/questions/495021/why-can-templates-only-be-implemented-in-the-header-file


Code Layout

State.h class would interface with mixins for substates

Orthogonals would comprise a resource, and a behavior

The resources would be assigned in one file for the entire StateMachine Think…

  • Orthogonal <0> : Nav Stack
  • Orthogonal <1>: Move It
  • Orthogonal <2> : Temp Sensor 1…
  • etc