[omniORB] compiling template with I::_ptr_type *

Craig Rodrigues rodrigc@mediaone.net
Wed, 31 Jan 2001 19:43:00 -0500


On Wed, Jan 31, 2001 at 04:33:19PM -0700, Janet Tvedt wrote:
> My original code which worked under Visibroker C++ for Tornado
> and omniORB2 used the template function:

You do not mention the compiler version you are using, you
do not include the exact messages output from the compiler, and
you do not provide a fully compilable test-case to reproduce
your error.   This makes it difficult for other people to help you.

> 
> template <class Type> 
> int
> getObjectReference(Type **a, const char *name, CosNaming::NamingContext_var nc, int maxRetries)
> { ... }


> 
> The call to the function looked like the following (for an interface OCS::IAttributeDB)
> 
> OCS::IAttributeDB *obj;
> getObjectReference( &obj, ... );

How about:

template <class Type>
int
getObjectReference( typename Type::_ptr_type a, const char *name, 
                    CosNaming::NamingContext_ptr nc, int maxRetries);

then to call it:

OCS::IAttributeDB_ptr obj;

getObjectReference<OCS::IAttributeDB>(obj, name, nc, maxRetries);

-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net