On Tue, 1 Jun 2004, Roshan Weerasuriya wrote:
> hi all,
>
> Please have a look at the AxisMap class implemented below and provide your
> comments. The implementation files are attached with this mail. The
> attachement includes:
> 1) AxisMap.h, AxisMap.cpp //AxisMap implemntaion
> 2) AxisMapUtils.h, AxisMapUtils.cpp //Utility methods such as Standard
> De-allocator funcitons
> 3) TestMap3.cpp //The sample cpp file which includes example usage of the
> above AxisMap implementation
>
> The idea is to eliminate stl map from the code base and use Axis's own
> AxisMap implementation.
Some comments:
What is the intended use of AxisMap? Note that
insertion/lookup is now O(N), rather than O(lg N). Creating
a map is now O(N^2). Fine if you don't plan on putting a
lot in it. Otherwise it might be a performance problem.
Also, if you are going to be putting a lot of things in it,
you might consider growing exponentially.
I suggest trying to make the interface look like STL. Many
experienced C++ programmers will already be familiar with
STL, which would save them from having to learn yet another
interface.
The heavy use of 'void *' means that you are no longer
type-safe. I would personally prefer either the use of
polymorphism and RTTI, or templates.
In AxixMap::put(), you delete a "void *". Do you mean to
call the value dealloc function instead?
In ~AxisMap(), you are using the pre-ISO scoping rules for
for-loops.
> rgds,
> Roshan
>
> At 10:13 AM 5/6/2004 +0530, you wrote:
> >What I would suggest -
> >1. expose a small set of classes and make the interface stl-free
> >2. in your internal classes you can still use stl
> >
> >Why do you want to remove stl all-together?
> >
> > > -----Original Message-----
> > > From: Kenneth Chiu [mailto:chiuk@cs.indiana.edu]
> > > Sent: Thursday, May 06, 2004 9:41 AM
> > > To: Apache AXIS C Developers List
>
|