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
fib::cFibVector Class Reference

#include <cFibVector.h>

Inheritance diagram for fib::cFibVector:
Collaboration diagram for fib::cFibVector:

List of all members.

Public Member Functions

virtual ~cFibVector ()
unsignedIntFib getNumberOfElements () const
virtual bool isVariable (unsignedIntFib iNumberElement) const
virtual bool isUsedVariable (const cFibVariable *variable) const
virtual set< cFibVariable * > getUsedVariables ()
virtual bool replaceVariable (cFibVariable *variableOld, cFibVariable *variableNew)
virtual doubleFib getValue (unsignedIntFib iNumberElement) const
virtual bool setValue (unsignedIntFib iNumberElement, doubleFib dValue)
virtual cFibVariablegetVariable (unsignedIntFib iNumberElement)
virtual bool setVariable (unsignedIntFib iNumberElement, cFibVariable *pVariable)
virtual cTypeElementgetElementType () const =0
virtual cDomainVectorBasisgetDomain () const
virtual cDomainVectorBasisgetValueDomain () const
virtual cDomaingetDomain (unsignedIntFib iNumberElement) const
virtual cDomainVectorBasisgetStandardDomain () const
virtual cDomainSinglegetVariableDomain () const
cFibElementgetDefiningFibElement () const
virtual void setDefiningFibElement (cFibElement *fibElement=NULL, bool bCheckDomains=true)
virtual unsignedLongFib getCompressedSize () const
virtual unsignedLongFib getCompressedSize (const cDomainVectorBasis &valueVectorDomain, const cDomainSingle &variableDomain) const
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition, const cDomainVectorBasis &valueVectorDomain, const cDomainSingle &variableDomain) const
virtual bool storeXml (ostream &stream) const
virtual string getVectorType () const =0
virtual bool equal (const cFibVector &vector) const
virtual bool operator== (const cFibVector &vector) const
bool operator!= (const cFibVector &vector) const
virtual cFibVectoroperator= (const cFibVector &vector)
virtual bool operator< (const cFibVector &vector) const

Static Public Member Functions

static bool lowerVector (const cFibVector &vector1, const cFibVector &vector2)

Protected Types

enum  eVectorType { VALUE, VARIABLE }

Protected Member Functions

 cFibVector (unsignedIntFib iNumberOfVectorElements=1, cFibElement *definingFibElement=NULL)
 cFibVector (const cFibVector &vector, cFibElement *definingFibElement=NULL)
 cFibVector (const TiXmlElement *pXmlElement, intFib &outStatus, list< cFibVariable * > &liDefinedVariables)
 cFibVector (cReadBits &iBitStream, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, const cDomain *pInVectorDomain, const cDomain *pInDomainVariable, const unsignedIntFib uiInNumberOfElements=0)
virtual cFibVectorcreateInstance (unsignedIntFib iNumberOfVectorElements=1, cFibElement *definingFibElement=NULL) const =0
virtual cFibElementgetVariableUsingFibElement () const
virtual bool deleteVariable (cFibVariable *pVariable)

Protected Attributes

vector< eVectorTypeliVectorType
vector< doubleFibliVectorValues
vector< cFibVariable * > liVectorVariable
cFibElementpDefiningFibElement

Friends

class cDomainVector
class cDomainVectorOpenEnd
class cArea
class cProperty
class cPoint
class cExtObject
class cExtSubobject
class cFibSet
class cFibMatrix

Detailed Description

Definition at line 77 of file cFibVector.h.


Member Enumeration Documentation

the type fore the type of the vectorelements

Enumerator:
VALUE 
VARIABLE 

Definition at line 94 of file cFibVector.h.


Constructor & Destructor Documentation

fib::cFibVector::cFibVector ( unsignedIntFib  iNumberOfVectorElements = 1,
cFibElement definingFibElement = NULL 
)
protected

The constructor of the vector.

Parameters:
iNumberOfVectorElementsnumber of elements in the vector
definingFibElementthe Fib-element which defines/ uses the new vector
fib::cFibVector::cFibVector ( const cFibVector vector,
cFibElement definingFibElement = NULL 
)
protected

The copy constructor of the vector.

Parameters:
vectorthe vector from which to copy the data
definingFibElementthe Fib-element which defines/ uses the new vector
fib::cFibVector::cFibVector ( const TiXmlElement *  pXmlElement,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables 
)
protected

The constructor for restoring a vector from an TinyXml element.

Parameters:
pXmlNodea pointer to the TinyXml node the vector is stored in
outStatusAn reference to an integervalue where the errorvalue can be stored to. possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid pXmlElement
  • -2 loading error, invalid data in pXmlElement
  • 1 loading warning, invalid data in pXmlElement, error could be corrected
  • 2 loading warning, invalid data in pXmlElement, maybe the loaded object is wrong
liDefinedVariablesa list with the defined variables for the to restore vector, every variable should have it's number (the number under which it is stored) as it's value
fib::cFibVector::cFibVector ( cReadBits iBitStream,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables,
const cDomain pInVectorDomain,
const cDomain pInDomainVariable,
const unsignedIntFib  uiInNumberOfElements = 0 
)
protected

This constructor restores a poisitionsvector from the stream where it is stored in the compressed Fib-format.

Parameters:
iBitStreamthe stream where this vector is stored to in, because this stream is an cReadBits, any number of bits can be readed from it
outStatusAn reference to an integervalue where the errorvalue can be stored to. If the pointer is NULL no errorvalue will be given back. possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid stream
  • -2 loading error, invalid data in stream
  • 1 loading warning, invalid data in stream, error could be corrected
  • 2 loading warning, invalid data in stream, maybe the loaded object is wrong
liDefinedVariablesa list with the defined variables for the to restore vector, every variable should have it's number (the number under which it is stored) as it's value
pInVectorDomainthe domain for this vector
pInDomainVariablethe domain for variables
uiInNumberOfElementsthe number of elements to restore, if not given or 0, it will be evalued by the number of elements of the given domain pInVectorDomain
virtual fib::cFibVector::~cFibVector ( )
virtual

The destructor of the vector.


Member Function Documentation

virtual cFibVector* fib::cFibVector::createInstance ( unsignedIntFib  iNumberOfVectorElements = 1,
cFibElement definingFibElement = NULL 
) const
protectedpure virtual

This method creates an instance of this vector type.

Parameters:
iNumberOfVectorElementsnumber of elements in the vector
definingFibElementthe Fib-element which defines/ uses the vector

Implemented in fib::cVectorArea, fib::cVectorProperty, fib::cVectorPosition, fib::cVectorExtObject, fib::cVectorExtSubobject, fib::cVectorFibMatrix, and fib::cVectorFibSet.

virtual bool fib::cFibVector::deleteVariable ( cFibVariable pVariable)
protectedvirtual

This method deletes all occurenc of the given variable from this element. So the variable is not used anymore of this element. Beware: This element has to be unregisterd (call unregisterUsingElement() ) at the pVariable seperatly. Do this directly befor or after calling this method.

Parameters:
pVariablethe variable which is to delete from this element
Returns:
true if the variable dosn't occure anymore in this element, else false

Implements fib::iVariableUser.

virtual bool fib::cFibVector::equal ( const cFibVector vector) const
virtual

This Method checks if the given vector is equal to this vector.

Parameters:
vectorthe vector to compare with this vector
Returns:
true if the given vector is equal to this vector, else false
virtual unsignedLongFib fib::cFibVector::getCompressedSize ( ) const
virtual

This method evaluades the size of the Fib-object in bits in the compressed file form.

See also:
store()
Returns:
the size of the Fib-object in bits in the compressed form
virtual unsignedLongFib fib::cFibVector::getCompressedSize ( const cDomainVectorBasis valueVectorDomain,
const cDomainSingle variableDomain 
) const
virtual

This method evaluades the size of the Fib-object in bits in the compressed file form.

See also:
store()
Parameters:
valueVectorDomainthe domain for this vector
variableDomainthe domain for variables
Returns:
the size of the Fib-object in bits in the compressed form
cFibElement* fib::cFibVector::getDefiningFibElement ( ) const
Returns:
the Fib-element which defines/ uses this vector or a Nullpointer NULL if non such Fib-element exists
virtual cDomainVectorBasis* fib::cFibVector::getDomain ( ) const
virtual

Returns a reference to the domain of the vector or the nullpointer NULL if no domain is defined for the vector. If the nullpointer NULL is returned the standarddomain is valid for the vector.

Returns:
a reference to the vectordomain of the vector

Reimplemented in fib::cVectorArea, fib::cVectorExtObject, fib::cVectorExtSubobject, fib::cVectorFibMatrix, and fib::cVectorFibSet.

virtual cDomain* fib::cFibVector::getDomain ( unsignedIntFib  iNumberElement) const
virtual

Returns a reference to the domain the iNumberElement'te vectorelement or the nullpointer NULL if non exists.

Parameters:
iNumberElementthe number of the element, which definitionarea is to return
Returns:
a reference to the definitionarea of the iNumberElement'te vectorelement
virtual cTypeElement* fib::cFibVector::getElementType ( ) const
pure virtual

Returns the type of the vector. You have to delete the returned object after usage.

Returns:
the type of the vector

Implemented in fib::cVectorArea, fib::cVectorProperty, fib::cVectorPosition, fib::cVectorExtObject, fib::cVectorExtSubobject, fib::cVectorFibMatrix, and fib::cVectorFibSet.

unsignedIntFib fib::cFibVector::getNumberOfElements ( ) const

Returns the number of elements the vector contains.

Returns:
the number of elements the vector contains
virtual cDomainVectorBasis* fib::cFibVector::getStandardDomain ( ) const
virtual

Returns a reference to the standard domain of the vector. You have to delete the returned object after usage.

Returns:
a reference to the standard domain of the vector

Reimplemented in fib::cVectorArea, fib::cVectorExtObject, fib::cVectorExtSubobject, fib::cVectorFibMatrix, and fib::cVectorFibSet.

virtual set<cFibVariable*> fib::cFibVector::getUsedVariables ( )
virtual

This method returns all variables used in this vector.

See also:
cFibVariable
Returns:
all variables used in this vector
virtual doubleFib fib::cFibVector::getValue ( unsignedIntFib  iNumberElement) const
virtual

Returns the value of the iNumberElement'te vectorelement or Nullvalue if non such exists.

Parameters:
iNumberElementthe number of the element, which value is to return
Returns:
the value of the iNumberElement'te vectorelement or 0 if non such exists
virtual cDomainVectorBasis* fib::cFibVector::getValueDomain ( ) const
virtual

Returns a reference to the value domain of the vector or the nullpointer NULL if no value domain is defined for the vector. If the nullpointer NULL is returned the standarddomain is valid for the vector.

Returns:
a reference to the definitionarea of the vector

Reimplemented in fib::cVectorArea, fib::cVectorExtObject, fib::cVectorExtSubobject, fib::cVectorFibMatrix, and fib::cVectorFibSet.

virtual cFibVariable* fib::cFibVector::getVariable ( unsignedIntFib  iNumberElement)
virtual

Returns the variable of the iNumberElement'te vectorelement or the Nullpointer NULL, if the iNumberElement'te vectorelement isn't an variable.

Parameters:
iNumberElementthe number of the element, which variable is to return
Returns:
the variable of the iNumberElement'te vectorelement or the Nullpointer NULL, if the iNumberElement'te vectorelement isn't an variable.
virtual cDomainSingle* fib::cFibVector::getVariableDomain ( ) const
virtual

Returns a reference to the domain for variables of the vector. You have to delete the returned object after usage.

Returns:
a reference to the domain for variables of the vector
virtual cFibElement* fib::cFibVector::getVariableUsingFibElement ( ) const
protectedvirtual
Returns:
the Fib-element which uses the variables of this element

Implements fib::iVariableUser.

virtual string fib::cFibVector::getVectorType ( ) const
pure virtual
virtual bool fib::cFibVector::isUsedVariable ( const cFibVariable variable) const
virtual

This method checks if the given variable is used in this vector.

See also:
cFibVariable
Parameters:
variablethe variable to check if it is used
Returns:
true if the variable is used, else false
virtual bool fib::cFibVector::isVariable ( unsignedIntFib  iNumberElement) const
virtual

Returns if the iNumberElement'te vectorelement is an variable.

Parameters:
iNumberElementthe number of the element, for which is to check if it is an variable
Returns:
true if the iNumberElement'te vectorelement is an variable, else false
static bool fib::cFibVector::lowerVector ( const cFibVector vector1,
const cFibVector vector2 
)
static

This function compares two Fib-vectors. A vector is lower, if it has less elements than the other vector or it's i'th element is lower and all j'th elements with i > j are equal.

Parameters:
vector1the first vector to compare
vector2the second vector to compare
Returns:
true if the vector1 is lower than that of vector2, else false
bool fib::cFibVector::operator!= ( const cFibVector vector) const

This Method checks if the given vector is not equal to this vector.

Parameters:
vectorthe vector to compare with this vector
Returns:
true if the given vector is not equal to this vector, else false
virtual bool fib::cFibVector::operator< ( const cFibVector vector) const
virtual

This function compares on lower this vector with the given Fib-vector. A vector is lower, if it has less elements than the other vector or it's i'th element is lower and all j'th elements with i > j are equal.

See also:
lowerVector()
Parameters:
vectorthe vector to compare
Returns:
true if this vector is lower than that of vector, else false
virtual cFibVector& fib::cFibVector::operator= ( const cFibVector vector)
virtual

This Method makes this vectorelements equal to the correspondending vectorelements of the given vector. The type of the vector won't be changed.

Parameters:
vectorthe vector to copy

Reimplemented in fib::cVectorArea, fib::cVectorProperty, and fib::cVectorChecksum.

virtual bool fib::cFibVector::operator== ( const cFibVector vector) const
virtual

This Method checks if the given vector is equal to this vector.

Parameters:
vectorthe vector to compare with this vector
Returns:
true if the given vector is equal to this vector, else false
virtual bool fib::cFibVector::replaceVariable ( cFibVariable variableOld,
cFibVariable variableNew 
)
virtual

This method replace the variable variableOld with the variable variableNew in the vector.

See also:
cFibVariable
isVariable()
isUsedVariable()
Parameters:
variableOldthe variable to replace
variableNewthe variable with which the variable variableOld is to replace
Returns:
true if the variable variableOld is replaced with variableNew, else false
virtual void fib::cFibVector::setDefiningFibElement ( cFibElement fibElement = NULL,
bool  bCheckDomains = true 
)
virtual

Sets the Fib-element which defines/ uses this vector. If the given pointer is the nullpointer (standardvalue), no Fib-element defines this vector.

Parameters:
definingFibElementa pointer to the Fib-element which defines/ uses this vector
bCheckDomainsgetthe domains of the defining element and check the vectorelements with it

Reimplemented in fib::cVectorArea, fib::cVectorExtObject, fib::cVectorExtSubobject, fib::cVectorFibMatrix, fib::cVectorFibSet, and fib::cVectorPosition.

virtual bool fib::cFibVector::setValue ( unsignedIntFib  iNumberElement,
doubleFib  dValue 
)
virtual

Sets the value of the iNumberElement'te vectorelement.

Parameters:
iNumberElementthe number of the element, which value is to set
dValuethe value to set
Returns:
true if the iNumberElement'te vectorelement is set to the given value dValue, else false
virtual bool fib::cFibVector::setVariable ( unsignedIntFib  iNumberElement,
cFibVariable pVariable 
)
virtual

Sets the variable of the iNumberElement'te vectorelement.

Parameters:
iNumberElementthe number of the element, where the variable is to set
pVariablethe variable to set
Returns:
true if the iNumberElement'te vectorelement is set to the given variable pVariable, else false

Reimplemented in fib::cVectorChecksum.

virtual bool fib::cFibVector::store ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
virtual

This method stores this Fib-object in the compressed Fib-format into the given stream. It is needed becouse the stream can yust store byts but the size of Fib-elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the Fib-elements.

See also:
store
Parameters:
streamthe stream where this Fib-object should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
Returns:
true if this Fib-object is stored, else false
virtual bool fib::cFibVector::store ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition,
const cDomainVectorBasis valueVectorDomain,
const cDomainSingle variableDomain 
) const
virtual

This method stores this Fib-object in the compressed Fib-format into the given stream. It is needed becouse the stream can yust store byts but the size of Fib-elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the Fib-elements.

See also:
store
Parameters:
streamthe stream where this Fib-object should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
valueVectorDomainthe domain for this vector
variableDomainthe domain for variables
Returns:
true if this Fib-object is stored, else false
virtual bool fib::cFibVector::storeXml ( ostream &  stream) const
virtual

This method stores this vector in the XML -format into the given stream. Variables should have ther number as ther value.

Parameters:
streamthe stream where this vectorshould be stored to
Returns:
true if this vector is stored, else false

Friends And Related Function Documentation

friend class cArea
friend

Definition at line 81 of file cFibVector.h.

friend class cDomainVector
friend

Definition at line 79 of file cFibVector.h.

friend class cDomainVectorOpenEnd
friend

Definition at line 80 of file cFibVector.h.

friend class cExtObject
friend

Definition at line 84 of file cFibVector.h.

friend class cExtSubobject
friend

Definition at line 85 of file cFibVector.h.

friend class cFibMatrix
friend

Definition at line 87 of file cFibVector.h.

friend class cFibSet
friend

Definition at line 86 of file cFibVector.h.

friend class cPoint
friend

Definition at line 83 of file cFibVector.h.

friend class cProperty
friend

Definition at line 82 of file cFibVector.h.


Member Data Documentation

vector<eVectorType> fib::cFibVector::liVectorType
protected

the vector with the type of the vectorelements

Definition at line 101 of file cFibVector.h.

vector<doubleFib> fib::cFibVector::liVectorValues
protected

the vector with the values of the vectorelements

Definition at line 106 of file cFibVector.h.

vector<cFibVariable*> fib::cFibVector::liVectorVariable
protected

the vector with the variables of the vectorelements

Definition at line 111 of file cFibVector.h.

cFibElement* fib::cFibVector::pDefiningFibElement
protected

the Fib-element which defines/ uses the vector

Definition at line 116 of file cFibVector.h.


The documentation for this class was generated from the following file: