Skip to content

v0.1.0

Compare
Choose a tag to compare
@bengreenier bengreenier released this 01 Oct 23:45
· 3 commits to master since this release

v0.1.0

Initial release! 🚀

Changes

  • Support basic (default ctor) object allocator
  • Support custom (functional) object allocation
  • Support custom (functional) object deallocation
  • Hold object references for reuse (think DI)
  • Allocate objects on the fly with simple syntax (Object<Type>::Get())
  • Use c++11 shared_ptr to keep object lifecycle easy to understand

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 Object<Type, ObjectLifecycle::Global>::Get() to re-use the same object over and over
  7. (optional) use Object<Type>::Get(int) to scope allocations by an arbitrary int