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::cDomains Class Reference

#include <cDomains.h>

Collaboration diagram for fib::cDomains:

List of all members.

Public Member Functions

 cDomains ()
virtual ~cDomains ()
unsignedIntFib getNumberOfDomains () const
cDomaingetDomain (unsignedIntFib iDomainNumber) const
cTypeElementgetType (unsignedIntFib iTypeNumber) const
cDomaingetDomainForElement (const cTypeElement &type) const
cDomaingetDirectDomain (const unsignedIntFib iDomainNumber) const
cDomaingetDirectDomainForElement (const cTypeElement &type) const
cDomaingetDomainForReferenceDomain (cDomainReference *pDomainReference, cTypeElement *pTypeElementForWhich=NULL) const
unsignedIntFib addDomain (const cTypeElement &type, const cDomain &domain)
unsignedIntFib addDomain (const cTypeElement &type, cDomain *domain)
unsignedIntFib setStandardDomain (const cTypeElement &type)
bool deleteDomain (unsignedIntFib iDomainNumber)
bool deleteDomain (const cTypeElement &type)
virtual cDomainsclone () const
virtual unsignedLongFib getCompressedSize () const
virtual bool storeXml (ostream &ostream, string szName=string("domains")) const
virtual intFib restoreXml (const TiXmlElement *pXmlElement)
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual intFib restore (cReadBits &iBitStream)
virtual bool equal (const cDomains &domains) const
virtual bool operator== (const cDomains &domains) const
virtual cDomainsoperator= (const cDomains &domains)

Protected Attributes

list< cDomainElementdomainElements
cDomainIntegerBit standardDomain
list< cDomainElementstandardDomains

Detailed Description

Definition at line 68 of file cDomains.h.


Constructor & Destructor Documentation

fib::cDomains::cDomains ( )

The constructor for the domain list.

virtual fib::cDomains::~cDomains ( )
virtual

The desstructor for the domain list.


Member Function Documentation

unsignedIntFib fib::cDomains::addDomain ( const cTypeElement type,
const cDomain domain 
)

This method adds a given domain for the given type to the domain list. If an domain for the element allready exists, it is replaced.

Parameters:
typethe type for which the domain is to add
domainthe domain for the given type
Returns:
the number of the position on which the new domain stands in the domain list or 0 if the domain wasn't inserted
unsignedIntFib fib::cDomains::addDomain ( const cTypeElement type,
cDomain domain 
)

This method adds a given domain for the given type to the domain list. If an domain for the element allready exists, it is replaced. This add method dosn't copy the domain, befor adding it.

Parameters:
typethe type for which the domain is to add
domaina pointer to the domain for the given type
Returns:
the number of the position on which the new domain stands in the domain list or 0 if the domain wasn't inserted
virtual cDomains* fib::cDomains::clone ( ) const
virtual

This Method clones this object.

Returns:
a clone of this object
bool fib::cDomains::deleteDomain ( unsignedIntFib  iDomainNumber)

This method deletes the domain on the given position iDomainNumber in the domain list.

Parameters:
iDomainNumberthe position on which the domain to delete stands in the domain list (the counting begins with 1)
Returns:
true if the domain on the position is deleted, else false
bool fib::cDomains::deleteDomain ( const cTypeElement type)

This method deletes the domain for the given type from the domain list.

Parameters:
typethe type for which the domain is to delete
Returns:
true if the domain for the given type is deleted, else false
virtual bool fib::cDomains::equal ( const cDomains domains) const
virtual

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

Parameters:
domainsthe domains to compare with this
Returns:
true if the given domains is equal to this domains, else false
virtual unsignedLongFib fib::cDomains::getCompressedSize ( ) const
virtual

This method evaluades the size of the domains in bits in the compressed file form.

See also:
store()
Returns:
the size of the domains in bits in the compressed form
cDomain* fib::cDomains::getDirectDomain ( const unsignedIntFib  iDomainNumber) const

This method returns the direct domain on the given position iDomainNumber in the domain list, without evaluating it. Since some domains (ie cDomainReference) are evalued by methods like getDomain(), this method will return the domain directly without evaluing it.

See also:
getDomain()
getDomainForElement()
Parameters:
iDomainNumberthe position on which the direct domain to return stands in the domain list (the counting begins with 1)
Returns:
a reference to the iDomainNumber'th direct domain (so you can adopt the domain) of this domain list or the Nullpointer NULL if non such exists;
cDomain* fib::cDomains::getDirectDomainForElement ( const cTypeElement type) const

This method returns the direct domain for the given type in the domain list, without evaluating it. Since some domains (ie cDomainReference) are evalued by methods like getDomainForElement(), this method will return the domain directly without evaluing it.

See also:
getDomain()
getDomainForElement()
Parameters:
typethe type for which the domain is to return
Returns:
a reference to the direct domain (so you can adopt the domain) of the gifen type of this domain list or the Nullpointer NULL if non such exists;
cDomain* fib::cDomains::getDomain ( unsignedIntFib  iDomainNumber) const

This method returns the domain on the given position iDomainNumber in the domain list. If the domain on the position is a reference domain

See also:
cDomainReference the domain to which it is refered to will be returned.
Parameters:
iDomainNumberthe position on which the domain to return stands in the domain list (the counting begins with 1)
Returns:
a reference to the iDomainNumber'th domain (so you can adopt the domain) of this domain list or the Nullpointer NULL if non such exists;
cDomain* fib::cDomains::getDomainForElement ( const cTypeElement type) const

This method returns the domain for the given type from the domain list. If the domain for the type is a reference domain

See also:
cDomainReference the domain to which it is refered to will be returned.
Parameters:
typethe type for which the domain is to return
Returns:
a reference to the domain (so you can adopt the domain) of this domain list for elements of the given type or the Nullpointer NULL if non such exists;
cDomain* fib::cDomains::getDomainForReferenceDomain ( cDomainReference pDomainReference,
cTypeElement pTypeElementForWhich = NULL 
) const

This method returns the domain to which the given reference domain refers to. If no domain to which it is refered can be found the standard domain for the pDomainReference type will be returned.

Parameters:
pDomainReferencereference domain for which the domain is to be returned
pTypeElementForWhicha pointer to the type element for which the domain should be
Returns:
a pointer to the domain (so you can adopt the domain) for the reference domain or the Nullpointer NULL if non such exists
unsignedIntFib fib::cDomains::getNumberOfDomains ( ) const
Returns:
the number of domains in the domain list
cTypeElement* fib::cDomains::getType ( unsignedIntFib  iTypeNumber) const

This method returns the type on the given position iTypeNumber in the domain list.

Parameters:
iTypeNumberthe position on which the type to return stands in the domain list (the counting begins with 1)
Returns:
a reference to the iTypeNumber'th type of this domain list or the Nullpointer NULL if non such exists;
virtual cDomains& fib::cDomains::operator= ( const cDomains domains)
virtual

This operator makes this domains equal to the given domains.

Parameters:
domainsthe domains to which this should be equal
Returns:
a refernce to this domain
virtual bool fib::cDomains::operator== ( const cDomains domains) const
virtual

This method checks if the given domains is equal to this domains.

Parameters:
domainsthe domains to compare with this
Returns:
true if the given domains is equal to this domains, else false
virtual intFib fib::cDomains::restore ( cReadBits iBitStream)
virtual

This method restores the domains from a bitstream, wher it is stored in the compressed fib -format.

See also:
store
cFibElement::store
Parameters:
iBitStreamthe stream where this domains is stored in, because this stream is an cReadBits, any number of bits can be readed from it
Returns:
the errorvalue 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
virtual intFib fib::cDomains::restoreXml ( const TiXmlElement *  pXmlElement)
virtual

This method restores this optionalpart in the XML -format from an an TinyXml element.

Parameters:
pXmlNodea pointer to the TinyXml node wher the domains are stored in
Returns:
an integervalue with the errorvalue 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
unsignedIntFib fib::cDomains::setStandardDomain ( const cTypeElement type)

This method sets the domain for the given type to the standarddomain of the type. If no entry for the type exists, an entry is added.

Parameters:
typethe type for which the domain is to set to the standarddomain
Returns:
the number of the position on which the type stands in the domain list
virtual bool fib::cDomains::store ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
virtual

This method stores this domains in the compressed Fib -format into the given stream. It is needed because 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:
cFibElement::store
Parameters:
streamthe stream where this domains 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 the domains are stored, else false
virtual bool fib::cDomains::storeXml ( ostream &  ostream,
string  szName = string("domains") 
) const
virtual

This method stores this domains in the XML -format into the given stream.

Parameters:
ostreamthe stream where domains should be stored to
szNamethe name the writen XML -element should have
Returns:
true if this domains are stored, else false

Member Data Documentation

list<cDomainElement> fib::cDomains::domainElements
protected

the list with the domains for this domain list

Definition at line 74 of file cDomains.h.

cDomainIntegerBit fib::cDomains::standardDomain
mutableprotected

The standard domain when no other domain is aviable. (not mutable: cDomainIntegerBit can't be changed ;) )

Definition at line 82 of file cDomains.h.

list<cDomainElement> fib::cDomains::standardDomains
mutableprotected

A map with the standard domains which wher created for returning a domain reference.

Definition at line 88 of file cDomains.h.


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