6.33 ABA_POOLSLOTREF< BaseType, CoType > Class Template Reference

we do not refer directly to constraints/variables but store a pointer to a pool slot and memorize the version number of the slot at initialization time of the class ABA_POOLSLOTREF.

#include <poolslotref.h>

Inheritance diagram for ABA_POOLSLOTREF< BaseType, CoType >::


PIC


Public Member Functions

Private Member Functions

Private Attributes

Friends

6.33.1 Detailed Description

template<class BaseType, class CoType> class ABA_POOLSLOTREF< BaseType, CoType >

we do not refer directly to constraints/variables but store a pointer to a pool slot and memorize the version number of the slot at initialization time of the class ABA_POOLSLOTREF.

Definition at line 54 of file poolslotref.h.

6.33.2 Constructor & Destructor Documentation

6.33.2.1 template<class BaseType, class CoType> ABA_POOLSLOTREF< BaseType, CoType >::ABA_POOLSLOTREF (ABA_MASTER * master)

This constructor generates an object referencing to no pool slot.

Parameters:

master
A pointer to the corresponding master of the optimization.

6.33.2.2 template<class BaseType, class CoType> ABA_POOLSLOTREF< BaseType, CoType >::ABA_POOLSLOTREF (ABA_POOLSLOT< BaseType, CoType > * slot)

This constructor initializes the reference to a pool slot with a given slot.

Also the constraint/variable contained in this slot receives a message that a new references to it is created.

Parameters:

slot
The pool slot that is referenced now.

6.33.2.3 template<class BaseType, class CoType> ABA_POOLSLOTREF< BaseType, CoType >::ABA_POOLSLOTREF (const ABA_POOLSLOTREF< BaseType, CoType > & rhs)

The copy constructor may increments the reference counter of the constraint/variable only if version number of the slot and version number of the reference are equal, since otherwise this is not a correct reference to slot_->conVar().

Parameters:

rhs
The pool slot that is copied in the initialization process.

6.33.2.4 template<class BaseType, class CoType> ABA_POOLSLOTREF< BaseType, CoType >::~ABA_POOLSLOTREF ()

The destructor sends a message to the constraint that it will no longer be referred from this place in the program.

If the version number of the reference and the version number of the slot do not equal, we must not decrement the reference counter of slot_->conVar() because this is not a correct reference to this constraint/variable.

6.33.3 Member Function Documentation

6.33.3.1 template<class BaseType, class CoType> BaseType*ABA_POOLSLOTREF< BaseType, CoType >::conVar () const

Returns:

A pointer to the constraint/variable stored in the referenced slot if the version number of the slot is equal to the version number at construction/initialization time of this slot. Otherwise, it returns 0.

6.33.3.2 template<class BaseType, class CoType> unsigned long ABA_POOLSLOTREF< BaseType, CoType >::version () const

Returns:

The version number of the constraint/variable stored in the referenced slot at construction time of the reference to this slot.

6.33.3.3 template<class BaseType, class CoType> ABA_POOLSLOT<BaseType, CoType>*ABA_POOLSLOTREF< BaseType, CoType >::slot () const

Returns:

A pointer to the referenced slot.

6.33.3.4 template<class BaseType, class CoType> void ABA_POOLSLOTREF< BaseType, CoType >::slot (ABA_POOLSLOT< BaseType, CoType > * s)

This version of the function slot() initializes the referenced pool slot.

The function slot() may decrement the reference counter of slot_->conVar() only if the version number of the reference and the version number of the slot are equal since otherwise this is not a valid reference.

Parameters:

s
The new slot that is referenced. This must not be a 0-pointer.

6.33.3.5 template<class BaseType, class CoType> void ABA_POOLSLOTREF< BaseType, CoType >::printDifferentVersionError () const [private]

6.33.3.6 template<class BaseType, class CoType> const ABA_POOLSLOTREF<BaseType, CoType>& ABA_POOLSLOTREF< BaseType, CoType >::operator= (const ABA_POOLSLOTREF< BaseType, CoType > & rhs) [private]

6.33.4 Friends And Related Function Documentation

6.33.4.1 template<class BaseType, class CoType> ostream& operator<< (ostream & out, const ABA_POOLSLOTREF< BaseType, CoType > & rhs) [friend]

The output operator writes the constraint/variable stored in the referenced slot to an output stream.

Returns:

A reference to the output stream.

Parameters:

out
The output stream.
rhs
The reference to a pool slot being output.

6.33.5 Member Data Documentation

6.33.5.1 template<class BaseType, class CoType> ABA_MASTER*ABA_POOLSLOTREF< BaseType, CoType >::master_ [private]

A pointer to the corresponding master of the optimization.

Definition at line 151 of file poolslotref.h.

6.33.5.2 template<class BaseType, class CoType> ABA_POOLSLOT<BaseType, CoType>*ABA_POOLSLOTREF< BaseType, CoType >::slot_ [private]

A pointer to the referenced pool slot.

Definition at line 155 of file poolslotref.h.

6.33.5.3 template<class BaseType, class CoType> unsigned long ABA_POOLSLOTREF< BaseType, CoType >::version_ [private]

The version number of the slot at construction/initialization time of this reference.

Definition at line 160 of file poolslotref.h.

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