27 template class ::IceInternal::Handle<::armarx::TermImpl>;
38 TermImpl::addChild(
const TermImplBasePtr& child,
const Ice::Current&
c)
40 child->setParent(
this);
42 childs.push_back(child);
46 TermImpl::getChilds(
const Ice::Current&
c)
52 TermImpl::getParent(
const Ice::Current&
c)
58 TermImpl::getValue(
const Ice::Current&
c)
const
64 TermImpl::getDatafields(
const Ice::Current&)
const
66 return datafieldValues;
70 TermImpl::getType(
const Ice::Current&
c)
const
85 TermImpl::updateWithData(
const Ice::Current&
c)
89 parent->updateWithData();
94 TermImpl::removeChildren()
97 TermImplSequence::iterator iterChilds = childs.begin();
99 while (iterChilds != childs.end())
103 (*iterChilds)->resetParent();
106 childs.erase(iterChilds);
107 iterChilds = childs.begin();
111 this->childs.clear();
115 TermImpl::setParent(
const TermImplBasePtr& parent,
const Ice::Current&
c)
117 this->parent = parent;
121 TermImpl::resetParent(
const Ice::Current&
c)
127 TermImpl::atomicDecAndTestValue(
volatile int* counter,
int value)
130 __asm__ __volatile__(
"lock ; decl %0; sete %1"
131 :
"=m"(*counter),
"=qm"(
c)
147 int numberChilds = int(childs.size());
149 assert(InterlockedExchangeAdd(&_ref, 0) > 0);
151 if (InterlockedDecrement(&_ref) == numberChilds && !_noDelete)
157 #elif defined(ICE_HAS_GCC_BUILTINS)
158 int c = __sync_fetch_and_sub(&_ref, 1);
161 if ((
c == numberChilds + 1) && !_noDelete)
167 #elif defined(ICE_HAS_ATOMIC_FUNCTIONS)
168 assert(IceUtilInternal::atomicExchangeAdd(&_ref, 0) > 0);
170 if (IceUtilInternal::atomicDecAndTestValue(&_ref, numberChilds) && !_noDelete)
175 #elif ICE_INT_VERSION >= 30603
176 int c = _ref.fetch_sub(1);
179 if ((
c == numberChilds + 1) && !__hasFlag(NoDelete))
186 bool doDelete =
false;
189 if (--_ref == numberChilds)
191 doDelete = !_noDelete;