| 166 | |
| 167 | |
| 168 | class ClosedSet |
| 169 | { |
| 170 | public: |
| 171 | ClosedSet( Graph* _graph ) { this->graph = _graph; } |
| 172 | ~ClosedSet() {} |
| 173 | |
| 174 | void Add( PathNode* pNode ) |
| 175 | { |
| 176 | #ifdef DEBUG_PATH_DEEP |
| 177 | printf( "Closed add: " ); |
| 178 | graph->PrintStateInfo( pNode->state ); |
| 179 | printf( " total=%.1f\n", pNode->totalCost ); |
| 180 | #endif |
| 181 | #ifdef DEBUG |
| 182 | MPASSERT( pNode->inClosed == 0 ); |
| 183 | MPASSERT( pNode->inOpen == 0 ); |
| 184 | #endif |
| 185 | pNode->inClosed = 1; |
| 186 | } |
| 187 | |
| 188 | void Remove( PathNode* pNode ) |
| 189 | { |
| 190 | #ifdef DEBUG_PATH_DEEP |
| 191 | printf( "Closed remove: " ); |
| 192 | graph->PrintStateInfo( pNode->state ); |
| 193 | printf( " total=%.1f\n", pNode->totalCost ); |
| 194 | #endif |
| 195 | MPASSERT( pNode->inClosed == 1 ); |
| 196 | MPASSERT( pNode->inOpen == 0 ); |
| 197 | |
| 198 | pNode->inClosed = 0; |
| 199 | } |
| 200 | |
| 201 | private: |
| 202 | ClosedSet( const ClosedSet& ); |
| 203 | void operator=( const ClosedSet& ); |
| 204 | Graph* graph; |
| 205 | }; |
| 206 | |
| 207 | |
| 208 | PathNodePool::PathNodePool( unsigned _allocate, unsigned _typicalAdjacent ) |
nothing calls this directly
no outgoing calls
no test coverage detected