}
Versatile::Versatile(const Versatile & V)
- : _discriminator(V._discriminator),
- _maxsize(V._maxsize),
- _name(V._name)
+ : list(),
+ _discriminator(V._discriminator),
+ _maxsize(V._maxsize),
+ _name(V._name)
{
Versatile::const_iterator it;
for(it=V.begin(); it!=V.end(); it++)
eraseAll();
}
- Versatile & Versatile::operator = (const long l) throw(TypeMismatchException)
+ Versatile & Versatile::operator = (const long l)
{
checkType(LONG);
eraseAll();
return *this;
}
- Versatile & Versatile::operator = (const string & ch) throw(TypeMismatchException)
+ Versatile & Versatile::operator = (const string & ch)
{
checkType(STRING);
eraseAll();
return *this;
}
- Versatile & Versatile::operator +=(const string & ch) throw(TypeMismatchException,ListIsFullException)
+ Versatile & Versatile::operator +=(const string & ch)
{
checkType(STRING);
return *this;
}
- Versatile & Versatile::operator , (const string & ch) throw(TypeMismatchException,ListIsFullException)
+ Versatile & Versatile::operator , (const string & ch)
{
*this += ch;
return *this;
}
- Versatile & Versatile::operator = (const char * ch) throw(TypeMismatchException)
+ Versatile & Versatile::operator = (const char * ch)
{
return operator=(string(ch));
}
- Versatile & Versatile::operator +=(const char * ch) throw(TypeMismatchException,ListIsFullException)
+ Versatile & Versatile::operator +=(const char * ch)
{
return operator+=(string(ch));
}
- Versatile & Versatile::operator , (const char * ch) throw(TypeMismatchException,ListIsFullException)
+ Versatile & Versatile::operator , (const char * ch)
{
return operator,(string(ch));
}
- Versatile & Versatile::operator = (const Couple & cp) throw(TypeMismatchException)
+ Versatile & Versatile::operator = (const Couple & cp)
{
checkType(COUPLE);
eraseAll();
return *this;
}
- Versatile & Versatile::operator +=(const Couple & cp) throw(TypeMismatchException,ListIsFullException)
+ Versatile & Versatile::operator +=(const Couple & cp)
{
checkType(COUPLE);
// If max size is reached, throw a ListIsFullException
return *this;
}
- Versatile & Versatile::operator , (const Couple & cp) throw(TypeMismatchException,ListIsFullException)
+ Versatile & Versatile::operator , (const Couple & cp)
{
*this += cp;
return *this;
return os;
}
- Versatile & Versatile::operator = (const int i) throw(TypeMismatchException)
+ Versatile & Versatile::operator = (const int i)
{
checkType(LONG);
eraseAll();
return *this;
}
- Versatile & Versatile::operator = (const bool b) throw(TypeMismatchException)
+ Versatile & Versatile::operator = (const bool b)
{
checkType(BOOL);
eraseAll();
return *this;
}
- void Versatile::checkType(DiscriminatorType t) const throw(TypeMismatchException)
+ void Versatile::checkType(DiscriminatorType t) const
{
if (_discriminator != t)
throw (TypeMismatchException("Trying to change type of Versatile object \"" + _name + "\""));
}
- Versatile::operator long() const throw(TypeMismatchException)
+ Versatile::operator long() const
{
// If the type does not correspond or if the list has more than one element,
// throw a TypeMismatchException
return *( static_cast<LongType *>(this->front()) );
}
- Versatile::operator bool() const throw(TypeMismatchException)
+ Versatile::operator bool() const
{
// If the type does not correspond or if the list has more than one element,
// throw a TypeMismatchException
return *( static_cast<BoolType *>(this->front()) );
}
- Versatile::operator int() const throw(TypeMismatchException)
+ Versatile::operator int() const
{
return operator long();
}
- Versatile::operator Couple() const throw(TypeMismatchException)
+ Versatile::operator Couple() const
{
// If the type does not correspond or if the list has more than one element,
// throw a TypeMismatchException
return *( static_cast<CoupleType *>(this->front()) );
}
- string Versatile::str() const throw(TypeMismatchException)
+ string Versatile::str() const
{
// If the type does not correspond, throw a TypeMismatchException
if ( _discriminator != STRING || size() == 0 ) {
return s;
}
- Versatile::operator string () const throw(TypeMismatchException)
+ Versatile::operator string () const
{
return str();
}