TermImpl Class Referenceabstract

#include <ArmarXCore/observers/condition/TermImpl.h>

+ Inheritance diagram for TermImpl:

Public Member Functions

void addChild (const TermImplBasePtr &child, const Ice::Current &c=Ice::emptyCurrent) override
 Add child to term. More...
 
TermImplSequence getChilds (const Ice::Current &c=Ice::emptyCurrent) override
 retrieve childs of this term in the expression tree. More...
 
StringVariantBaseMap getDatafields (const Ice::Current &) const override
 
TermImplBasePtr getParent (const Ice::Current &c=Ice::emptyCurrent) override
 retrieve parent of this term in the expression tree. More...
 
TermType getType (const Ice::Current &c=Ice::emptyCurrent) const override
 Retrieve type of term. More...
 
bool getValue (const Ice::Current &c=Ice::emptyCurrent) const override
 retrieve current value of term. More...
 
virtual void output (std::ostream &out) const =0
 output to stream. More...
 
void removeChildren ()
 
void update (const Ice::Current &c=Ice::emptyCurrent) override
 Updates the parent in the expression tree. More...
 
void updateWithData (const Ice::Current &c=Ice::emptyCurrent) override
 
 ~TermImpl () override
 Destructor of TermImpl. More...
 

Protected Member Functions

void __decRef () override
 Overwritten version of reference counting from GCShared. More...
 
void __incRef () override
 Overwritten version of reference counting from GCShared. More...
 
void resetParent (const Ice::Current &c=Ice::emptyCurrent) override
 Reset the parent of this term. More...
 
void setParent (const TermImplBasePtr &parent, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the parent for this term in the expression tree. More...
 

Static Protected Member Functions

static int atomicDecAndTestValue (volatile int *counter, int value)
 atomicDecAndTestValue - decrement and test @v: pointer of type AtomicCounter @value: value to test for More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const TermImpl *rhs)
 Streaming operator for this class. More...
 
std::ostream & operator<< (std::ostream &stream, const TermImplPtr &rhs)
 Streaming operator for this class. More...
 

Detailed Description

TermImpl is the superclass for all implementations of terms in the expression tree, such as LiteralImpl, Operation and ConditionRoot. The TermImpl is the backend to the API frontend Term. It inherits from Ice::Object in order to allow serialization via Ice and provides all methods to build an expression tree.

Each term has a boolean value. Values are updated from the childs in the expression tree by calling update(). Further, the update method calls the parents state update(). Thus, expression trees consisting of TermImpl are updated from bottom to top.

Definition at line 53 of file TermImpl.h.

Constructor & Destructor Documentation

◆ ~TermImpl()

~TermImpl ( )
override

Destructor of TermImpl.

Assures handling of cyclic IceInternal::Handle dependencies

Definition at line 31 of file TermImpl.cpp.

Member Function Documentation

◆ __decRef()

void __decRef ( )
overrideprotected

Overwritten version of reference counting from GCShared.

Resolves cyclic dependencies in the tree without makin use of the garbage collector.

See also
Shared::__decRef()
GCShared::__decRef()

Definition at line 130 of file TermImpl.cpp.

◆ __incRef()

void __incRef ( )
overrideprotected

Overwritten version of reference counting from GCShared.

Reference counter increment without garbage collection. Uses Shared::__incRef instead of GCShared::__incRef()

See also
Shared::__incRef()
GCShared::__incRef()

Definition at line 125 of file TermImpl.cpp.

◆ addChild()

void addChild ( const TermImplBasePtr &  child,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Add child to term.

This is used to generate an expression tree.

Parameters
childshared pointer to child

Definition at line 37 of file TermImpl.cpp.

+ Here is the caller graph for this function:

◆ atomicDecAndTestValue()

int atomicDecAndTestValue ( volatile int *  counter,
int  value 
)
inlinestaticprotected

atomicDecAndTestValue - decrement and test @v: pointer of type AtomicCounter @value: value to test for

Atomically decrements @v by 1 and returns true if the result is value, or false for all other cases. Note that the guaranteed useful range of an AtomicCounter is only 24 bits.

Inlined because this operation is performance critical.

Definition at line 115 of file TermImpl.cpp.

+ Here is the call graph for this function:

◆ getChilds()

TermImplSequence getChilds ( const Ice::Current &  c = Ice::emptyCurrent)
override

retrieve childs of this term in the expression tree.

Returns
list of child terms

Definition at line 44 of file TermImpl.cpp.

◆ getDatafields()

StringVariantBaseMap getDatafields ( const Ice::Current &  ) const
override

Definition at line 59 of file TermImpl.cpp.

◆ getParent()

TermImplBasePtr getParent ( const Ice::Current &  c = Ice::emptyCurrent)
override

retrieve parent of this term in the expression tree.

For the root node this is NULL.

Returns
shared pointer to parent

Definition at line 49 of file TermImpl.cpp.

◆ getType()

TermType getType ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Retrieve type of term.

Returns
type of the term

Definition at line 64 of file TermImpl.cpp.

◆ getValue()

bool getValue ( const Ice::Current &  c = Ice::emptyCurrent) const
override

retrieve current value of term.

Does not evaluate the child nodes.

Returns
current value of the term

Definition at line 54 of file TermImpl.cpp.

◆ output()

virtual void output ( std::ostream &  out) const
pure virtual

output to stream.

pure virtual.

Parameters
stream

Implemented in OperationNot, OperationOr, LiteralImpl, OperationAnd, and ConditionRoot.

◆ removeChildren()

void removeChildren ( )

Definition at line 85 of file TermImpl.cpp.

◆ resetParent()

void resetParent ( const Ice::Current &  c = Ice::emptyCurrent)
overrideprotected

Reset the parent of this term.

Definition at line 110 of file TermImpl.cpp.

◆ setParent()

void setParent ( const TermImplBasePtr &  parent,
const Ice::Current &  c = Ice::emptyCurrent 
)
overrideprotected

Sets the parent for this term in the expression tree.

Parameters
sharedpointer to parent

Definition at line 105 of file TermImpl.cpp.

◆ update()

void update ( const Ice::Current &  c = Ice::emptyCurrent)
override

Updates the parent in the expression tree.

call update after each change to this->value.

Definition at line 69 of file TermImpl.cpp.

+ Here is the caller graph for this function:

◆ updateWithData()

void updateWithData ( const Ice::Current &  c = Ice::emptyCurrent)
override

Definition at line 77 of file TermImpl.cpp.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  stream,
const TermImpl rhs 
)
friend

Streaming operator for this class.

Parameters
streamstream to output
rhsright handside

Definition at line 133 of file TermImpl.h.

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  stream,
const TermImplPtr rhs 
)
friend

Streaming operator for this class.

Parameters
streamstream to output
rhsright handside

Definition at line 119 of file TermImpl.h.


The documentation for this class was generated from the following files: