[reSIProcate] Emulating Namespace Keyword

Adam Roach adam at nostrum.com
Wed Aug 10 18:51:26 CDT 2005


I think the problem you'll run into is that C++ classes are closed after 
their declaration, including any nested classes. So, for example, the 
following won't work:

class foo
{
  public:
    class bar;
};

class foo::bar
{
};

...because the class foo::bar was closed as soon as the class foo was 
closed.

I don't have much in the way of a suggestion; although, if you are going 
to touch every file (as your initial mail suggested you were about to), 
you might be able to get away with just ripping the namespacing out 
altogether.

That said, I would be concerned that a complier that doesn't support 
namespacing (which was added to the C++ standard a very, very long time 
ago) probably also doesn't do critical "newer" things like templates, 
exceptions, and the standard library, all of which are heavily used by 
resip. You should probably find a working compiler that targets your 
platform; I'll note that g++ has an obscene number of supported target 
platforms.

/a

Jerry Richards wrote:

>Well, after deep thought, here is how I plan to emulate the "namespace"
>keyword in the reSIProcate stack (since my compiler does not support it):
>
>For each namespace (i.e. resip, std, HASH_MAP_NAMESPACE, SecurityType,
>Loadgen), I will create a *.cxx and *.hxx file (e.g. resip.cxx and
>resip.hxx).  These will define the interface and implementation for a new
>resip class, which will include to sum of all the resip namespace
>declarations.
>
>Then, each "namespace resip {......}' item, declaration will be replaced
>with an "#include resip.hxx".  And each "using namespace resip;" statement
>will be replaced with "class resip;"
>
>Any issues with this plan?  Any better suggestions?  I realize, these
>changes diverge significantly from the original implementation.
>
>Best Regards,
>Jerry
>
>
>_______________________________________________
>resiprocate-devel mailing list
>resiprocate-devel at list.sipfoundry.org
>https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>
>  
>




More information about the resiprocate-devel mailing list