I am about to upload a fairly large project of mine, a very flexible component-entity-system. More precisely it's a framework for a CES. It consists of 22 files, ~1000 lines of code and 20000 characters.
My problem is that in order to demonstrate what the framework does, I have 2 base component types (input, graphics) and 2 types of entities included in the framework. This is basically example code, unlike the framework itself. The base components have empty implementation too. However if I omitted these "examples" the usage and usefulness of the framework would be rather inconvenient to figure out. So I have empty implementation of base components and components specific to the particular entities (deriving from base components), because these classes' pure existence gives meaning to the framework's capabilities. Although having this kind of empty implementation is pretty much like having pseudo-code (even if everything compiles) and these tiny segments of code are not open to being reviewed therefore.
As an example here is an example component of an entity, where InputComp<>
is the abstract base class for all InputComp< 'entity name' >
classes.
template<>
class Comp<CompBase::INPUT, void> : public CompBase
{
// Abstract Input component implementation.
};
template<typename Ent_t = void>
using InputComp = Comp<CompBase::INPUT, Ent_t>;
// in another part of the code
template<>
class InputComp<Monkey> : public InputComp<>
{
// Monkey specific Input component implementation.
};
So is it okay to have a small amount of example-like code breathing life into a framework, included in the framework, given proper labeling of these segments.