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
cFunctionArcsin.h
Go to the documentation of this file.
1 /**
2  * @class cFunctionArcsin
3  * file name: cFunctionArcsin.h
4  * @author Betti Oesterholz
5  * @date 08.05.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class represents a Fib -function for the arcussinus function.
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 a Fib -function for the arcussinus function.
28  * This function realisises the arcussinus function of it's one underfunction.
29  * ( arcsin( underfunction ) )
30  *
31  */
32 /*
33 History:
34 08.05.2010 Oesterholz created
35 */
36 
37 #ifndef ___C_FUNCTION_ARCSIN_H__
38 #define ___C_FUNCTION_ARCSIN_H__
39 
40 
41 #include "cFunctionOneValue.h"
42 
43 #include "cmath"
44 
45 
46 namespace fib{
47 
48 
50 
51 public:
52 
53  /**
54  * The constructor of the underfunction.
55  *
56  * @param pUnderfunction a pointer to the underfunction for the function
57  * (a clone of the underfunction will be taken as the underfunction of
58  * this function; this is a pointer, so that this constructor didn't
59  * gets confused with the copy constructor) @see pUnderfunction
60  * @param pInSuperiorFunction the underfunction which contains the
61  * new underfunction
62  * @param pInDefiningFibElement the fib -element which defines/ uses
63  * the new underfunction
64  */
66  cUnderFunction * pInSuperiorFunction = NULL,
67  cFibElement * pInDefiningFibElement = NULL );
68 
69  /**
70  * The copy constructor of the underfunction.
71  * This constructor will also copy the underfunctions of the given
72  * function.
73  *
74  * @param underfunction the underfunction which to copy
75  * @param pInSuperiorFunction the underfunction which contains the
76  * new underfunction
77  * @param pInDefiningFibElement the fib -element which defines/ uses
78  * the new underfunction
79  */
80  cFunctionArcsin( const cFunctionArcsin & underfunction,
81  cUnderFunction * pInSuperiorFunction = NULL,
82  cFibElement *pInDefiningFibElement = NULL );
83 
84  /**
85  * The constructor for restoring a value underfunction from an TinyXml element.
86  *
87  * @param pXmlNode a pointer to the TinyXml node the underfunction is stored in
88  * @param outStatus An reference to an integervalue where the errorvalue
89  * can be stored to.
90  * possible errorvalues are:
91  * - 0 loading successful
92  * - -1 loading error, invalid pXmlElement
93  * - -2 loading error, invalid data in pXmlElement
94  * - 1 loading warning, invalid data in pXmlElement, error could be corrected
95  * - 2 loading warning, invalid data in pXmlElement, maybe the loaded
96  * object is wrong
97  * @param liDefinedVariables a list with the defined variables for the
98  * to restore fib -element, every variable should have it's number
99  * (the number under which it is stored) as it's value
100  * @param pInSuperiorFunction the underfunction which contains the
101  * new underfunction
102  * @param pInDefiningFibElement the fib -element which defines/ uses
103  * the new underfunction
104  */
105  cFunctionArcsin( const TiXmlElement * pXmlElement, intFib & outStatus,
106  list<cFibVariable*> & liDefinedVariables,
107  cUnderFunction * pInSuperiorFunction = NULL,
108  cFibElement * pInDefiningFibElement = NULL );
109 
110  /**
111  * This constructor restores a value underfunction from the stream
112  * where it is stored in the compressed fib -format.
113  * Beware: The bits for the functiontype should be allready readed, this
114  * constructor reads yust the two underfunctions.
115  *
116  * @param iBitStream the stream where this underfunction is stored to in,
117  * because this stream is an cReadBits, any number of bits can be
118  * readed from it
119  * @param outStatus An reference to an integervalue where the errorvalue
120  * can be stored to. If the pointer is NULL no errorvalue will be
121  * given back.
122  * possible errorvalues are:
123  * - 0 loading successful
124  * - -1 loading error, invalid stream
125  * - -2 loading error, invalid data in stream
126  * - 1 loading warning, invalid data in stream, error could be corrected
127  * - 2 loading warning, invalid data in stream, maybe the loaded
128  * object is wrong
129  * @param liDefinedVariables a list with the defined variables for the
130  * to restore fib -element, every variable should have it's number
131  * (the number under which it is stored) as it's value
132  * @param pInDomainValue the domain for value underfunction
133  * @param pInDomainVariable the domain for variables
134  * @param pInSuperiorFunction the underfunction which contains the
135  * new underfunction
136  * @param pInDefiningFibElement the fib -element which defines/ uses
137  * the new underfunction
138  */
139  cFunctionArcsin( cReadBits & iBitStream, intFib & outStatus,
140  list<cFibVariable*> & liDefinedVariables,
141  const cDomainSingle * pInDomainValue, const cDomainSingle * pInDomainVariable,
142  cUnderFunction * pInSuperiorFunction = NULL,
143  cFibElement * pInDefiningFibElement = NULL );
144 
145 
146  /**
147  * Returns the value of the underfunction or 0 if non such exists.
148  *
149  * @return the value of the underfunction or 0 if non
150  * such exists
151  */
152  virtual doubleFib getValue() const;
153 
154  /**
155  * This method evaluades the size of the Fib -object in bits in the
156  * compressed file form.
157  * The optionalpart field of point -elements will be ignored.
158  *
159  * @see store()
160  * @return the size of the Fib -object in bits in the compressed form
161  */
162  virtual unsignedLongFib getCompressedSize() const;
163 
164  /**
165  * This method stores this Fib -object in the compressed Fib -format
166  * into the given stream.
167  * It is needed becouse the stream can yust store byts but the size of
168  * fib -elements can be any number of bits. Because of that ther have to
169  * be a possibility to exchange the misarcsing bits betwean the fib -elements.
170  *
171  * @see store
172  * @param stream the stream where this Fib -object should be stored to
173  * @param cRestBits the not yet writen bits which should be stored
174  * @param uiRestBitPosition the number of bits in the cRestBits which
175  * should be writen respectively containing valid information
176  * @return true if this Fib -object is stored, else false
177  */
178  virtual bool store( ostream & stream, char & cRestBits,
179  unsigned char & uiRestBitPosition ) const;
180 
181  /**
182  * @return the type for the underfunction
183  */
184  virtual unsignedIntFib getType() const;
185 
186  /**
187  * @return the name for the underfunction
188  */
189  virtual string getUnderFunctionName() const;
190 
191  /**
192  * This method duplicates this whole underfunction.
193  * Underfunctions of this underfunction are also cloned.
194  *
195  * @param pSuperiorUnderFunction the underfunction which contains
196  * @param pInDefiningFibElement the Fib -element which defines/ uses
197  * @return the cloned/ duplicated underfunction
198  */
199  virtual cFunctionArcsin * clone(
200  cUnderFunction * pInSuperiorUnderFunction = NULL,
201  cFibElement *pInDefiningFibElement = NULL) const;
202 
203 
204 
205 };//end class cFunctionArcsin
206 
207 
208 }//end namespace fib
209 
210 #endif