Frobby  0.9.5
Public Member Functions | Private Attributes | List of all members
DebugStrategy Class Reference

A wrapper for a SliceStrategy that prints out what is going out for debugging purposes, while delegating everything to the strategy being wrapped. More...

#include <DebugStrategy.h>

Inheritance diagram for DebugStrategy:
PivotStrategy SliceStrategy

Public Member Functions

 DebugStrategy (SliceStrategy *strategy, FILE *out)
 Debug information is written to out, and every call is delegated to strategy. More...
 
virtual ~DebugStrategy ()
 
virtual void run (const Ideal &ideal)
 Run the Slice algorithm. More...
 
bool processSlice (TaskEngine &tasks, auto_ptr< Slice > slice)
 Process the parameter slice. More...
 
virtual void setUseIndependence (bool use)
 This method should only be called before calling run(). More...
 
virtual void setUseSimplification (bool use)
 This method should only be called before calling run(). More...
 
virtual bool getUseSimplification () const
 
virtual void freeSlice (auto_ptr< Slice > slice)
 It is allowed to delete returned slices directly, but it is better to use freeSlice. More...
 
- Public Member Functions inherited from PivotStrategy
virtual ~PivotStrategy ()
 
virtual EulerStatedoPivot (EulerState &state, const size_t *divCounts)=0
 Split state. More...
 
virtual void getName (ostream &out) const =0
 Prints the name of the strategy to out. More...
 
virtual void computationCompleted (const PivotEulerAlg &alg)=0
 Call this function once when computation is complete. More...
 
virtual bool shouldTranspose (const EulerState &state) const =0
 Returns true if transposing state is adviced. More...
 
- Public Member Functions inherited from SliceStrategy
virtual ~SliceStrategy ()
 

Private Attributes

SliceStrategy_strategy
 
FILE * _out
 

Additional Inherited Members

- Protected Member Functions inherited from PivotStrategy
 PivotStrategy ()
 

Detailed Description

A wrapper for a SliceStrategy that prints out what is going out for debugging purposes, while delegating everything to the strategy being wrapped.

Definition at line 26 of file DebugStrategy.h.

Constructor & Destructor Documentation

◆ DebugStrategy()

DebugStrategy::DebugStrategy ( SliceStrategy strategy,
FILE *  out 
)

Debug information is written to out, and every call is delegated to strategy.

Definition at line 22 of file DebugStrategy.cpp.

◆ ~DebugStrategy()

DebugStrategy::~DebugStrategy ( )
virtual

Definition at line 29 of file DebugStrategy.cpp.

Member Function Documentation

◆ freeSlice()

void DebugStrategy::freeSlice ( auto_ptr< Slice slice)
virtual

It is allowed to delete returned slices directly, but it is better to use freeSlice.

freeSlice can only be called on slices obtained from a method of the same strategy. This allows caching of slices to avoid frequent allocation and deallocation.

Implements SliceStrategy.

Definition at line 72 of file DebugStrategy.cpp.

◆ getUseSimplification()

bool DebugStrategy::getUseSimplification ( ) const
virtual

Implements SliceStrategy.

Definition at line 68 of file DebugStrategy.cpp.

◆ processSlice()

bool DebugStrategy::processSlice ( TaskEngine tasks,
auto_ptr< Slice slice 
)
virtual

Process the parameter slice.

Returns true if this is a base case and false otherwise.

Implements SliceStrategy.

Definition at line 41 of file DebugStrategy.cpp.

◆ run()

void DebugStrategy::run ( const Ideal ideal)
virtual

Run the Slice algorithm.

Implements SliceStrategy.

Definition at line 32 of file DebugStrategy.cpp.

◆ setUseIndependence()

void DebugStrategy::setUseIndependence ( bool  use)
virtual

This method should only be called before calling run().

Implements SliceStrategy.

Definition at line 52 of file DebugStrategy.cpp.

◆ setUseSimplification()

void DebugStrategy::setUseSimplification ( bool  use)
virtual

This method should only be called before calling run().

Implements SliceStrategy.

Definition at line 60 of file DebugStrategy.cpp.

Member Data Documentation

◆ _out

FILE* DebugStrategy::_out
private

Definition at line 45 of file DebugStrategy.h.

◆ _strategy

SliceStrategy* DebugStrategy::_strategy
private

Definition at line 44 of file DebugStrategy.h.


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