As a JntArray() default constructor doesn't exist, the use case scenarios for JntArray and for an equivalent std::vector
Basically, if the component is configured with the number of axes in configureHook(), then you have to "new JntArray(num_axes)" at that point, forcing all JntArray members to be pointers. A std::vector
What do people think of adding a JntArray() constructor that simply sets size(0) and data(NULL), and adding a resize() function. This would make the interface consistent with std::vector (used extensively throughout RTT and OCL code) making for more understandable code (IMHO).
I believe that all the existing JntArray functions will work as expected without modification, due to size being 0. The only exceptions are the operator() accessors and the copy constructor. They would need slight mod's to protect against the case of an default constructed JntArray object being used, or it would need to be explicitly stated that "interesting behaviour" will occur if you create an object with JntArray() and do not resize it before an operator() access, etc.
I believe there was a discussion on the forum a few weeks back about objects being created in dormant/zombie states, or something similar. I think this is an example of that ...?