[ODE] odecpp.h
Martin C. Martin
martin at metahuman.org
Tue Jul 23 15:25:02 2002
maddocks@metservice.com wrote:
>
> My point was that in ode you can't create a 'dSpace' . It has to be a
> SimpleSpace or a HashSpace so you shouldn't be able to create a dSpace
> with odecppp.h.
Well the simple space doesn't seem to be used much. It's not used at all
in any of the tests, not even the space test. It seems to have only a few
minor advantages over the hash space, and some big disadvantages. And the
old odecpp.h only had a single dSpace, which used the hash space.
Given this almost overwhelming bias toward hash spaces, I'd suggest
leaving dSpace as a hash space, and creating a sub class, dSimpleSpace.
In other words, when the user doesn't want to worry about the different
kinds of space, they just use the base class and get the hash space. But,
if they want, they can use a simple space instead, and use it everywhere a
hash space can be used. All you'd need to do is provide a constructor.
The entire class would look like this:
class dSimpleSpace : public dSpace
{
public:
dSimpleSpace()
{ _id = dSimpleSpaceCreate(); }
};
- Martin