[omniORB] How to get refcount

Duncan Grisby duncan at grisby.org
Mon Oct 6 17:00:26 BST 2003


On Monday 6 October, "Clarke Brunt" wrote:

> >   I want to user default refcounting of omni.  So I have derived my class
> > from PortableServer::ServantBase.
> > _add_ref() and _remove_ref can add/remove a refcount. But what if I want
> to
> > get a refcount. there is nothing such as _ref_count() ?????
> 
> Do you mean you inherited RefCountServantBase? You get 'ordinary'
> ServantBase anyway as a result of deriving your class from POA_whatever.

[...]
> If you want something different, then you are free to write your own
> implementation for these methods, overriding the null ones in ServantBase.
> You could look at the Omni source code for RefCountServantBase as a starting
> point.

Clarke is right about how to get hold of the reference count. However,
why do you want to be able to retrieve it?  If you are using it for
anything other than debugging purposes, I'd suggest that your code is
doing something nefarious that it shouldn't be doing.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list