Qt has a build-in supprt for creating objects with integrated reference counting via QSharedData
and QSharedDataPointer
. All works great, but for each such object I need to write a lot of code: QSharedData
-based implementation class with constructor and copy constructor, object class itsef with accessor methods for each filed.
For a simple structures with 5-10 fields this requires really lot of near same code. Is it some ways to automate such classes generation? Maybe it's some generators exists that take a short description and automatically generates implementation class and object class with all accessors?