hide one more class

This commit is contained in:
lperron@google.com
2011-08-13 01:52:01 +00:00
parent ef4d5c2441
commit dc155362eb
2 changed files with 20 additions and 13 deletions

View File

@@ -180,7 +180,7 @@ class FifoPriorityQueue : public SinglePriorityQueue {
Cell* last_;
Cell* free_cells_;
};
} // namespace
} // namespace
class Queue {
public:
@@ -929,18 +929,15 @@ void Search::JumpBack() {
CP_DO_FAIL(this);
}
void Search::SetBranchSelector(
ResultCallback1<Solver::DecisionModification, Solver*>* const bs) {
CHECK(bs == selector_ || selector_ == NULL || bs == NULL);
if (selector_ != bs) {
selector_.reset(bs);
Search* Solver::ActiveSearch() const {
switch (state_) {
case IN_SEARCH:
return searches_.back();
default:
return NULL;
}
}
Search* LastSearch(Solver* const solver) {
return solver->searches_.back();
}
namespace {
class UndoBranchSelector : public Action {
public:
@@ -948,7 +945,7 @@ class UndoBranchSelector : public Action {
virtual ~UndoBranchSelector() {}
virtual void Run(Solver* const s) {
if (s->SolveDepth() == depth_) {
LastSearch(s)->SetBranchSelector(NULL);
s->ActiveSearch()->SetBranchSelector(NULL);
}
}
virtual string DebugString() const {
@@ -978,6 +975,14 @@ class ApplyBranchSelector : public DecisionBuilder {
};
} // namespace
void Search::SetBranchSelector(
ResultCallback1<Solver::DecisionModification, Solver*>* const bs) {
CHECK(bs == selector_ || selector_ == NULL || bs == NULL);
if (selector_ != bs) {
selector_.reset(bs);
}
}
void Solver::SetBranchSelector(
ResultCallback1<Solver::DecisionModification, Solver*>* const bs) {
bs->CheckIsRepeatable();
@@ -1036,6 +1041,7 @@ void Search::Clear() {
monitors_.clear();
search_depth_ = 0;
left_search_depth_ = 0;
selector_.reset(NULL);
}
void Search::EnterSearch() {
@@ -1249,7 +1255,7 @@ class BalancingDecision : public Decision {
virtual void Apply(Solver* const s) {}
virtual void Refute(Solver* const s) {}
};
}
} // namespace
Decision* Solver::MakeFailDecision() {
return fail_decision_.get();

View File

@@ -2224,6 +2224,8 @@ class Solver {
bool HasName(const PropagationBaseObject* object) const;
// Adds a new demon and wraps it inside a DemonProfiler if necessary.
Demon* RegisterDemon(Demon* const d);
// Returns the active search, NULL outside search.
Search* ActiveSearch() const;
friend class BaseIntExpr;
friend class Constraint;
@@ -2239,7 +2241,6 @@ class Solver {
#ifndef SWIG
friend void InternalSaveBooleanVarValue(Solver* const, IntVar* const);
friend void SetQueueCleanerOnFail(Solver* const, IntVar* const);
friend Search* LastSearch(Solver* const solver);
template<class> friend class SimpleRevFIFO;
#endif