lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I read on the mailing list archives that I can use module to group code into C++
namespaces. A simple test seems to prove that at the very least, tolua will
create wrappers for a class in a namespace, and, with a slight modification,
compile the bindings.

However, to get it to fully work, I have to add a "using namespace" into the C++
file generated by tolua. Is this normal, or is there anyway around this? It
isn't too much of a hassle, but it's a hassle all the same. I think I assumed
that tolua would add the "using namespace" into the C++ bindings file it generated.

This is my tolua package file:

module Habitat
{
	module Core
	{
		class hbBaseObject  
		{
			public:
				/** This is the base object constructor. */
				hbBaseObject();

				/** This is the base object destructor. */
				virtual ~hbBaseObject();

		};
	}
}

I have to add:

using namespace Habitat::Core;

into the hbBaseObject_lua.cpp file that tolua generates.

Thanks
Mike