--- parser3/src/include/pa_pool.h 2001/12/27 19:57:08 1.74 +++ parser3/src/include/pa_pool.h 2002/06/18 09:51:36 1.80 @@ -1,11 +1,11 @@ /** @file Parser: pool class decl. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) + Author: Alexandr Petrosian (http://paf.design.ru) - $Id: pa_pool.h,v 1.74 2001/12/27 19:57:08 paf Exp $ + $Id: pa_pool.h,v 1.80 2002/06/18 09:51:36 paf Exp $ */ #ifndef PA_POOL_H @@ -14,7 +14,9 @@ #include "pa_config_includes.h" #ifdef XML -#include "gdome.h" +# include "gdome.h" +// for xmlChar +# include "libxml/tree.h" #endif // forwards @@ -22,6 +24,7 @@ class Exception; class String; class Charset; +class GdomeDOMString_auto_ptr; /** Pool mechanizm allows users not to free up allocated memory, @@ -35,10 +38,10 @@ public: Pool(void *astorage); - ///{@ statistics + //{@ statistics size_t total_allocated() { return ftotal_allocated; } unsigned int total_times() { return ftotal_times; } - ///}@ + //}@ void set_context(void *acontext) { fcontext=acontext; } void *get_context() { return fcontext; } @@ -58,22 +61,28 @@ public: fail_register_cleanup(); } - ///{@ source charset + //{@ source charset void set_source_charset(Charset& acharset); Charset& get_source_charset(); - ///}@ + //}@ - ///{@ client charset + //{@ client charset void set_client_charset(Charset& charset); Charset& get_client_charset(); - ///}@ + //}@ #ifdef XML + /// @see Charset::transcode_cstr(xmlChar *s); + const char *transcode_cstr(xmlChar *s); + /// @see Charset::transcode(xmlChar *s); + String& transcode(xmlChar *s); + /// @see Charset::transcode_cstr(GdomeDOMString *s); const char *transcode_cstr(GdomeDOMString *s); + /// @see Charset::transcode(GdomeDOMString *s); String& transcode(GdomeDOMString *s); /// @see Charset::transcode(const String& s) - GdomeDOMString *transcode(const String& s); + GdomeDOMString_auto_ptr transcode(const String& s); #endif @@ -132,6 +141,10 @@ private: //disabled @see NEW */ + +// all classes that are members parents of packed class [String] +// sould be packed also to avoid sparc odd st/lduh problem +#include "pa_pragma_pack_begin.h" class Pooled { // the pool i'm allocated on Pool *fpool; @@ -166,6 +179,7 @@ public: #endif //} }; +#include "pa_pragma_pack_end.h" /// useful macro for creating objects on current Pooled object Pooled::pool() #define NEW new(pool())