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. More...

#include <poolslotref.h>

Inheritance diagram for ABA_POOLSLOTREF< BaseType, CoType >:

ABA_ABACUSROOT List of all members.

Public Member Functions

 ABA_POOLSLOTREF (ABA_MASTER *master)
 ABA_POOLSLOTREF (ABA_POOLSLOT< BaseType, CoType > *slot)
 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().
 ~ABA_POOLSLOTREF ()
 The destructor sends a message to the constraint that it will no longer be referred from this place in the program.
BaseType * conVar () const
unsigned long version () const
ABA_POOLSLOT< BaseType, CoType > * slot () const
void slot (ABA_POOLSLOT< BaseType, CoType > *s)
 This version of the function slot() initializes the referenced pool slot.

Private Member Functions

void printDifferentVersionError () const
const ABA_POOLSLOTREF< BaseType,
CoType > & 
operator= (const ABA_POOLSLOTREF< BaseType, CoType > &rhs)

Private Attributes

ABA_MASTERmaster_
ABA_POOLSLOT< BaseType, CoType > * slot_
unsigned long version_
 The version number of the slot at construction/initialization time of this reference.

Friends

ostream & operator<< (ostream &out, const ABA_POOLSLOTREF &rhs)
 The output operator writes the constraint/variable stored in the referenced slot to an output stream.

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.


Constructor & Destructor Documentation

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.

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.

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.

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.


Member Function Documentation

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.

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.

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

Returns:
A pointer to the referenced slot.

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.

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

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


Friends And Related Function Documentation

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.


Member Data Documentation

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.

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.

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:
Generated on Tue Aug 14 18:09:58 2007 for ABACUS by  doxygen 1.5.1