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

alize::XLine Class Reference

#include <XLine.h>

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

List of all members.

Public Member Functions

 XLine ()
 XLine (const XLine &)
XLineduplicate () const
const XLineoperator= (const XLine &c)
bool operator== (const XLine &c) const
bool operator!= (const XLine &c) const
virtual ~XLine ()
XLineaddElement (const String &e)
void deleteElement (const String &e)
void rewind () const
StringgetElement (const unsigned long idx, const bool becomeCurrent=true) const
StringgetElement () const
const XLinegetElements () const
long getIndex (const String &e) const
unsigned long getElementCount () const
void reset ()
virtual String toString () const
virtual String getClassName () const

Static Public Member Functions

static XLinecreate ()
static XLinecreate (String &key, String &value)

Private Attributes

RefVector< String_vector
unsigned long _current
XLine_pLine

Friends

class TestXLine

Detailed Description

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

Definition at line 79 of file XLine.h.


Constructor & Destructor Documentation

XLine::XLine (  )

Create en empty line

Definition at line 65 of file XLine.cpp.

Referenced by create(), and duplicate().

XLine::XLine ( const XLine l )
XLine::~XLine (  ) [virtual]

Definition at line 191 of file XLine.cpp.

References _pLine, _vector, alize::RefVector< T >::deleteAllObjects(), and NULL.


Member Function Documentation

XLine & XLine::addElement ( const String e )

Adds a new element at the end of the line. The element become the current element

Returns:
this line

Definition at line 167 of file XLine.cpp.

References _current, _vector, alize::RefVector< T >::addObject(), and alize::String::duplicate().

Referenced by alize::CmdLine::CmdLine(), create(), alize::XList::getAllElements(), operator=(), alize::XListFileReader::readList(), alize::Matrix< T >::saveDT(), and alize::Config::setParam().

XLine & XLine::create ( String key,
String value 
) [static]

Create a line with key / value - richard.dufour@lium.univ-lemans.fr

Definition at line 77 of file XLine.cpp.

References addElement(), create(), and rewind().

XLine & XLine::create (  ) [static]

Create en empty line

Definition at line 68 of file XLine.cpp.

References alize::Object::assertMemoryIsAllocated(), and XLine().

Referenced by create(), and getElements().

void XLine::deleteElement ( const String e )

Removes and deletes an element

Parameters:
ethe element to delete

Definition at line 124 of file XLine.cpp.

References _vector, and alize::RefVector< T >::removeObject().

XLine & XLine::duplicate (  ) const

Definition at line 93 of file XLine.cpp.

References alize::Object::assertMemoryIsAllocated(), and XLine().

Referenced by alize::XList::operator=(), and alize::XList::XList().

String XLine::getClassName (  ) const [virtual]

Returns the name of the class

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

Implements alize::Object.

Definition at line 181 of file XLine.cpp.

String & XLine::getElement ( const unsigned long  idx,
const bool  becomeCurrent = true 
) const
String * XLine::getElement (  ) const

Gets the current element. The next element become the current element

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

Definition at line 148 of file XLine.cpp.

References _current, _vector, alize::RefVector< T >::getObject(), NULL, and alize::RefVector< T >::size().

unsigned long XLine::getElementCount (  ) const
const XLine & XLine::getElements (  ) const

Gets the elements from the current element to the last one. The current element does not change.

Returns:
a reference to a constant XLine object.

Definition at line 156 of file XLine.cpp.

References _current, _pLine, _vector, alize::RefVector< T >::addObject(), create(), alize::String::duplicate(), alize::RefVector< T >::getObject(), NULL, reset(), and alize::RefVector< T >::size().

long XLine::getIndex ( const String e ) const

Returns the index of an element

Parameters:
ethe element to search
Returns:
the index of the element if it exists; -1 otherwise

Definition at line 139 of file XLine.cpp.

References _vector, alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().

bool XLine::operator!= ( const XLine c ) const

Definition at line 122 of file XLine.cpp.

const XLine & XLine::operator= ( const XLine c )
bool XLine::operator== ( const XLine c ) const
void XLine::reset (  )

Removes all elements

Definition at line 173 of file XLine.cpp.

References _current, _vector, and alize::RefVector< T >::deleteAllObjects().

Referenced by alize::XList::getAllElements(), getElements(), and operator=().

void XLine::rewind (  ) const

Sets the first element to become the current element

Definition at line 127 of file XLine.cpp.

References _current.

Referenced by create(), alize::XList::getLine(), and alize::XListFileReader::readList().

String XLine::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.

Definition at line 183 of file XLine.cpp.

References _vector, alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().


Friends And Related Function Documentation

friend class TestXLine [friend]

Definition at line 81 of file XLine.h.


Member Data Documentation

unsigned long alize::XLine::_current [mutable, private]

Definition at line 159 of file XLine.h.

Referenced by addElement(), getElement(), getElements(), operator=(), reset(), and rewind().

XLine* alize::XLine::_pLine [mutable, private]

Definition at line 160 of file XLine.h.

Referenced by getElements(), and ~XLine().


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