Hi Adrian,
Could you send me the whole file that you've changed.
Thanks,
Robert.
On 7/4/06, Adrian Egli <[EMAIL PROTECTED]> wrote:
the trouble is very stupid: observer_ptr is intepreted by the compiler as a
class instead of
an ptr reference.
solution:
void Referenced::addObserver(Observer* in_observer_ptr)
{
if (_refMutex)
{
OpenThreads::ScopedLock<OpenThreads::Mutex>
lock(*_refMutex);
if (!_observers) _observers = new ObserverSet;
if (_observers)
static_cast<ObserverSet*>(_observers)->insert(in_observer_ptr);
}
else
{
if (!_observers) _observers = new ObserverSet;
if (_observers)
static_cast<ObserverSet*>(_observers)->insert(in_observer_ptr);
}
}
void Referenced::removeObserver(Observer* in_observer_ptr)
{
if (_refMutex)
{
OpenThreads::ScopedLock<OpenThreads::Mutex>
lock(*_refMutex);
if (_observers)
static_cast<ObserverSet*>(_observers)->erase(in_observer_ptr);
}
else
{
if (_observers)
static_cast<ObserverSet*>(_observers)->erase(in_observer_ptr);
}
}
2006/7/4, Adrian Egli < [EMAIL PROTECTED]>:
>
> hi robert,
>
> Compiling...
> Referenced.cpp
>
C:\DATEN\DEV\OpenSceneGraphCVS_\OpenSceneGraph\src\osg\Referenced.cpp(230)
: error C2955: 'observer_ptr' : use of class template requires template
argument list
> ../../include\osg/observer_ptr(99) : see
declaration of 'observer_ptr'
>
C:\DATEN\DEV\OpenSceneGraphCVS_\OpenSceneGraph\src\osg\Referenced.cpp(246)
: error C2955: 'observer_ptr' : use of class template requires template
argument list
> ../../include\osg/observer_ptr(99) : see
declaration of 'observer_ptr'
> Error executing cl.exe.
>
> osg.dll - 2 error(s), 0 warning(s)
>
>
>
>
>
>
>
> 2006/7/4, Robert Osfield < [EMAIL PROTECTED] >:
>
> > Hi Adrian,
> >
> > On 7/4/06, Adrian Egli < [EMAIL PROTECTED] > wrote:
> > > i tried to compile it, and i got similar trouble Observer class
> >
> > Could you provide the specific errors please.
> >
> > > i am not running in single threaded, so i have to lock / unlock some
shared
> > > resources. At the moment
> > > may application just using the OpenThreads stuff. Mutex, Thread only
this
> > > both classes.
> > > the code above should show where i have an issue (only) on one
machine.
> > > because normally i use
> > > mutex.lock to lock a mutex, as common way. but if i implement my own
lock :
> > >
> > > while ( ! mutex.tryLock() ) SwitchToThread();
> > >
> > > instead of mutex.lock() the issue will more or less disappear.
> > >
> > > but i have to retry and debug it. i hope i will find out what would be
the
> > > issue.
> >
> > I can't shed any light on Window specific issues I'm afraid, let alone
> > thread specific issue under Windows.
> >
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/