does anyone know make an existing C++ class that is declared within nested namespaces into a Coherence managed template class?
I have a class and declared within reuters::transactions::tds::cache
I declare the <<, == and hash functions for it.
I've tried variants on either calling 'using namespace reuters::transactions::tds::cache;' or passing in the fully qualified class name to these functions.
If I use the 'using namespace' the binary operator is not found in Management.hpp.
If I try passing in the fully qualified class name everywhere I get the same problem - an addtionally if I try and pass it into COH_REGISTER_MANAGED_CLASS the macro seems to truncate the classname at 'reuters'
If I declare CacheD3ContextTerminalData outside of any namespaces it is ok.
Yes, Managed is meant to work with namespaced classes, please try the following:
- declare the three free functions in the reuters::transactions::tds::cache namespace
- issue the COH_REGISTER_MANAGED_CLASS with the short class name, thus you either do it from within the reuters::transactions::tds::cache namespace or after a corresponding "using namespace"
In your application code when using the Managed wrapper you should be able to either use Managed<CacheD3ContextTerminalData> directly if you've also done a "using namespace reuters::transactions::tds::cache" from within that file, or the fully qualified Managed<reuters::transactions::tds::cache::CacheD3ContextTerminalData> if you have not.
If this does not work for you, please reply with the Coherence version, and compiler and version you are using, and if possible a small reproducer.