separationInfo_c Class Reference

this class is used to store the complexity of a disassembly. More...

#include <disassembly.h>

Inheritance diagram for separationInfo_c:

Inheritance graph
[legend]
Collaboration diagram for separationInfo_c:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 separationInfo_c (xmlParser_c &pars)
 load separationInfo from parser
 separationInfo_c (const separation_c *sep)
 create a separation infor from a normal separation
void save (xmlWriter_c &xml) const
 save into an xml node
virtual unsigned int sumMoves (void) const
 the number of moves to completely disassemble the puzzle, including all sub separations
virtual void movesText (char *txt, int len) const
 fill a string with dot separated numbers containing the moves required to disassemble the puzzle not more than len characters are written
virtual unsigned int getSequenceLength (unsigned int x) const
 helper function used for "compare" to get the number of moves for the x-th place in the string
virtual unsigned int getNumSequences (void) const
 helper function used for "compare" to get the number of move sequences

Private Member Functions

bool containsMultiMoves (unsigned int root) const
 used in movesText to find out if a branch has a movesequence longer than 1
void recursiveConstruction (const separation_c *sep)
 used in constructor for create separationInfo from normal separation
int movesText2 (char *txt, int len, unsigned int idx) const
 separationInfo_c (const separationInfo_c &)
void operator= (const separationInfo_c &)

Private Attributes

std::vector< unsigned int > values
 this array contains the whole disassembly tree in prefix order, root, left, removed.


Detailed Description

this class is used to store the complexity of a disassembly.

it is used as a memory efficient replacement for the basic information in separation_c without the detailed disassembly instructions


Constructor & Destructor Documentation

separationInfo_c::separationInfo_c ( xmlParser_c pars  ) 

separationInfo_c::separationInfo_c ( const separation_c sep  ) 

create a separation infor from a normal separation

References recursiveConstruction().

separationInfo_c::separationInfo_c ( const separationInfo_c  )  [private]


Member Function Documentation

bool separationInfo_c::containsMultiMoves ( unsigned int  root  )  const [private]

used in movesText to find out if a branch has a movesequence longer than 1

References values.

Referenced by movesText2().

unsigned int separationInfo_c::getNumSequences ( void   )  const [virtual]

helper function used for "compare" to get the number of move sequences

Implements disassembly_c.

References values.

unsigned int separationInfo_c::getSequenceLength ( unsigned int  x  )  const [virtual]

helper function used for "compare" to get the number of moves for the x-th place in the string

Implements disassembly_c.

References values.

virtual void separationInfo_c::movesText ( char *  txt,
int  len 
) const [inline, virtual]

fill a string with dot separated numbers containing the moves required to disassemble the puzzle not more than len characters are written

Implements disassembly_c.

References movesText2().

int separationInfo_c::movesText2 ( char *  txt,
int  len,
unsigned int  idx 
) const [private]

References containsMultiMoves(), and values.

Referenced by movesText().

void separationInfo_c::operator= ( const separationInfo_c  )  [private]

void separationInfo_c::recursiveConstruction ( const separation_c sep  )  [private]

used in constructor for create separationInfo from normal separation

References separation_c::getLeft(), separation_c::getMoves(), separation_c::getRemoved(), and values.

Referenced by separationInfo_c().

void separationInfo_c::save ( xmlWriter_c xml  )  const

save into an xml node

References xmlWriter_c::addContent(), xmlWriter_c::endTag(), xmlWriter_c::newTag(), and values.

Referenced by solution_c::save().

unsigned int separationInfo_c::sumMoves ( void   )  const [virtual]

the number of moves to completely disassemble the puzzle, including all sub separations

Implements disassembly_c.

References values.


Member Data Documentation

std::vector<unsigned int> separationInfo_c::values [private]

this array contains the whole disassembly tree in prefix order, root, left, removed.

When a certain subtree is empty a zero is included, otherwise the number is the number of states within this tree node

example:

       3 2 1 0 0 0 0     tree root 3 --> 2 --> 1 

another example

       3 1 1 0 0 0 1 1 0 0 0   tree root  3 --> 1 --> 1
                                           \--> 1 --> 1 

Referenced by containsMultiMoves(), getNumSequences(), getSequenceLength(), movesText2(), recursiveConstruction(), save(), separationInfo_c(), and sumMoves().


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

Generated on Sun Oct 10 10:03:07 2010 for BurrTools by  doxygen 1.5.8