#include <MixtureServer.h>
List of all members.
Public Member Functions |
| | MixtureServer (const Config &config) |
| | MixtureServer (const FileName &f, const Config &c) |
| virtual | ~MixtureServer () |
| void | reset () |
| Distrib & | createDistrib () |
| Distrib & | createDistrib (const DistribType type, unsigned long vectSize) |
| Distrib & | duplicateDistrib (const Distrib &d) |
| Mixture & | createMixture () |
| Mixture & | createMixture (unsigned long dc) |
| Mixture & | createMixture (unsigned long dc, DistribType) |
| Mixture & | duplicateMixture (const Mixture &mix, DuplDistrib=DUPL_DISTRIB) |
| Distrib & | getDistrib (unsigned long index) const |
| Mixture & | getMixture (unsigned long index) const |
| void | setDistribToMixture (Mixture &mix, Distrib &distr, weight_t w, unsigned long index) |
| void | addDistribToMixture (Mixture &mix, Distrib &distr, weight_t w=0.0) |
| void | deleteMixtures (unsigned long f, unsigned long l) |
| void | deleteMixture (const Mixture &m) |
| void | deleteUnusedDistribs () |
| DistribGD & | createDistribGD () |
| DistribGF & | createDistribGF () |
| DistribGD & | duplicateDistrib (const DistribGD &d) |
| DistribGF & | duplicateDistrib (const DistribGF &d) |
| MixtureGD & | createMixtureGD () |
| MixtureGF & | createMixtureGF () |
| MixtureGD & | createMixtureGD (unsigned long dc) |
| MixtureGF & | createMixtureGF (unsigned long dc) |
| MixtureGD & | duplicateMixture (const MixtureGD &mix, DuplDistrib=DUPL_DISTRIB) |
| MixtureGF & | duplicateMixture (const MixtureGF &mix, DuplDistrib=DUPL_DISTRIB) |
| MixtureGD & | duplicateMixtureGD (const Mixture &mix, DuplDistrib=DUPL_DISTRIB) |
| MixtureGF & | duplicateMixtureGF (const Mixture &mix, DuplDistrib=DUPL_DISTRIB) |
| DistribGD & | getDistribGD (unsigned long index) const |
| DistribGF & | getDistribGF (unsigned long index) const |
| MixtureGD & | getMixtureGD (unsigned long index) const |
| MixtureGF & | getMixtureGF (unsigned long index) const |
| Mixture & | loadMixture (const FileName &f) |
| MixtureGD & | loadMixtureGD (const FileName &f) |
| MixtureGF & | loadMixtureGF (const FileName &f) |
| void | loadMixture (Mixture &m, const FileName &f) |
| unsigned long | loadMixture (const XLine &l) |
| unsigned long | getDistribCount () const |
| unsigned long | getVectSize () const |
| unsigned long | getMixtureCount () const |
| long | getMixtureIndex (const String &id) const |
| void | setMixtureId (Mixture &mix, const String &id) |
| const String & | getServerName () const |
| void | setServerName (const String &) |
| void | load (const FileName &f) |
| void | save (const FileName &f) const |
| virtual String | getClassName () const |
| virtual String | toString () const |
Private Member Functions |
| void | addDistribToDict (Distrib &) |
| void | addMixtureToDict (Mixture &) |
| String | newId () |
| Mixture & | loadMixture (const FileName &f, DistribType) |
| void | autoSetMixtureId (Mixture &m, String id) |
| | MixtureServer (const MixtureServer &m) |
| const MixtureServer & | operator= (const MixtureServer &) |
| bool | operator== (const MixtureServer &) |
| bool | operator!= (const MixtureServer &) |
Private Attributes |
| const Config & | _config |
| String | _serverName |
| DistribRefVector | _distribDict |
| MixtureDict | _mixtureDict |
| unsigned long | _lastMixtureId |
| unsigned long | _vectSize |
| bool | _vectSizeDefined |
Friends |
| class | TestMixtureServer |
Detailed Description
Class used to store and manage Mixture and Distrib objects. This class is responsible for creating and deleting these objects. Both mixtures and distributions can be accessed by an index. Mixtures can share the same distributions. In addition, mixtures can be found using the identifier. Each mixture identifier is unique.
- Author:
- Frederic Wils frederic.wils@lia.univ-avignon.fr
- Version:
- 1.0
- Date:
- 2003
Definition at line 92 of file MixtureServer.h.
Constructor & Destructor Documentation
| alize::MixtureServer::MixtureServer |
( |
const Config & |
config ) |
[explicit] |
Creates a MixtureServer object
- Parameters:
-
| config | parameters to build the server. |
| alize::MixtureServer::MixtureServer |
( |
const FileName & |
f, |
|
|
const Config & |
c |
|
) |
| [explicit] |
Creates a MixtureServer object and load data from a file
- Parameters:
-
| f | name of the file. |
| c | configuration |
- Exceptions:
-
| virtual alize::MixtureServer::~MixtureServer |
( |
) |
[virtual] |
| alize::MixtureServer::MixtureServer |
( |
const MixtureServer & |
m ) |
[private] |
Member Function Documentation
| void alize::MixtureServer::addDistribToDict |
( |
Distrib & |
) |
[private] |
Adds a distribution to a mixture. The number of distributions increases by 1 for the mixture.
- Parameters:
-
| mix | the mixture |
| distr | the distribution to add |
| w | weight of the distribution |
| void alize::MixtureServer::addMixtureToDict |
( |
Mixture & |
) |
[private] |
| void alize::MixtureServer::autoSetMixtureId |
( |
Mixture & |
m, |
|
|
String |
id |
|
) |
| [private] |
| Distrib& alize::MixtureServer::createDistrib |
( |
) |
|
Creates a new distribution. The type and other parameters are specified in the configuration of the server
- Returns:
- a reference to the distribution
| Distrib& alize::MixtureServer::createDistrib |
( |
const DistribType |
type, |
|
|
unsigned long |
vectSize |
|
) |
| |
Creates a new distribution
- Parameters:
-
| type | distribution type |
| vectSize | |
- Returns:
- a reference to the distribution
| DistribGD& alize::MixtureServer::createDistribGD |
( |
) |
|
Creates a new distribution GD and adds it to the internal dictionnary of the server
- Returns:
- a reference to the distribution
| DistribGF& alize::MixtureServer::createDistribGF |
( |
) |
|
Creates a new distribution GF and adds it to the internal dictionnary of the server
- Returns:
- a reference to the distribution
| Mixture& alize::MixtureServer::createMixture |
( |
) |
|
Creates a new mixture inside the server. The type and the number of distributions must be defined in the configuration of the server. A default identifier "#n" is set where n is a number.
- Returns:
- a reference to the mixture
| Mixture& alize::MixtureServer::createMixture |
( |
unsigned long |
dc ) |
|
Creates a new mixture inside the server. The type must be defined in the configuration of the server. A default identifier "#n" is set where n is a number.
- Parameters:
-
| dc | the number of distribution to create for this mixture. |
- Returns:
- a reference to the mixture
Creates a new mixture inside the server. A default identifier "#n" is set where n is a number.
- Parameters:
-
| dc | the number of distribution to create for this mixture. |
| type | distribution type |
- Returns:
- a reference to the mixture
| MixtureGD& alize::MixtureServer::createMixtureGD |
( |
) |
|
Creates a new mixture GD inside the server. The number of distributions must be specified in the configuration of the server. A default identifier "#n" is set where n is a number.
- Returns:
- a reference to the mixture GD
- Exceptions:
-
| MixtureGD& alize::MixtureServer::createMixtureGD |
( |
unsigned long |
dc ) |
|
Creates a new mixture GD inside the server. The type must be defined in the configuration of the server. A default identifier "#n" is set where n is a number.
- Parameters:
-
| dc | the number of distribution to create for this mixture. |
- Returns:
- a reference to the mixture GD
| MixtureGF& alize::MixtureServer::createMixtureGF |
( |
) |
|
Creates a new mixture GF inside the server. The number of distributions must be specified in the configuration of the server. A default identifier "#n" is set where n is a number.
- Returns:
- a reference to the mixture GF
- Exceptions:
-
| MixtureGF& alize::MixtureServer::createMixtureGF |
( |
unsigned long |
dc ) |
|
Creates a new mixture GF inside the server. The type must be defined in the configuration of the server. A default identifier "#n" is set where n is a number.
- Parameters:
-
| dc | the number of distribution to create for this mixture. |
- Returns:
- a reference to the mixture GF
| void alize::MixtureServer::deleteMixture |
( |
const Mixture & |
m ) |
|
Deletes a mixture
- Warning:
- Does not delete associated distributions. Use method deleteUnusedDistribs()
- Parameters:
-
| void alize::MixtureServer::deleteMixtures |
( |
unsigned long |
f, |
|
|
unsigned long |
l |
|
) |
| |
Deletes a set of mixtures.
- Warning:
- Does not delete associated distributions. Use method deleteUnusedDistribs()
- Parameters:
-
| f | index of the first mixture |
| l | index of the last mixture |
| void alize::MixtureServer::deleteUnusedDistribs |
( |
) |
|
Removes all unused distributions (unreferenced by a mixture)
Duplicates an existing distribution GD. The new one is added to the internal dictionnary
- Parameters:
-
| d | the distribution to copy |
- Returns:
- a reference to the new distribution GD
Duplicates an existing distribution GF. The new one is added to the internal dictionnary
- Parameters:
-
| d | the distribution to copy |
- Returns:
- a reference to the new distribution GF
Duplicates an existing distribution. The new one is added to the internal dictionnary
- Parameters:
-
| d | the distribution to copy |
- Returns:
- a reference to the new distribution
Duplicates inside the server an existing mixture. Distributions can be duplicated too. If they are not, the new mixture and the original one share the same distributions. The new mixture identifier is equal to the original mixture identifier followed by " #n" where n is a number
- Parameters:
-
| mix | the mixture to duplicate. |
| duplicateDistrib | DUPL_DISTRIB to duplicate the distributions; SHARE_DISTRIB to share the existing distributions. Default = DUPL_DISTRIB. |
- Returns:
- a reference to the new mixture
Duplicates inside the server an existing mixture GD. Distributions can be duplicated too. If they are not, the new mixture and the original one share the same distributions. The new mixture identifier is equal to the original mixture identifier followed by "#n" where n is a number
- Parameters:
-
| mix | the mixture GD to duplicate. |
| duplicateDistrib | DUPL_DISTRIB to duplicate the distributions; SHARE_DISTRIB to share the existing distributions. Default = DUPL_DISTRIB. |
- Returns:
- a reference to the new mixture GD
Duplicates inside the server an existing mixture GF. Distributions can be duplicated too. If they are not, the new mixture and the original one share the same distributions. The new mixture identifier is equal to the original mixture identifier followed by "#n" where n is a number
- Parameters:
-
| mix | the mixture GF to duplicate. |
| duplicateDistrib | DUPL_DISTRIB to duplicate the distributions; SHARE_DISTRIB to share the existing distributions. Default = DUPL_DISTRIB. |
- Returns:
- a reference to the new mixture GF
Duplicates inside the server an existing mixture GD. Distributions can be duplicated too. If they are not, the new mixture and the original one share the same distributions. The new mixture identifier is equal to the original mixture identifier followed by "#n" where n is a number
- Parameters:
-
| mix | the mixture GD to duplicate. |
| duplicateDistrib | DUPL_DISTRIB to duplicate the distributions; SHARE_DISTRIB to share the existing distributions. Default = DUPL_DISTRIB. |
- Returns:
- a reference to the new mixture GD
Duplicates inside the server an existing mixture GF. Distributions can be duplicated too. If they are not, the new mixture and the original one share the same distributions. The new mixture identifier is equal to the original mixture identifier followed by "#n" where n is a number
- Parameters:
-
| mix | the mixture GF to duplicate. |
| duplicateDistrib | DUPL_DISTRIB to duplicate the distributions; SHARE_DISTRIB to share the existing distributions. Default = DUPL_DISTRIB. |
- Returns:
- a reference to the new mixture GF
| virtual String alize::MixtureServer::getClassName |
( |
) |
const [virtual] |
Returns the name of the class
- Returns:
- the name of the class of the object as a String
Implements alize::Object.
| Distrib& alize::MixtureServer::getDistrib |
( |
unsigned long |
index ) |
const |
Gets a distribution using its index
- Parameters:
-
- Returns:
- a reference to the distribution
- Exceptions:
-
| unsigned long alize::MixtureServer::getDistribCount |
( |
) |
const |
Returns the number of distributions stored inside the server
- Returns:
- the number of distributions stored inside the server
| DistribGD& alize::MixtureServer::getDistribGD |
( |
unsigned long |
index ) |
const |
Gets a distribution GD using its index
- Parameters:
-
- Returns:
- a reference to the distribution
- Exceptions:
-
| DistribGF& alize::MixtureServer::getDistribGF |
( |
unsigned long |
index ) |
const |
Gets a distribution GF using its index
- Parameters:
-
- Returns:
- a reference to the distribution
- Exceptions:
-
| Mixture& alize::MixtureServer::getMixture |
( |
unsigned long |
index ) |
const |
Gets a mixture using its index
- Parameters:
-
- Returns:
- a reference to the mixture
- Exceptions:
-
| unsigned long alize::MixtureServer::getMixtureCount |
( |
) |
const |
Returns the number of mixtures stored inside the server
- Returns:
- the number of mixtures stored inside the server
| MixtureGD& alize::MixtureServer::getMixtureGD |
( |
unsigned long |
index ) |
const |
Gets a mixture GD using its index
- Parameters:
-
- Returns:
- a reference to the mixture
- Exceptions:
-
| MixtureGF& alize::MixtureServer::getMixtureGF |
( |
unsigned long |
index ) |
const |
Gets a mixture GF using its index
- Parameters:
-
- Returns:
- a reference to the mixture
- Exceptions:
-
| long alize::MixtureServer::getMixtureIndex |
( |
const String & |
id ) |
const |
Tests whether a mixture with a particular identifier exists inside the server
- Parameters:
-
- Returns:
- the index of the mixture if it exists; -1 otherwise
| const String& alize::MixtureServer::getServerName |
( |
) |
const |
| unsigned long alize::MixtureServer::getVectSize |
( |
) |
const |
Returns the vectSize value
- Returns:
- the vectSize value
- Exceptions:
-
| Exception | if neither mixture nor distribution is stored (no vectSize defined) |
| void alize::MixtureServer::load |
( |
const FileName & |
f ) |
|
Loads a mixture server from a file File naming rules are the same as mixture file.
- Parameters:
-
- Exceptions:
-
Creates a new mixture in the server and loads data from a file
- Parameters:
-
| f | the mixture file to read |
- Returns:
- a reference to the mixture
- Exceptions:
-
Loads data from a mixture file into an existing mixture
- Parameters:
-
- Exceptions:
-
| unsigned long alize::MixtureServer::loadMixture |
( |
const XLine & |
l ) |
|
Loads mixtures from a list of single mixture file
- Parameters:
-
| l | the list of mixture file to read |
- Returns:
- the index of the first mixture loaded in the server
- Exceptions:
-
Creates a new mixtureGD in the server and loads data from a file
- Parameters:
-
| f | the mixture file to read |
- Returns:
- a reference to the mixture
- Exceptions:
-
Creates a new mixtureGF in the server and loads data from a file
- Parameters:
-
| f | the mixture file to read |
- Returns:
- a reference to the mixture
- Exceptions:
-
| String alize::MixtureServer::newId |
( |
) |
[private] |
| bool alize::MixtureServer::operator!= |
( |
const MixtureServer & |
) |
[private] |
| bool alize::MixtureServer::operator== |
( |
const MixtureServer & |
) |
[private] |
| void alize::MixtureServer::reset |
( |
) |
|
Deletes all mixtures and distributions inside the server.
| void alize::MixtureServer::save |
( |
const FileName & |
f ) |
const |
Saves a mixture server into a file File naming rules are the same as mixture file.
- Parameters:
-
- Exceptions:
-
| void alize::MixtureServer::setDistribToMixture |
( |
Mixture & |
mix, |
|
|
Distrib & |
distr, |
|
|
weight_t |
w, |
|
|
unsigned long |
index |
|
) |
| |
Assigns a distribution to a mixture instead of an other distribution. The number of distributions is not changed in the mixture.
- Parameters:
-
| mix | the mixture |
| distr | the distribution to set in the mixture |
| w | weight of the distribution |
| index | index of the distribution inside the mixture |
- Exceptions:
-
| void alize::MixtureServer::setMixtureId |
( |
Mixture & |
mix, |
|
|
const String & |
id |
|
) |
| |
Sets the identifier of a mixture
- Parameters:
-
- Exceptions:
-
| void alize::MixtureServer::setServerName |
( |
const String & |
) |
|
| virtual String alize::MixtureServer::toString |
( |
) |
const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
- Returns:
- a description of the object
Reimplemented from alize::Object.
Friends And Related Function Documentation
friend class TestMixtureServer [friend] |
Member Data Documentation
The documentation for this class was generated from the following file: