Monday, December 14, 2015

In Which Documenting in Hindsight is Probably Important

Today was a big(ish) meeting for the capstone group. Namely, it gives me a little more to do, as I need to document my code a little bit. Ideally we'll be setting up an actual wiki for documentation, but I figured it'd be necessary to note and document data members and function prototypes.

I'm also in the midst of figuring out the translation from Blueprints to C++ in AI navigation, but I'm a little confused as to what "Event Receive Execute" (when an event is executed in a task) translates to in C++. I'll experiment with it tomorrow.

I also did a little bit of pitch-based programming to prepare for (when I actually know how to interpret the EEG data). The data is best represented as a ratio of signal versus threshold, so I represented that signal as a pitch on a soothing sound of ocean waves.

I also learned some more things in studying C++, including the fun of learning a bit how templates work.

Step 1: Private inheritance is good, but denotes more of a "has-a" relationship of composition, in which the inheritor only has access to some bits, as opposed to the publicly inheriting "is-a" relationship.

Step 2: Multiple inheritance is tricky, as virtual base classes may be necessary to prevent replication of base class data. That said, the same thing can probably be done with singular inheritance anyways.

Step 3: Templates imply an interface and do compile-time inherited objects in the case of !=, >, and other such operators that produce a family of related functions around logically valid statements.

Step 4: Use the "typename" command for nested dependent type names (T::iterator, for example) but make sure to keep it out of base class identifiers.

Step 5: How does one access names in template base classes? Using directives and accessing the base class via this-> usually does the trick.

Step 6: Template code usually depends on a parameter - keep the non-template parameters out of the typename specifier and create separate functions to reduce unneeded replication

Whew! What a day - I do enjoy balancing a bunch of different tasks though!

No comments:

Post a Comment