I am very happy to announce that CPPCodeProvider is almost complete in implementation. The first beta release will be available at the download site shortly, hosted by source forge. And as time is passing, this post is becoming more and more of a wish list than some sort of release notes. A separate post on current bugs follows.
The reason it took so long to complete was due to me being lazy. The last functions were the largest to write, the hardest to work out and most important, without them it was impossible to write out a user defined type.
Also, I have done some more prettification for final code rendering. A bug which lay undiscovered so far has been fixed. It involved instantiating a type with bool which was not recognized and threw invalid_argument exception.
Two things I would like to note are: I have made the way code is indented in the output stream(s). Each class now dictates its own indentation by using tabs argument and no one else does that work for it. Additionally, if any CodeObject needs to have newline rendered after it, that newline must be rendered by the calling code because most of the time, it is out of context to know if a newline will not disturb the indentation and formatting.
After these two changes there should be no formatting problems as far as I can say. However, if you do see something messed up missing newlines or incorrect indentation, drop me a line on sourceforge about that specific CodeObject and if possible, some CodeDOM to reproduce the issue.
One more thing to note is the behavior of constructors of copying_pointer. Both constructors which take T* and T& own the passed argument. Therefore, be very careful if you do this:
copying_pointer< T > a( new T ) , b( *a );
This line will cause T to be deleted twice and if you are lucky this will be caught during debug builds. Correct way is to write
copying_pointer< T > a( new T ) , b( a );
because the copy constructor makes a copy of passed argument, hence no ownership issues. Similarly, UDT will own the destructor assigned to it. Be careful with that after memory leak is fixed.
I am also working on efficiently implementing BasicType. It’s purpose is to model primitive types which are only handful and rarely change. Therefore, it would be wise to have a cache of BasicType which handed out an object given the type name. But I will need to further investigate as it will undoubtedly introduce race conditions during cache initialization.
Also, next time there will be support to indent using either tabs or space.