Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

alize::SegCluster Class Reference

#include <SegCluster.h>

Inheritance diagram for alize::SegCluster:
Inheritance graph
[legend]
Collaboration diagram for alize::SegCluster:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~SegCluster ()
virtual unsigned long begin () const
virtual unsigned long length () const
void add (SegAbstract &s)
void add (SegAbstract &s, unsigned long pos)
SegaddCopy (const Seg &s)
SegaddCopy (const Seg &s, unsigned long pos)
SegaddNewSeg (unsigned long b=0, unsigned long l=0, unsigned long lc=0, const String &s="", const String &sn="")
void remove (SegAbstract &s)
SegAbstractremove (unsigned long idx)
void removeAll ()
SegAbstractget (unsigned long i) const
bool getFeatureLabelCode (unsigned long n, unsigned long &lc, bool &isFirst, bool &isLast) const
bool getFeatureLabelCode (unsigned long n, unsigned long &lc) const
unsigned long getCount () const
virtual SeggetSeg () const
unsigned long getId () const
virtual void rewind () const
virtual String getClassName () const
virtual String toString () const
SegClusterduplicate (const K &, SegServer &) const
void setId (const K &, unsigned long id)
virtual void getExtremeBoundaries (const K &, unsigned long &b, unsigned long &e, bool &isDefined) const

Static Public Member Functions

static SegClustercreate (const K &, SegServer &ss, unsigned long lc=0, const String &s="", const String &sn="")

Private Member Functions

 SegCluster (SegServer &ss, unsigned long lc=0, const String &s="", const String &sn="")
 SegCluster (const SegCluster &)
const SegClusteroperator= (const SegCluster &c)
bool operator== (const SegCluster &c) const
bool operator!= (const SegCluster &c) const

Private Attributes

RefVector< SegAbstract_vect
unsigned long _id
SegAbstract_pCurrentSubSeg
Seg_pCurrentSeg
Seg_pStartSeg
unsigned long _b
unsigned long _e
unsigned long _lc

Friends

class TestSegCluster
class TestSegServer

Detailed Description

Class for a hierarchical cluster of segments.

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2004

Definition at line 81 of file SegCluster.h.


Constructor & Destructor Documentation

C::~SegCluster (  ) [virtual]

Definition at line 285 of file SegCluster.cpp.

C::SegCluster ( SegServer ss,
unsigned long  lc = 0,
const String s = "",
const String sn = "" 
) [explicit, private]

Definition at line 69 of file SegCluster.cpp.

References rewind().

alize::SegCluster::SegCluster ( const SegCluster  ) [private]

Member Function Documentation

void C::add ( SegAbstract s )

Adds a segment or sub-cluster to a cluster

Parameters:
sthe segment or sub-cluster to add

Definition at line 142 of file SegCluster.cpp.

References alize::SegAbstract::addOwner(), alize::SegAbstract::getServer(), and alize::K::k.

Referenced by alize::SegServer::assign().

void C::add ( SegAbstract s,
unsigned long  pos 
)

Adds a segment or sub-cluster to this cluster at a particular position

Parameters:
sthe segment or sub-cluster to add
posthe position of the added object

Definition at line 150 of file SegCluster.cpp.

References alize::SegAbstract::addOwner(), alize::SegAbstract::getServer(), and alize::K::k.

Seg & C::addCopy ( const Seg s )

Creates a new segment copying an existing segment and adds it to this cluster

Parameters:
sthe segment to copy
Returns:
the new segment

Definition at line 158 of file SegCluster.cpp.

References alize::SegAbstract::addOwner(), and alize::K::k.

Seg & C::addCopy ( const Seg s,
unsigned long  pos 
)

Creates a new segment copying an existing segment and adds it to this cluster

Parameters:
sthe segment to copy
posthe position of the new segment
Returns:
the new segment

Definition at line 166 of file SegCluster.cpp.

References alize::SegAbstract::addOwner(), and alize::K::k.

Seg & C::addNewSeg ( unsigned long  b = 0,
unsigned long  l = 0,
unsigned long  lc = 0,
const String s = "",
const String sn = "" 
)

Creates a new segment and adds it to this cluster

Parameters:
b= begin : number of the first feature
l= length : count of features
lc= label code
s= a free string
sn= source name (free). Ex: file name
Returns:
a reference to the new segment

Definition at line 174 of file SegCluster.cpp.

References alize::SegAbstract::addOwner(), and alize::K::k.

unsigned long C::begin (  ) const [virtual]

Recherche dans le cluster le segment dont le numéro de 1ere trame (begin) est le plus petit parmis tous les segments du cluster et retourne ce numéro. Cette fonction nécessite de parcourir tous les segments donc est couteuse en temps.

Returns:
see description

Implements alize::SegAbstract.

Definition at line 122 of file SegCluster.cpp.

References alize::K::k.

SegCluster & C::create ( const K ,
SegServer ss,
unsigned long  lc = 0,
const String s = "",
const String sn = "" 
) [static]

Definition at line 73 of file SegCluster.cpp.

SegCluster & C::duplicate ( const K ,
SegServer ss 
) const

Definition at line 85 of file SegCluster.cpp.

References alize::K::k, and alize::SegAbstract::list().

Referenced by alize::SegServer::assign().

SegAbstract & C::get ( unsigned long  i ) const

Returns the segment or sub-clusters at the position i

Parameters:
ithe position of the object to get
Returns:
the object found as a SegAbstract object. To know if it is a Seg or a SegCluster, use a cast operator (quick method) or call getClassName() (slow method)

Definition at line 206 of file SegCluster.cpp.

Referenced by alize::SegServer::assign().

String C::getClassName (  ) const [virtual]

Returns the name of the class

Returns:
the name of the class of the object as a String

Implements alize::SegAbstract.

Definition at line 267 of file SegCluster.cpp.

unsigned long C::getCount (  ) const

Returns the number of segments or clusters contained in this cluster.

Returns:
the number of segments or clusters contained in this cluster.

Definition at line 204 of file SegCluster.cpp.

Referenced by alize::SegServer::assign().

void C::getExtremeBoundaries ( const K ,
unsigned long &  b,
unsigned long &  e,
bool &  isDefined 
) const [virtual]

Implements alize::SegAbstract.

Definition at line 260 of file SegCluster.cpp.

References alize::K::k.

bool C::getFeatureLabelCode ( unsigned long  n,
unsigned long &  lc,
bool &  isFirst,
bool &  isLast 
) const

Recherche dans le cluster le 1er segment qui contient une feature (identifiée par son n°) et renvoi true s'il existe. La méthode parcours tous les segments du cluster et regarde si begin >= n°feature < begin + length
Après appel de la méthode, la variable lc contient le code label du segment trouvé.
De plus, les booléens first et last permettent de savoir si la feature est la dernière du segment ou la première METHODE PROVISOIRE. Sera remplacé par une méthode qui accepte directement pour paramètre une feature (Feature&) et non plus le n° de la feature

Parameters:
nfeature number
lca variable to store the label code
isFirsta boolean to indicate that the feature is or is not the first inside the segment
isLasta boolean to indicate that the feature is or is not the last inside the segment
Returns:
true if a segment was find; false otherwise

Definition at line 219 of file SegCluster.cpp.

References NULL.

bool C::getFeatureLabelCode ( unsigned long  n,
unsigned long &  lc 
) const

Like other same-name method but without needing parameters isFirst and isLast METHODE PROVISOIRE. Sera remplacé par une méthode qui accepte directement pour paramètre une feature (Feature&) et non plus le n° de la feature

Parameters:
nfeature number
lca variable to store the label code
Returns:
true if a segment was find; false otherwise

Definition at line 208 of file SegCluster.cpp.

References NULL.

unsigned long C::getId (  ) const

Returns the id (unique) of the cluster

Returns:
the id (unique) of the cluster

Definition at line 92 of file SegCluster.cpp.

Referenced by alize::SegServer::assign(), alize::SegServer::remove(), and alize::SegServer::setClusterId().

Seg * C::getSeg (  ) const [virtual]

Gets the next segment (sequential read). Reads all the segment of a cluster and sub-clusters.
See method getSeg()

Returns:
a pointer to the segment if it exists; NULL otherwise

Implements alize::SegAbstract.

Definition at line 102 of file SegCluster.cpp.

References alize::Seg::getSeg(), and NULL.

unsigned long C::length (  ) const [virtual]

Retourne le nombre de features du cluster par différence entre la 1ere feature (méthode begin()) et la dernière (même principe que la méthode begin()).

Warning:
La méthode ne vérifie pas si les segments sont contiguës.
Returns:
see description

Implements alize::SegAbstract.

Definition at line 132 of file SegCluster.cpp.

References alize::K::k.

bool alize::SegCluster::operator!= ( const SegCluster c ) const [private]
const SegCluster& alize::SegCluster::operator= ( const SegCluster c ) [private]
bool alize::SegCluster::operator== ( const SegCluster c ) const [private]
void C::remove ( SegAbstract s )

Removes a segment or sub-cluster from this cluster

Parameters:
sthe segment or sub-cluster to add

Definition at line 183 of file SegCluster.cpp.

References alize::K::k, and alize::SegAbstract::removeOwner().

SegAbstract & C::remove ( unsigned long  idx )

Removes a segment or sub-cluster from this cluster by it's index

Parameters:
idxthe index

Definition at line 189 of file SegCluster.cpp.

References alize::K::k, and alize::SegAbstract::removeOwner().

void C::removeAll (  )

Removes all components of this cluster

Definition at line 197 of file SegCluster.cpp.

References alize::K::k.

Referenced by alize::SegServer::remove().

void C::rewind (  ) const [virtual]

Sets the first segment to become the current segment (sequential read)

Reimplemented from alize::SegAbstract.

Definition at line 96 of file SegCluster.cpp.

References NULL.

Referenced by SegCluster().

void C::setId ( const K ,
unsigned long  id 
)
String C::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

Implements alize::SegAbstract.

Definition at line 269 of file SegCluster.cpp.

References alize::Object::toString(), and alize::String::valueOf().


Friends And Related Function Documentation

friend class TestSegCluster [friend]

Reimplemented from alize::SegAbstract.

Definition at line 83 of file SegCluster.h.

friend class TestSegServer [friend]

Reimplemented from alize::SegAbstract.

Definition at line 84 of file SegCluster.h.


Member Data Documentation

unsigned long alize::SegCluster::_b [mutable, private]

Definition at line 250 of file SegCluster.h.

unsigned long alize::SegCluster::_e [mutable, private]

Definition at line 251 of file SegCluster.h.

unsigned long alize::SegCluster::_id [private]

Definition at line 242 of file SegCluster.h.

unsigned long alize::SegCluster::_lc [mutable, private]

Definition at line 252 of file SegCluster.h.

Seg* alize::SegCluster::_pCurrentSeg [mutable, private]

Definition at line 248 of file SegCluster.h.

Definition at line 245 of file SegCluster.h.

Seg* alize::SegCluster::_pStartSeg [mutable, private]

Definition at line 249 of file SegCluster.h.

Definition at line 241 of file SegCluster.h.


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