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
cVectorFibMatrix.h
Go to the documentation of this file.
1 /**
2  * @class cVectorFibMatrix
3  * file name: cVectorFibMatrix.h
4  * @author Betti Oesterholz
5  * @date 06.12.2011
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class represents a matrix element vector.
11  * Copyright (C) @c LGPL3 2011 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 matrix element vector of the
28  * Fib multimedia language.
29  * It is a vector for matrix elements.
30  *
31  */
32 /*
33 History:
34 06.12.2011 Oesterholz created
35 */
36 
37 #ifndef ___C_VECTOR_FIB_MATRIX_H__
38 #define ___C_VECTOR_FIB_MATRIX_H__
39 
40 
41 #include "cFibVector.h"
42 
43 namespace fib{
44 
45 class cFibMatrix;//cyclic dependencie
46 
48 
49 public:
50 
51 
52  /**
53  * The constructor of the matrix element vector.
54  *
55  * @param iNumberOfElements the number of elements the vector should have
56  * @param pDefiningElement the Fib element which
57  * defines/ uses the matrix element vector
58  */
59  cVectorFibMatrix( unsignedIntFib iNumberOfElements=2,
60  cFibElement * pDefiningMatrixElement=NULL );
61 
62  /**
63  * The constructor of the matrix element vector.
64  *
65  * @param definingMatrixElement the Fib matrix element which
66  * defines/ uses the matrix element vector
67  */
68  cVectorFibMatrix( cFibMatrix & definingMatrixElement );
69 
70  /**
71  * The copy constructor of the vector.
72  *
73  * @param vector the vector from which to copy the data
74  * @param pDefiningFibElement the Fib element which defines/ uses
75  * the new vector
76  */
77  cVectorFibMatrix( const cVectorFibMatrix & vector,
79 
80  /**
81  * The constructor for restoring a vector from an TinyXml element.
82  *
83  * @param pXmlNode a pointer to the TinyXml node the vector is stored in
84  * @param outStatus An reference to an integervalue where the errorvalue
85  * can be stored to.
86  * possible errorvalues are:
87  * - 0 loading successful
88  * - -1 loading error, invalid pXmlElement
89  * - -2 loading error, invalid data in pXmlElement
90  * - 1 loading warning, invalid data in pXmlElement, error could be corrected
91  * - 2 loading warning, invalid data in pXmlElement, maybe the loaded
92  * object is wrong
93  * @param liDefinedVariables a list with the defined variables for the
94  * to restore vector, every variable should have it's number
95  * (the number under which it is stored) as it's value
96  */
97  cVectorFibMatrix( const TiXmlElement * pXmlElement, intFib &outStatus,
98  list<cFibVariable*> & liDefinedVariables );
99 
100 
101  /**
102  * This constructor restores a matrix element vector from the stream where
103  * it is stored in the compressed Fib format.
104  *
105  * @param iBitStream the stream where this vector is stored to in,
106  * because this stream is an cReadBits, any number of bits can be
107  * readed from it
108  * @param outStatus An reference to an integervalue where the errorvalue
109  * can be stored to. If the pointer is NULL no errorvalue will be
110  * given back.
111  * possible errorvalues are:
112  * - 0 loading successful
113  * - -1 loading error, invalid stream
114  * - -2 loading error, invalid data in stream
115  * - 1 loading warning, invalid data in stream, error could be corrected
116  * - 2 loading warning, invalid data in stream, maybe the loaded
117  * object is wrong
118  * @param liDefinedVariables a list with the defined variables for the
119  * to restore vector, every variable should have it's number
120  * (the number under which it is stored) as it's value
121  * @param pInVectorDomain the domain for this vector
122  * @param pInDomainVariable the domain for variables
123  * @param uiInNumberOfElements the number of elements to restore,
124  * if not given or 0, it will be evalued by the number of elements of
125  * the given domain pInVectorDomain
126  */
127  cVectorFibMatrix( cReadBits & iBitStream, intFib & outStatus,
128  list<cFibVariable*> & liDefinedVariables,
129  const cDomain * pInVectorDomain, const cDomain * pInDomainVariable,
130  const unsignedIntFib uiInNumberOfElements );
131 
132 
133  /**
134  * This method creates an instance of this vector type.
135  *
136  * @param iNumberOfVectorElements number of elements in the vector
137  * @param pDefiningElement the Fib matrix element which
138  * defines/ uses the matrix element vector
139  */
141  unsignedIntFib iNumberOfVectorElements=2,
142  cFibElement * pDefiningElement = NULL ) const;
143 
144  /**
145  * Returns the type of the vector.
146  * You have to delete the returned object after usage.
147  *
148  * @return the type of the vector
149  */
150  virtual cTypeElement * getElementType( ) const;
151 
152  /**
153  * Returns a reference to the domain of the vector or
154  * the nullpointer NULL if no domain is defined for the vector.
155  * If the nullpointer NULL is returned the standarddomain is valid for the
156  * vector.
157  *
158  * @return a reference to the vectordomain of the vector
159  */
160  virtual cDomainVectorBasis * getDomain() const;
161 
162  /**
163  * Returns a reference to the standard domain of the vector.
164  * You have to delete the returned object after usage.
165  *
166  * @return a reference to the standard domain of the vector
167  */
168  virtual cDomainVectorBasis * getStandardDomain() const;
169 
170  /**
171  * Returns a reference to the value domain of the vector or
172  * the nullpointer NULL if no value domain is defined for the vector.
173  * If the nullpointer NULL is returned the standarddomain is valid for the
174  * vector.
175  *
176  * @return a reference to the definitionarea of the vector
177  */
178  virtual cDomainVectorBasis * getValueDomain() const;
179 
180 
181  /**
182  * @return the name for the type of the vector
183  */
184  virtual string getVectorType() const;
185 
186  /**
187  * Sets the Fib-element which defines/ uses this vector.
188  * If the given pointer is the nullpointer (standardvalue), no
189  * Fib-element defines this vector.
190  *
191  * @param pFibElement a pointer to the Fib-element which
192  * defines/ uses this vector
193  * @param bCheckDomains getthe domains of the defining element and
194  * check the vectorelements with it
195  */
196  virtual void setDefiningFibElement( cFibElement * pFibElement=NULL,
197  bool bCheckDomains=true );
198 
199 
200 };//cVectorFibMatrix
201 }//namespace fib
202 
203 #endif //___C_VECTOR_FIB_MATRIX_H__
204 
205 
206 
207 
208 
209