From: S R. <kiw...@ma...> - 2009-10-26 17:36:11
|
On Oct 26, 2009, at 13:09 , Konstantin Litvinenko wrote: > On 26.10.2009 15:43, S Roderick wrote: > [.........huge skip.........] > Roderick, I understand all your wishes and can propose followed > solution: > > 1. We add ability to set up creator for categories in > HierarchyMaintainer > 2. You write you own RTCategory that derived from log4cpp Category > and meet all your requirements - > you hide from usage all functions that receive std::strings and > expose those that receive rt_strings. > 3. To use log4cpp in usual manner user should setup default creator > as RTCategory creator and do > following when obtaining reference on RTCategory: > > class foo > { > public: > foo() : > logger_ > (static_cast<RTCategory&>(log4cpp::Category::getInstance("foo"))) > { > } > > private: > RTCategory& logger_; > }; > > Please, comment this. This all sounds reasonable, but let me look at it some more. > As for rt allocator in HierarchyMaintainer that is really hard and > likely impossible, because I > don't know how to rewrite HierarchyMaintainer::_getInstance in a way > that it become rt. It uses > std::string and I see no way how to avoid std::string creation... Fair enough. Thanks! Stephen |