opensim-org/opensim-core — pull request #169 by chrisdembia (2014-08-11 00:03:22+00:00)
Title: Add check that inputs and outputs deserialize.

I added a check in the tests to ensure inputs and outputs deserialize. You'll see the test fails. AFAIK, inputs and outputs do not "deserialize". I spent some time trying to look through the deserialization code and I *think* it's b/c, during the clone operation in deserialization, the inputs and outputs maps are not being cloned. I'm not sure though. If that is the case, it would be caused by my PR TODO.

I tried switching from unique_ptr to ClonePtr, but got this error:
```
/home/fitze/simtk/simbody/include/simbody/SimTKcommon/internal/ClonePtr.h:63:11: error: multiple overloads of 'ClonePtr' instantiate to the same signature
'void (const OpenSim::AbstractInput *)'
explicit ClonePtr(const T* obj) : p(obj?obj->clone():0) { }
^
/home/fitze/repos/simtk/opensim-core/OpenSim/Common/Component.h:352:10: note: in instantiation of template class 'SimTK::ClonePtr' requested
here
if (it != itEnd) {
^
/home/fitze/simtk/simbody/include/simbody/SimTKcommon/internal/ClonePtr.h:54:14: note: previous declaration is here
explicit ClonePtr(T* obj) : p(obj) { }
^
1 error generated.
```

Here's the relevant code:
```
std::map>::const_iterator
it = _inputsTable.find(name); std::map>::const_iterator
itEnd = _inputsTable.end();

if (it != itEnd) {
```

@sherm1 , help me!

I think one solution is using a ClonePtr. The other option is using an ArrayPtrs in conjunction with a map, or using a private list property instead of the ArrayPtrs. I think we prefer the first, though it could lead to people accidentally making clones of the Inputs and Outputs.

Please advise.