- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# BcpsObjectPool Class Reference

Object pool is used to store objects. More...

`#include <BcpsObjectPool.h>`

Inheritance diagram for BcpsObjectPool:

[legend]
Collaboration diagram for BcpsObjectPool:

[legend]
List of all members.

## Public Member Functions
| BcpsObjectPool ()
| Default construct.
virtual | ~BcpsObjectPool ()
void | freeGuts ()
| Free object pointers.
void | clear ()
| Reset to empty.
virtual void | addKnowledge (AlpsKnowledge *nk, double priority)
| Add a knowledge to pool.
virtual int | getNumKnowledges () const
| Query how many knowledges are in the pool.
virtual std::pair< AlpsKnowledge *, double > | getKnowledge () const
| Query a knowledge, but doesn't remove it from the pool.
virtual bool | hasKnowledge () const
| Check whether the pool has knowledge.
void | deleteObject (int k)
| Delete object k from pool.
const std::vector< AlpsKnowledge * > & | getObjects () const
| Get all objects.
AlpsKnowledge * | getObject (int k) const
| Get a object.
## Protected Attributes
std::vector< AlpsKnowledge * > | objects_

## Detailed Description

Object pool is used to store objects.

Definition at line 36 of file BcpsObjectPool.h.

## Constructor & Destructor Documentation

BcpsObjectPool::BcpsObjectPool | ( |  | ) | `[inline]`

Default construct.

Definition at line 45 of file BcpsObjectPool.h.

virtual BcpsObjectPool::~BcpsObjectPool | ( |  | ) | `[inline, virtual]`

Definition at line 46 of file BcpsObjectPool.h.

References freeGuts(), and objects_.

## Member Function Documentation

void BcpsObjectPool::freeGuts | ( |  | ) | `[inline]`

Free object pointers.

Definition at line 53 of file BcpsObjectPool.h.

References objects_.

Referenced by ~BcpsObjectPool().

void BcpsObjectPool::clear | ( |  | ) | `[inline]`

Reset to empty.

Don't free memory.

Definition at line 61 of file BcpsObjectPool.h.

References objects_.

virtual void BcpsObjectPool::addKnowledge | ( | AlpsKnowledge * | nk,
|  | double | priority |
| ) |  |  | `[inline, virtual]`

Add a knowledge to pool.

Implements AlpsKnowledgePool.

Definition at line 64 of file BcpsObjectPool.h.

References objects_.

virtual int BcpsObjectPool::getNumKnowledges | ( |  | ) | const`[inline, virtual]`

Query how many knowledges are in the pool.

Implements AlpsKnowledgePool.

Definition at line 69 of file BcpsObjectPool.h.

References objects_.

Referenced by BcpsConstraintPool::getNumConstraints(), and BcpsVariablePool::getNumVariables().

virtual std::pair<AlpsKnowledge*, double> BcpsObjectPool::getKnowledge | ( |  | ) | const`[inline, virtual]`

Query a knowledge, but doesn't remove it from the pool.

Implements AlpsKnowledgePool.

Definition at line 74 of file BcpsObjectPool.h.

References objects_.

virtual bool BcpsObjectPool::hasKnowledge | ( |  | ) | const`[inline, virtual]`

Check whether the pool has knowledge.

Reimplemented from AlpsKnowledgePool.

Definition at line 79 of file BcpsObjectPool.h.

References objects_.

void BcpsObjectPool::deleteObject | ( | int | k | ) | `[inline]`

Delete object k from pool.

Definition at line 83 of file BcpsObjectPool.h.

References getObject(), and objects_.

Referenced by BcpsConstraintPool::deleteConstraint(), and BcpsVariablePool::deleteVariable().

const std::vector<AlpsKnowledge *>& BcpsObjectPool::getObjects | ( |  | ) | const`[inline]`

Get all objects.

Definition at line 96 of file BcpsObjectPool.h.

References objects_.

AlpsKnowledge* BcpsObjectPool::getObject | ( | int | k | ) | const`[inline]`

Get a object.

Definition at line 99 of file BcpsObjectPool.h.

References objects_.

Referenced by deleteObject(), BcpsConstraintPool::getConstraint(), and BcpsVariablePool::getVariable().

## Member Data Documentation

std::vector<AlpsKnowledge *> BcpsObjectPool::objects_`[protected]`

Definition at line 40 of file BcpsObjectPool.h.

Referenced by BcpsConstraintPool::addConstraint(), addKnowledge(), BcpsVariablePool::addVariable(), clear(), deleteObject(), freeGuts(), BcpsConstraintPool::getConstraints(), getKnowledge(), getNumKnowledges(), getObject(), getObjects(), BcpsVariablePool::getVariables(), hasKnowledge(), and ~BcpsObjectPool().

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

- /home/coin/SVN-release/Blis-0.91.0/Bcps/src/BcpsObjectPool.h