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
cFibObjectCounts.h
Go to the documentation of this file.
1 /**
2  * @class cFibObjectCounts
3  * file name: cFibObjectCounts.h
4  * @author Betti Oesterholz
5  * @date 16.08.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class is for storing the data of counters for a Fib-object.
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 class is for storing the data of counters for a Fib-object.
28  * It is basicly a helpclass for cFibBranch to store ist counters.
29  * Stored counts are:
30  * - the number of all Fib-elements
31  * - the number of Fib-elements of the different typs
32  * - the number of objectpoints
33  *
34  */
35 /*
36 History:
37 16.08.2010 Oesterholz created
38 28.04.2011 Oesterholz if-element added
39 03.08.2011 Oesterholz cExtObject added
40 07.11.2011 Oesterholz cExtSubobject added
41 15.12.2011 Oesterholz cFibSet and cFibmatrix added
42 */
43 
44 #ifndef ___C_FIB_OBJECT_COUNTS_H__
45 #define ___C_FIB_OBJECT_COUNTS_H__
46 
47 
48 #include "fibDatatyps.h"
49 
50 #include <valarray>
51 
52 using namespace std;
53 
54 namespace fib{
55 
56 
58 
59 public:
60 
61  /**
62  * The maximal number of possible Fib-elementtyps.
63  * @see uiNumberOfFibElements .
64  */
65  static const char MAX_ELEMENT_TYPS = 13;
66 
67  /**
68  * The type for the vector with the counters of the Fib-elements.
69  * @see vecNumberOfFibElements
70  */
71  typedef valarray<intFib> typeVecCounters;
72 
73  /**
74  * Defines for the Fib-element type position in
75  * @see uiNumberOfFibElements .
76  * Thy can be use as an index in uiNumberOfFibElements .
77  */
78  static const char ALL = 0;
79  static const char POINT = 1;
80  static const char LIST = 2;
81  static const char ROOT = 3;
82  static const char IF = 4;
83  static const char PROPERTY = 5;
84  static const char FUNCTION = 6;
85  static const char AREA = 7;
86  static const char COMMENT = 8;
87  static const char EXT_OBJECT = 9;
88  static const char EXT_SUBOBJECT = 10;
89  static const char FIB_SET = 11;
90  static const char FIB_MATRIX = 12;
91 
92  /**
93  * The number of Fib-elements of the given type.
94  */
96 
97  /**
98  * The number of objectpoints.
99  */
101 
102 
103  /**
104  * Standardconstructor
105  */
107 
108  /**
109  * The adding operator.
110  * It adds the counts of the given cFibObjectCounts to this
111  * cFibObjectCounts.
112  *
113  * @param fibObjectCounts the counts to add
114  * @return a reference to this object
115  */
116  cFibObjectCounts & operator+=( const cFibObjectCounts & fibObjectCounts );
117 
118  /**
119  * The subtracting operator.
120  * It adds the counts of the given cFibObjectCounts to this
121  * cFibObjectCounts.
122  *
123  * @param fibObjectCounts the counts to subtract
124  * @return a reference to this object
125  */
126  cFibObjectCounts & operator-=( const cFibObjectCounts & fibObjectCounts );
127 
128  /**
129  * This method reevalues the counter for all fib elements with the help
130  * of the counters of the Fib-elements of the different typs.
131  *
132  * @return the number of all Fib-elements
133  */
134  intFib evalueAllFibElements();
135 
136  /**
137  * @return the number of move points evalued with the help of counters
138  * of the Fib-elements of the different typs
139  */
140  intFib getNumberOfMovePoints() const;
141 
142 
143  /**
144  * @param cType the char for the Fib-elementtype for which to return
145  * the index in the @see uiNumberOfFibElements array
146  * @return the indexnumber for the @see uiNumberOfFibElements array
147  * which contains the count of the elements of the given type
148  */
149  static int elementTypeToIndex( char cType );
150 
151  /**
152  * @param index the index for which to return the Fib-elementtype char
153  * @return the char for the elementtype, which has the given index in
154  * the @see uiNumberOfFibElements array
155  */
156  static char indexToElementType( const char index );
157 
158  /**
159  * This function checks if the given type char stands for an valid /
160  * existing type.
161  *
162  * @see cFibElement::getType()
163  * @param cType the type char to check
164  * @return true if the type for the given type char is valid /exists,
165  * else false
166  */
167  static bool isValidType( const char cType );
168 
169 };//end class cFibObjectCounts
170 
171 
172 }//end namespace fib
173 
174 #endif //___C_FIB_OBJECT_COUNTS_H__