Overview - simple-entertainment/simplicity GitHub Wiki
The Simplicity namespace.
Simplicity consists of the following APIs:
- [Common Utilities](Common Utilities)
- Engines
- Entities
- Graphs
- Input
- Logging
- Math
- Messaging
- Models
- Physics
- Rendering
- Resources
- Scenes
- Scripting
- Windowing
The concept of ownership is implemented using smart pointers. If a function takes a smart pointer it will become the owner of the object passed to it. If a function returns a smart pointer it is giving ownership to the callee. Functions that take or return raw pointers do NOT change the owner of the object.
void Simplicity::addEngine(std::unique_ptr<Engine> engine); // Simplicity is taking ownership of the Engine from the callee.
std::unique_ptr<Engine> Simplicity::removeEngine(Engine* engine); // Simplicity is returning ownership of the Engine to the callee.
void RenderingEngine::setGraph(Graph* graph); // The RenderingEngine is obtaining an optional reference to a graph but not taking ownership of it.
Graph* Graph::getParent(); // The Graph is returning an optional reference to its parent (it may not have one) but the callee is not taking ownership.
This convention has meant that the delete keyword does not appear once in simplicity's code-base.