Never to be completed. Always sitting as: Nearly Complete - I will probably release bits and pieces of this over the years as they become 'complete'. Most of this framework is available in the PAL and ImprovCV projects.
The framework incldes: Memory management (stack/new/autodelete), Abstract pluggable factory patterns, versioning, base components, OS filesystem abstraction, OS dynamic library (shared library) abstraction, error logging, serialization, OS socket abstraction, and more...
^ top#include <crtdbg.h> int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // Get current flag flag |= _CRTDBG_LEAK_CHECK_DF; // Turn on leak-checking bit _CrtSetDbgFlag(flag); // Set flag to the new valueIf you want to see which calls to new are causing the memory leaks and have the MSVC IDE point to the lines of code which allocate the memory that causes the leak, simply redefine new as such:
#define new new(_NORMAL_BLOCK,__FILE__, __LINE__)All done!
TerminateProcess(GetCurrentProcess(),0);This is especially handy if your working on some small demo application that has a nasty habit of crashing on termination. (If you actually want to fix the problem, its probably due to memory allocations or your deconstructors for static objects).
void CommaDelimited(std::string s) { std::string::size_type pos = 0; std::string::size_type last_pos = 0; pos = s.find_first_of(","); while (pos!=std::string::npos) { //do something with: s.substr(last_pos,pos-last_pos) pos++; last_pos=pos; pos = s.find_first_of(",",pos); } //do something with: s.substr(last_pos) }^ top