v0.1.0
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
- Add
CppFactory.hpp
to your project (either an include directory, or directly in the project) - Include
CppFactory.hpp
- (optional, otherwise prefix classes) add
using namespace CppFactory
- Use
Object<Type>::Get()
to allocate objects - (optional) use
Object<Type>::RegisterAllocator()
to define a custom allocator for a type - (optional) use
Object<Type, ObjectLifecycle::Global>::Get()
to re-use the same object over and over - (optional) use
Object<Type>::Get(int)
to scope allocations by an arbitraryint