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
cTypeUnderFunction.h
Go to the documentation of this file.
1 /**
2  * @class cTypeUnderFunction
3  * file name: cTypeUnderFunction.h
4  * @author Betti Oesterholz
5  * @date 22.04.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class represents an abstract Fib -underfunctions.
11  * Copyright (C) @c LGPL3 2010 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 represents an abstract Fib -underfunctions.
28  * Fib -underfunctions are the elements to evalue to a function.
29  *
30  * @see cUnderFunction
31  */
32 /*
33 History:
34 22.04.2010 Oesterholz created
35 12.02.2012 Oesterholz restoreXml*() without restoring domain possible
36 */
37 
38 #ifndef ___C_TYPE_UNDER_FUNCTION_H__
39 #define ___C_TYPE_UNDER_FUNCTION_H__
40 
41 
42 #include "cTypeElement.h"
43 
44 
45 namespace fib{
46 
47 
49 
50 public:
51 
52  /**
53  * This Function returns for the type of the element an number.
54  * The values, which are returned, mean:
55  * - 1: cTypeDimension
56  * - 2: cTypeUnderArea
57  * - 3: cTypeUnderFunction
58  * - 5: cTypeInVar
59  * - 6: cTypeProperty
60  * - 10: cTypeVariable
61  * - 11: cTypeComments
62  * - 12: cTypeExtObject
63  * - 13: cTypeExtSubobject
64  * - 14: cTypeFibSet
65  * - 15: cTypeFibMatrix
66  * - 16: cTypeExtObjectInput
67  *
68  * @return for the type of the element an number
69  */
70  virtual unsignedIntFib getType() const;
71 
72  /**
73  * This Method clones this object.
74  *
75  * @return a clone of this object
76  */
77  virtual cTypeUnderFunction *clone() const;
78 
79  /**
80  * This method evaluades the size of the typeelement in bits in the
81  * compressed file form.
82  *
83  * @see store()
84  * @return the size of the typeelement in bits in the compressed form
85  */
86  virtual unsignedLongFib getCompressedSize() const;
87 
88  /**
89  * This method stores this type in the XML -format into the
90  * given stream.
91  *
92  * @param ostream the stream where domains should be stored to
93  * @param domain the domain which should be stored to this type;
94  * if a Nullpointer NULL (the standardvalue) is given, no domain
95  * will be stored to this type
96  * @return true if this type are stored, else false
97  */
98  virtual bool storeXml( ostream & ostream,
99  const cDomain * domain = NULL ) const;
100 
101  /**
102  * This method restores a type with a domain in the XML -format from an
103  * TinyXml element.
104  *
105  * @param pXmlNode a pointer to the TinyXml node wher the type is stored in
106  * @param outStatus an integer value with the errorvalue
107  * possible errorvalues are:
108  * - 0 loading successful
109  * - -1 loading error, invalid pXmlElement
110  * - -2 loading error, invalid data in pXmlElement
111  * - 1 loading warning, invalid data in pXmlElement, error could be corrected
112  * - 2 loading warning, invalid data in pXmlElement, maybe the loaded
113  * object is wrong
114  * @param bRestoreDomain if true a domain is to be asumed in the type
115  * element and it will be restored, else no domain will be restores
116  * @return a pointer to the restored domain, or NULL if it couldn't be restored
117  */
118  virtual cDomain * restoreXmlWithDomain( const TiXmlElement * pXmlElement,
119  intFib & outStatus, const bool bRestoreDomain = true );
120 
121  /**
122  * This method stores this typeelement in the compressed fib -format
123  * into the given stream.
124  * It is needed because the stream can yust store byts but the size of
125  * fib -elements can be any number of bits. Because of that ther have to
126  * be a possibility to exchange the missing bits betwean the fib -elements.
127  *
128  * @see cFibElement::store
129  * @param stream the stream where this typeelement should be stored to
130  * @param cRestBits the not yet writen bits which should be stored
131  * @param uiRestBitPosition the number of bits in the cRestBits which
132  * should be writen respectively containing valid information
133  * @return true if the typeelement is stored, else false
134  */
135  virtual bool store( ostream & stream, char & cRestBits,
136  unsigned char & uiRestBitPosition ) const;
137 
138  /**
139  * This method restores a type from a bitstream, wher it is
140  * stored in the compressed fib -format.
141  *
142  * @see store
143  * @param iBitStream the stream where the type is stored in,
144  * because the stream is an cReadBits, any number of bits can be
145  * readed from it
146  * @return an integervalue with the errorvalue
147  * possible errorvalues are:
148  * - 0 loading successful
149  * - -1 loading error, invalid pXmlElement
150  * - -2 loading error, invalid data in pXmlElement
151  * - 1 loading warning, invalid data in pXmlElement, error could be corrected
152  * - 2 loading warning, invalid data in pXmlElement, maybe the loaded
153  * object is wrong
154  */
155  virtual intFib restore( cReadBits & iBitStream );
156 
157 
158 };//end class cTypeUnderFunction
159 
160 
161 }//end namespace fib
162 
163 #endif //___C_TYPE_UNDER_FUNCTION_H__