The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cFibLimb.h
Go to the documentation of this file.
1 /**
2  * @class cFibLimb
3  * file name: cFibLimb.h
4  * @author Betti Oesterholz
5  * @date 06.12.2009
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class represents a Fib-element, which are limbs.
11  * Copyright (C) @c LGPL3 2009 Betti Oesterholz
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License (LGPL) as
15  * published by the Free Software Foundation, either version 3 of the
16  * License, or any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  *
26  *
27  * This file contains the basisclass of all Fib-elements, which are
28  * limbs. Limbs have exactly one underobject.
29  * It's not possible to create instances from this class.
30  *
31  * If the structur of the Fib-object is changed just set the underobjects
32  * and call updateAllValues() from a position wher the highest Fib-element
33  * can be reached. The updateAllValues() method will make the conections.
34  * If you remove conections you have to be more carefull.
35  *
36  */
37 /*
38 History:
39 06.12.2009 Oesterholz created
40 06.01.2010 Oesterholz getAllFibElements() uses now getAllFibElementsFromPosition()
41 02.09.2010 Oesterholz the destructor cuts the conections from the
42  underobject to this object
43 07.08.2011 Oesterholz isDefinedVariable() and getDefinedVariables() with
44  pCallingFibElement
45 19.10.2011 Oesterholz FEATURE_EQUAL_FIB_OBJECT implemented
46 */
47 
48 
49 #ifndef ___C_FIB_LIMB_H__
50 #define ___C_FIB_LIMB_H__
51 
52 #include "version.h"
53 #include "fibDatatyps.h"
54 
55 #include "cFibElement.h"
56 #include "cVectorPosition.h"
57 #include "cVectorProperty.h"
58 #include "cFibVariable.h"
59 #include "cDomains.h"
60 
61 #include <list>
62 #include <ostream>
63 #include <istream>
64 
65 
66 
67 using std::list;
68 using std::ostream;
69 using std::istream;
70 
71 using namespace fib;
72 
73 namespace fib{
74 
75 
76 
77 
78 class cFibLimb: public cFibElement{
79 protected:
80 
81 friend class cFibBranch;
82 
84 
85 #ifdef FEATURE_SIMPLE_CONSTRUCTOR
86 
87  /**
88  * parameterconstructor
89  *
90  * @param pInUnderobject the Fib-Element which is the underobejct of
91  * this Fib-element (it also stands next in the order of Fib-elements)
92  * @param pInSuperiorElement the Fib-Element in which this Fib-element
93  * is the underobject
94  */
95  cFibLimb( cFibElement * pInUnderobject = NULL,
96  cFibElement * pInSuperiorElement = NULL );
97 
98 #else //FEATURE_SIMPLE_CONSTRUCTOR
99 
100  /**
101  * parameterconstructor
102  *
103  * @param pInSuperiorElement the Fib-Element in which this Fib-element
104  * is the underobject
105  * @param pInPreviousFibElement the Fib-Element which stands in th order
106  * of Fib-elements befor this Fib-element
107  * @param pInUnderobject the Fib-Element which is the underobejct of
108  * this Fib-element (it also stands next in the order of Fib-elements)
109  */
110  cFibLimb( cFibElement * pInSuperiorElement = NULL,
111  cFibElement * pInPreviousFibElement = NULL,
112  cFibElement * pInUnderobject = NULL );
113 
114 #endif //FEATURE_SIMPLE_CONSTRUCTOR
115 
116 
117  /**
118  * copyconstructor
119  * This copyconstructor constructs a copy of this Fib-Element.
120  * It dosn't copy other Fib-elements than this, even if ther are in this
121  * Fib-element.
122  *
123  * @param fibLimbElement the Fib-element to copy
124  */
125  cFibLimb( const cFibLimb & fibLimbElement );
126 
127 
128 public:
129 
130  /**
131  * destructor
132  */
133  virtual ~cFibLimb();
134 
135  /**
136  * This method checks, if this Fib-element is an valid Fib-element.
137  *
138  * @return true if this Fib-element is an valid Fib-element, else false
139  */
140  virtual bool isValidFibElement() const;
141 
142 #ifdef FEATURE_FAST_UPDATE
143 
144  /**
145  * This method returns the next Fib-element in the order of Fib-elements.
146  *
147  * @return a pointer to the next Fib-element in the order of Fib-elements
148  * or the NULL pointer if non such exists
149  */
150  virtual cFibElement * getNextFibElement();
151 
152  /**
153  * This method returns the next Fib-element in the order of
154  * Fib-elements with the given type cTyp.
155  *
156  * @param cType the type of the Fib-element to return
157  * @return a pointer to the next Fib-element in the order of
158  * Fib-elements with the given type or the NULL pointer if non such
159  * exists
160  */
161  virtual cFibElement * getNextFibElement( char cType );
162 
163  /**
164  * This method returns the lNumber'th Fib-element in the order of
165  * Fib-elements.
166  *
167  * @param lNumber the number of the Fib-Element to return
168  * @param bAbsolute if the lNumber is an absolute value for the wool
169  * Fib-object
170  * @return a pointer to the lNumber'th Fib-element in the order of
171  * Fib-elements or the NULL pointer if non such exists
172  */
173  virtual cFibElement * getConstFibElement( longFib lNumber,
174  bool bAbsolute=false ) const;
175 
176  /**
177  * This method returns the lNumber'th Fib-element in the order of
178  * Fib-elements of the given type cTyp with the given type cTyp.
179  *
180  * @param lNumber the number of the Fib-element to return
181  * @param cType the type of the Fib-element to return
182  * @param bAbsolute if the lNumber is an absolute value for the wool
183  * Fib-object
184  * @return a pointer to the lNumber'th Fib-element in the order of
185  * Fib-elements with the given type or the NULL pointer if non such
186  * exists
187  */
188  virtual cFibElement * getConstFibElement( char cType, longFib lNumber,
189  bool bAbsolute=false ) const;
190 
191 #endif
192 
193  /**
194  * This method checks if the given variable is used in the given
195  * direction from this Fib-element.
196  *
197  * @see cFibVariable
198  * @see isDefinedVariable()
199  * @param variable the variable to check if it is used
200  * @param direction the direction from this Fib-element, in which the
201  * variable should be used; standardvalue is ED_POSITION so yust
202  * this Fib-element will be checked
203  * @return true if the variable is used, else false
204  */
205  virtual bool isUsedVariable( const cFibVariable *variable ,
206  edDirection direction=ED_POSITION ) const;
207 
208  /**
209  * This method returns all variables used in the given direction from
210  * this Fib-element.
211  *
212  * @see cFibVariable
213  * @see isUsedVariable()
214  * @see isDefinedVariable()
215  * @param direction the direction from this Fib-element, in which the
216  * variable should be used; standardvalue is ED_POSITION so yust
217  * this Fib-element will be checked
218  * @return the set with all variables used in the given direction from
219  * this Fib-element
220  */
221  virtual set<cFibVariable*> getUsedVariables( edDirection direction=ED_POSITION );
222 
223  /**
224  * This method replace the variable variableOld with the variable
225  * variableNew in the object.
226  * Don't touch variable definitions, just the uses of the varaible
227  * variableOld will be changed.
228  *
229  * @see cFibVariable
230  * @see isUsedVariable()
231  * @see isDefinedVariable()
232  * @param variableOld the variable to replace
233  * @param variableNew the variable with which the variable variableOld
234  * is to replace
235  * @return true if the variable variableOld is replaced with variableNew,
236  * else false
237  */
238  virtual bool replaceVariable( cFibVariable *variableOld,
239  cFibVariable *variableNew );
240 
241 #ifdef FEATURE_FAST_UPDATE
242 
243  /**
244  * This method returns the number of this Fib-element in the order of
245  * Fib-Elements or order of Fib-Elements of the same type if bOfType
246  * is true.
247  *
248  * @see getNumberOfElements()
249  * @param bOfType if true the returned number is the number the order
250  * of Fib-elements of the same type as this Fib-Element, else in
251  * the order of all Fib-elements
252  * @return the number of this Fib-element in the order of fib
253  * -Elements or order of Fib-Elements of the same type if bOfType
254  * is true
255  */
256  virtual unsignedIntFib getNumberOfElement( bool bOfType=false ) const;
257 
258  /**
259  * This method returns the number of this Fib-element in the order of
260  * move points.
261  *
262  * @see getNumberOfMovePoints()
263  * @return the number of this Fib-element in the order of move points
264  */
265  virtual unsignedIntFib getNumberOfMovePoint() const;
266 
267 #endif //FEATURE_FAST_UPDATE
268 
269  /**
270  * This method returns the number of Fib-elements of a type in this Fib
271  * -object.
272  *
273  * @see getType()
274  * @see getNumberOfElement()
275  * @param cType the character of the type ( @see getType() ), for which
276  * the elements should be counted; u (the standartvalue) stands for
277  * Fib-Elements of any type
278  * @return the number of Fib-elements of a type in the Fib-object
279  */
280  virtual unsignedIntFib getNumberOfElements( char cType='u' ) const;
281 
282  /**
283  * This method returns the number of move points in this Fib-object.
284  *
285  * @see getNumberOfMovePoint()
286  * @return the number of move points in this Fib-object
287  */
288  virtual unsignedIntFib getNumberOfMovePoints() const;
289 
290  /**
291  * This method returns the number of object points in this Fib-object.
292  *
293  * @see getNumberOfObjectPoint()
294  * @return the number of object points in this Fib-object
295  */
296  virtual unsignedIntFib getNumberOfObjectPoints() const;
297 
298  /**
299  * This method returns the number of the Fib-element over wich the
300  * objectPoint object point is defined.
301  *
302  * @see getNumberOfElement()
303  * @see getNumberOfElements()
304  * @see getNumberOfObjectPoint()
305  * @see getNumberOfObjectPoints()
306  * @param uiObjectPoint the number of the object point for which the
307  * definig Fib-element number should be returned
308  * @param bAbsolute if the lNumber is an absolute value for the wool
309  * Fib-object
310  * @return the number of the Fib-element over wich the objectPoint
311  * object point is defined
312  */
313  virtual unsignedIntFib objectPointToElementPoint( const unsignedIntFib
314  uiObjectPoint, bool bAbsolute=false ) const;
315 
316  /**
317  * This method inserts the given Fib-element fibElement on the
318  * specified position. The replaced Fib-element will be the underobject
319  * of the inserted Fib-element fibElement.
320  *
321  * @see getNumberOfElement()
322  * @see getNumberOfElements()
323  * @see getType()
324  * @param cType the type of the Fib-element insted of which the given
325  * Fib-element fibElement should be inserted
326  * @param elementPoint the number of the Fib-element, in the order of
327  * Fib-elements of the given type cType, in which position the given
328  * Fib-element fibElement should be inserted; if 0 the given
329  * fibElement will be inserted under this Fib-element
330  * @param pFibElement a pointer to the Fib-element to insert
331  * @param bAbsolute if the lNumber is an absolute value for the wool
332  * Fib-object
333  * @param bCheckVariables if true (standardvalue) it will be checked if
334  * the variables the Fib-element defines are needed, else the
335  * Fib-element will be removed even if its variables are needed elsewher
336  * @return true if the Fib-element fibElement was inserted, else false
337  */
338  virtual bool insertElement( cFibElement *fibElement, const char cType='u',
339  const unsignedIntFib elementPoint=0, bool bAbsolute=false,
340  bool bCheckVariables=true );
341 
342  /**
343  * This method inserts the given Fib-object fibObject on the
344  * specified position. On the specified position a listelement will
345  * be inserted, with the old Fib-object and the given Fib-object
346  * fibObject as its underobjects.
347  *
348  * @see getNumberOfElement()
349  * @see getNumberOfElements()
350  * @see overwriteObjectWithObject()
351  * @see getType()
352  * @param cType the type of the Fib-element, on which position the
353  * given Fib-object fibObject should be inserted
354  * @param elementPoint the number of the Fib-element, in the order of
355  * Fib-elements of the given type cType, on which position the given
356  * Fib-object fibObject should be inserted
357  * @param fibObject the Fib-object to insert
358  * @param first if true, the inserted object will be the first
359  * underobject of the new listelement
360  * @param bAbsolute if the lNumber is an absolute value for the wool
361  * Fib-object
362  * @return true if the Fib-object fibObject was inserted, else false
363  */
364  virtual bool insertObjectInElement( cFibElement *fibObject, const char cType='u',
365  const unsignedIntFib elementPoint=0, bool first=true,
366  bool bAbsolute=false );
367 
368  /**
369  * This method overwrites the Fib-object on specified position with
370  * the given Fib-object fibObject. The Fib-object on specified
371  * position will be replaced with the given Fib-object fibObject.
372  *
373  * @see getNumberOfElement()
374  * @see getNumberOfElements()
375  * @see insertObjectInElement()
376  * @see getType()
377  * @param cType the type of the Fib-element, on which position the
378  * given Fib-object fibObject should be inserted
379  * @param elementPoint the number of the Fib-element, in the order of
380  * Fib-elements of the given type cType, on which position the given
381  * Fib-object fibObject should be inserted
382  * @param fibObject the Fib-object to insert
383  * @param bDeleteOld if true, delete the old Fib-object from the memory
384  * @param bAbsolute if the elementPoint is an absolute value for the wool
385  * Fib-object
386  * @return true if the old Fib-object was overwritten and the given
387  * Fib-object fibObject was inserted, else false
388  */
389  virtual bool overwriteObjectWithObject( cFibElement *fibObject, const char cType='u',
390  const unsignedIntFib elementPoint=0, bool bDeleteOld=true,
391  bool bAbsolute=false );
392 
393  /**
394  * This method removes the connected object with the given number in
395  * the order of connected object points.
396  * For this the defining underobject in an listelement will be removed.
397  * If the listelement contains after the operation yust one underobject,
398  * the listelement will be replaced with the underobject.
399  *
400  * @param objectPoint the number of the connected object to remove
401  * @param bDeleteOld if true, delete the connected object from the
402  * memory, else yust remove it's pointers
403  * @param bAbsolute if the objectPoint is an absolute value for the wool
404  * Fib-object
405  * @return true if the connected Fib-object was removed, else false
406  */
407  virtual bool removeObject( const unsignedIntFib objectPoint,
408  bool bDeleteOld=true, bool bAbsolute=false );
409 
410  /**
411  * This method checks, if all Fib-elements of this Fib-object
412  * have the underobjects they need to be correct.
413  *
414  * @return true if all Fib-elements of this Fib-object have the
415  * underobjects they need to be correct, else false
416  */
417  virtual bool hasUnderAllObjects() const;
418 
419  /**
420  * This method cuts the Fib-element on the specified position.
421  * This works like removeElement(), except that the removed element is
422  * returned.
423  *
424  * @see isDeletableElement()
425  * @see removeElement()
426  * @see getType()
427  * @param cType the type of the Fib-element to cut
428  * @param elementPoint the number of the Fib-element, in the order of
429  * Fib-elements of the given type cType, to cut
430  * @param bAbsolute if the elementPoint is an absolute value for the wool
431  * Fib-object
432  * @param bCheckVariables if true (standardvalue) it will be checked if
433  * the variables the Fib-element defines are needed, else the
434  * Fib-element will be removed even if its variables are needed elsewher
435  * @return the pointer to the cuted Fib-element or NULL, if the Fib
436  * -element couldn't cut
437  */
438  virtual cFibElement *cutElement( const char cType='u', const unsignedIntFib
439  elementPoint=0, bool bAbsolute=false, bool bCheckVariables=true );
440 
441 #ifdef FEATURE_FAST_UPDATE
442  /**
443  * This method deletes this given Fib-object with all the fib
444  * elements it contains and is contained in. The memory for the fib
445  * -object is freed.
446  */
447  virtual void deleteObject();
448 #endif //FEATURE_FAST_UPDATE
449 
450 
451  /**
452  * @return true if this Fib-element is movebel else false
453  */
454  virtual bool isMovable() const;
455 
456  /**
457  * This method moves a Fib-limb -element (cFibLimb) on the specified
458  * position over iHowfar Fib-elements.
459  * Moving is stoped if an invalid Fib-object would result (e.g. no Fib
460  * -element can be moved over an Fib-elements that defines a variable
461  * the moved Fib-element uses).
462  * Moving an Fib-element into an listelement will result in an
463  * listelement with the moved element in everyone of it's underobjects.
464  *
465  * @see isDeletableElement()
466  * @see removeElement()
467  * @see getType()
468  * @param cType the type of the Fib-element to move
469  * @param elementPoint the number of the Fib-element, in the order of
470  * Fib-elements of the given type cType, to move
471  * @param iHowfar the number of Fib-elements over which the to move
472  * Fib-element should be moved; if this value is positiv the Fib
473  * -element will be moved over Fib-elements it contains else over
474  * Fib-elements it is contained in
475  * @param bAbsolute if the elementPoint is an absolute value for the wool
476  * Fib-object
477  * @return the number of Fib-Elements over which the to move Fib
478  * -element was moved; if this value is positiv the Fib-element
479  * was moved over Fib-elements it contains else over Fib-elements
480  * it is contained in
481  */
482  virtual intFib moveLimbElement( const char cType='u', const unsignedIntFib
483  elementPoint=0, const intFib iHowfar=1, bool bAbsolute=false );
484 
485 
486 #ifndef FEATURE_EQUAL_FIB_OBJECT
487  /**
488  * This method checks if the given Fib-object is equal to this Fib
489  * -object.
490  * Variables can be others, but must be defined and aused in equivalent
491  * Fib-elements.
492  *
493  * @param fibObject the Fib-object to which this Fib-object should be
494  * equal
495  * @return true if this Fib-object is equal to the given Fib-object,
496  * else false
497  */
498  virtual bool equal( const cFibElement & fibObject ) const;
499 #endif //FEATURE_EQUAL_FIB_OBJECT
500 
501  /**
502  * @return this method returns true if this Fib-element is an
503  * limbelement, alse false
504  */
505  virtual bool isLimb() const;
506 
507 
508 protected:
509 
510 #ifdef FEATURE_FAST_UPDATE
511 
512  /**
513  * This method is a helpmethod for getNumberOfElement() .
514  * Basicly it counts the number of Fib-elements of the given type befor
515  * the given Fib-element pLastFibElement .
516  *
517  * @see getNumberOfElement()
518  * @see getNumberOfElements()
519  * @param pLastFibElement a pointer to the Fib-element which called this
520  * method last
521  * @param cType the type of the Fib-elements, for which to evalue the count,
522  * if 'u' Fib-elements of all typs are counted
523  * @return the number of Fib-elements of the given type cType befor the
524  * given Fib-element pLastFibElement
525  */
526  virtual unsignedIntFib getNumberOfElementUp( const cFibElement * pLastFibElement,
527  const char cType ) const;
528 
529  /**
530  * This method is a helpmethod for getNumberOfMovePoint() .
531  * Basicly it counts the number of move points befor the given
532  * Fib-element pLastFibElement .
533  *
534  * @see getNumberOfMovePoint()
535  * @see getNumberOfMovePoints()
536  * @param pLastFibElement a pointer to the Fib-element which called this
537  * method last
538  * @return the number of movepoints befor the given Fib-element pLastFibElement
539  */
540  virtual unsignedIntFib getNumberOfMovePointUp(
541  const cFibElement * pLastFibElement ) const;
542 
543  /**
544  * This method returns the next Fib-element in the order of
545  * Fib-elements which is above the given fib element.
546  * This method is used, if the method @see getNextFibElement() reaches
547  * an leaf in the object tree.
548  *
549  * @see getNextFibElement()
550  * @param pLastFibElement the Fib-element relativ to which the next
551  * Fib-element should lay
552  * @return a pointer to the next Fib-element in the order of Fib-elements
553  * or the NULL pointer if non such exists
554  */
555  virtual cFibElement *getNextFibElementUp( const cFibElement * pLastFibElement );
556 
557  /**
558  * This method returns the next Fib-element in the order of
559  * Fib-elements which is above the given fib element.
560  * This method is used, if the method @see getNextFibElement() reaches
561  * an leaf in the object tree.
562  *
563  * @see getNextFibElement()
564  * @param pLastFibElement the Fib-element relativ to which the next
565  * Fib-element should lay
566  * @param cType the type of the Fib-element to return
567  * @return a pointer to the next Fib-element in the order of Fib-elements
568  * or the NULL pointer if non such exists
569  */
570  virtual cFibElement * getNextFibElementUp( const cFibElement * pLastFibElement,
571  char cType );
572 
573  /**
574  * This method returns the lNumber'th Fib-element in the order of
575  * Fib-elements which is above the given Fib-element.
576  * This method is used, if the method @see getConstFibElement() reaches
577  * an leaf in the object tree.
578  *
579  * @see getConstFibElementUp()
580  * @param pLastFibElement the Fib-element relativ to which the next
581  * Fib-element should lay
582  * @param lNumber the number of the Fib-Element to return
583  * @return a pointer to the next Fib-element in the order of Fib-elements
584  * or the NULL pointer if non such exists
585  */
586  virtual cFibElement * getConstFibElementUp( const cFibElement * pLastFibElement,
587  longFib lNumber ) const;
588 
589  /**
590  * This method returns the lNumber'th Fib-element in the order of
591  * Fib-elements of the given type cTyp with the given type cTyp
592  * which is above the given Fib-element.
593  * This method is used, if the method @see getConstFibElement() reaches
594  * an leaf in the object tree.
595  *
596  * @see getConstFibElementUp()
597  * @param pLastFibElement the Fib-element relativ to which the next
598  * Fib-element should lay
599  * @param cType the type of the Fib-element to return
600  * @param lNumber the number of the Fib-Element to return
601  * @return a pointer to the next Fib-element in the order of Fib-elements
602  * or the NULL pointer if non such exists
603  */
604  virtual cFibElement * getConstFibElementUp( const cFibElement * pLastFibElement,
605  char cType, longFib lNumber ) const;
606 
607 #endif //FEATURE_FAST_UPDATE
608 
609 #ifndef FEATURE_NO_REGISTER_NEW_FIB_
610  /**
611  * With this method a new Fib-element in the Fib-Object is registert
612  * by the other Fib-elements in the Fib-Object.
613  *
614  * @param newFibElement the new Fib-element to register
615  * @param uINumberOfFibElement the number of the new Fib-element in the
616  * order of all Fib-Elements in the Fib-object
617  * @param bDirectionUp the direction in which the registration of the
618  * new Fib-element is performed in the Fib-object tree;
619  * from the position on which the new Fib-Element is added the
620  * method is called for both directions
621  * @return true if the registration was successfull, else false
622  */
623  virtual bool registerNewFibElement( cFibElement *newFibElement,
624  unsignedIntFib uINumberOfFibElement, bool bDirectionUp );
625 
626 
627  /**
628  * With this method a new part Fib-object in the Fib-Object is
629  * registert by the other Fib-elements in the Fib-Object.
630  *
631  * @param newFibObject the new part Fib-object to register
632  * @param uILowerNumberOfFibElements the number of the Fib-element in the
633  * new part Fib-object with the lowest number in the order of all
634  * Fib-Elements in the entire Fib-object
635  * @param uIUpperNumberOfFibElements the number of the Fib-element in the
636  * new part Fib-object with the highest number in the order of all
637  * Fib-Elements in the entire Fib-object
638  * @param bDirectionUp the direction in which the registration of the
639  * new part Fib-object is performed in the Fib-object tree;
640  * @return true if the registration was successfull, else false
641  */
642  virtual bool registerNewFibObject( cFibElement *newFibObject,
643  unsignedIntFib uILowerNumberOfFibElements,
644  unsignedIntFib uIUpperNumberOfFibElements, bool bDirectionUp );
645 #endif //FEATURE_NO_REGISTER_NEW_FIB_
646 
647 #ifdef FEATURE_FAST_UPDATE
648 
649  /**
650  * This method cuts the connections of this Fib-element to the
651  * given Fib-element.
652  *
653  * @param pFibElement the Fib-element to which to cut the connection
654  */
655  virtual void cutConnectionsTo( const cFibElement * pFibElement );
656 
657 #else //FEATURE_FAST_UPDATE
658 
659  /**
660  * This method cuts the connections of this Fib-element to other
661  * Fib-elements.
662  *
663  * @param direction the direction into which the connections are to be
664  * cutted
665  * ED_HIGHER, ED_HIGHER_EQUAL, ED_ALL: will cut the conection to
666  * superior and previous Fib-elements
667  * ED_BELOW, ED_BELOW_EQUAL, ED_ALL: will cut the conection to
668  * next- Fib-element and the underobjects
669  */
670  virtual void cutConnections( edDirection direction=ED_ALL );
671 
672  /**
673  * This method updates the values/ properties off all Fib-elements in
674  * this Fib-object beginning with this Fib-element.
675  * Every underobject should have all it's underobjects.
676  *
677  * @param previosFibElement the prvios Fib-element to this Fib-element
678  * in the order of Fib-elements; if it is NULL ther is no previos
679  * Fib-element to this
680  * @param pNextArm the next arm Fib-object in the next higher
681  * Fib-brancheelement
682  * @return a pointer to the last evalued Fib-element;
683  * if NULL an error has occured
684  */
685  virtual cFibElement* updateValues( cFibElement * previosFibElement=NULL,
686  cFibElement * pNextArm=NULL );
687 
688 #endif //FEATURE_FAST_UPDATE
689 
690  /**
691  * This method sets the each variable, which is defined over an leaf,
692  * to an uniqe integer number greater than the given number
693  * uiLastVariableNumber. While storing this number can be stored to
694  * identify the variable.
695  *
696  * @param uiLastVariableNumber the number which was last use, this
697  * means also is the greatest used, in this limb.
698  * @return the number which was last use, this
699  * means also is the greatest used, in this limb
700  * from the method
701  */
702  virtual unsignedIntFib enumerateVariablesForStoring(
703  unsignedIntFib uiLastVariableNumber = 0 );
704 
705  /**
706  * This method returns a number of (lNumberOfMaxReturnedElements)
707  * Fib-elements beginning from the actual Fib-element in the
708  * given direction of the given type cType.
709  * The actual Fib-element will never be included in the returned list.
710  *
711  * @param cType the type of the Fib-elements to return;
712  * 'w' stands for wrong/ not correct Fib-elements
713  * @param direction the direction, beginning from the reference
714  * Fib-element, in which the to return Fib-elements should stand
715  * @param lNumberOfMaxReturnedElements the maximal number of
716  * Fib-elements to return
717  * @return a list with the pointers to the to returning Fib-elements
718  */
719  virtual list<cFibElement*> getAllFibElementsFromPosition( char cType,
720  edDirection direction, unsignedLongFib lNumberOfMaxReturnedElements );
721 
722  /**
723  * This method checks if the given variable is defined in the given
724  * direction from this Fib-element.
725  * This is for intern use to get the correct data from
726  * isDefinedVariable() without pCallingFibElement.
727  *
728  * @see cFibVariable
729  * @see isUsedVariable()
730  * @param pVariable the variable to check if it is defined
731  * @param direction the direction from this Fib-element, in which the
732  * variable should be defined; standardvalue is ED_POSITION so yust
733  * this Fib-element will be checked
734  * @param pCallingFibElement the Fib-Element which called this method
735  * @return true if the variable is used, else false
736  */
737  virtual bool isDefinedVariableInternal( const cFibVariable * pVariable,
738  edDirection direction = ED_POSITION,
739  const cFibElement * pCallingFibElement = NULL ) const;
740 
741  /**
742  * This method returns all variables defined in the given direction from
743  * this Fib-element.
744  * This is for intern use to get the correct data from
745  * getDefinedVariables() without pCallingFibElement..
746  *
747  * @see cFibVariable
748  * @see getUsedVariables()
749  * @see isDefinedVariable()
750  * @param direction the direction from this Fib-element, in which the
751  * variable should be used; standardvalue is ED_POSITION so yust
752  * this Fib-element will be checked
753  * @param pCallingFibElement the Fib-Element which called this method
754  * @return the set with all variables used in the given direction from
755  * this Fib-element
756  */
757  virtual list< cFibVariable* > getDefinedVariablesInternal(
758  edDirection direction = ED_HIGHER,
759  const cFibElement * pCallingFibElement = NULL );
760 
761 #ifdef FEATURE_EQUAL_FIB_OBJECT
762 
763  /**
764  * This method checks if the given Fib-object is equal to this fib
765  * -object.
766  * Variables can be others, but must be defined and used in equivalent
767  * Fib-elements.
768  *
769  * @param fibObject the Fib-object to which this Fib-object should be
770  * equal
771  * @param mapEqualRootObjects the root objects of this object that wher
772  * already checked as equal
773  * map entries:
774  * key: the root-element of this Fib object that was checked
775  * value: the to the key correspondending root-element of the
776  * fibObject that was checked and which is equal to the key
777  * root-element
778  * (it is empty if bCheckExternalObjects == false)
779  * @param mapEqualDefinedVariables the Fib elements that defines
780  * variables and are equal;
781  * map entries:
782  * key: the Fib element of this Fib object that was checked
783  * value: the to the key correspondending Fib element of the
784  * fibObject that was checked and which sets its defined
785  * variables to the same values as the key Fib element
786  * @param bCheckExternalObjects if true the external objects of
787  * cExtObject will be compared
788  * @return true if this Fib-object is equal to the given Fib-object,
789  * else false
790  */
791  virtual bool equalInternal( const cFibElement & fibObject,
792  map< const cRoot *, const cRoot * > & mapEqualRootObjects,
793  map< const cFibElement *, const cFibElement * > & mapEqualDefinedVariables,
794  const bool bCheckExternalObjects ) const;
795 
796 #endif //FEATURE_EQUAL_FIB_OBJECT
797 
798 };//end class cFibLimb
799 
800 
801 }//end namespace fib
802 
803 #endif
804 
805