Deprecated Containers

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
(UT_GenericQueue)
Line 2: Line 2:
In 2004, several of these containers got templated to provide a better compile time type safety.
In 2004, several of these containers got templated to provide a better compile time type safety.
 +
 +
But this is not broken so why changing?
 +
 +
There are several reason. First and foremost, sharing code: libstc++ is already mapped in memory so why no use it. These container are optimized for speed. I have no benchmark of proof that they are faster than ours, but intrinsically, there are more people working on them. Also gdb has support for displaying these containers from the standard library.
 +
And last but not least, the use of standard algorithm might lead to the removal of code.
= UT_GenericVector =
= UT_GenericVector =

Revision as of 18:44, 12 June 2009

Since the begining, AbiWord reimplemented its own containers for use across the framework. One of the reason was that STL implementation and template support sucked back in the end of 90's. But this is not longer the case.

In 2004, several of these containers got templated to provide a better compile time type safety.

But this is not broken so why changing?

There are several reason. First and foremost, sharing code: libstc++ is already mapped in memory so why no use it. These container are optimized for speed. I have no benchmark of proof that they are faster than ours, but intrinsically, there are more people working on them. Also gdb has support for displaying these containers from the standard library. And last but not least, the use of standard algorithm might lead to the removal of code.

Contents

UT_GenericVector

Header: ut_vector.h

This templated container should be replaced by std::vector<>. UT_Vector should be replaced by the proper type-safe template.

UT_GenericStringMap

Header: ut_hash.h

This should be replaced either by std::map or by the extension hash_map or tr1::unordered_map. The key type is then a std::string

Strings

Header: ut_string_class.h, ut_stringbuf.h

The strings are a mess. UT_String MUST go away. Use std::string or const char * in some cases.

UT_UTF8String is to be removed in a lot of case, replaced by std::string. Maybe in all cases.

UT_UCS4String is to be replaced by std::basic_string<UCS4Char>.

We should provide replacement convenience functions for convert between the various unicode encodings only when necessary.

UT_StringBuf must go anyway.

UT_Stack

Header: ut_stack.h

UT_Stack must be replaced by std::stack. There are very few occurences left. UT_NumberStack should get the same.

UT_GenericQueue

Header: ut_queue.h

No longer used. Removed in revision 26804.

Personal tools