Skip to content

v0.3.0

Latest
Compare
Choose a tag to compare
@bengreenier bengreenier released this 15 May 19:27

v0.3.0

Add Factory class for 👴 style factory things.

Changes

  • adds Factory
  • updates docs
  • updates tests

Usage

  1. Add CppFactory.hpp to your project (either an include directory, or directly in the project)
  2. Include CppFactory.hpp
  3. (optional, otherwise prefix classes) add using namespace CppFactory
  4. Use Object<Type>::Get() to allocate objects
  5. (optional) use Object<Type>::RegisterAllocator() to define a custom allocator for a type
  6. (optional) use GlobalObject<Type>::Get() to re-use the same object over and over
  7. (optional) use [Global]Object<Type>::Get<int>() to scope allocations by an arbitrary int (zones)