/** * @file mailbox.cc * @brief Implementation of the Mailbox class. * @author Andreas Aardal Hanssen * @date 2002-2005 */ #include "mailbox.h" #include "message.h" #include using namespace Binc; Mailbox::BaseIterator::BaseIterator(int sqn) { sqnr = sqn; } Mailbox::BaseIterator::~BaseIterator() {} Mailbox::Mailbox() : readOnly(false) {} Mailbox::~Mailbox() {} bool Mailbox::isReadOnly() const { return readOnly; } void Mailbox::setReadOnly(bool readOnly) { this->readOnly = readOnly; } Mailbox::iterator::iterator(BaseIterator &i) : realIterator(i) {} Message &Mailbox::iterator::operator*() { return *realIterator; } void Mailbox::iterator::operator++() { ++realIterator; } bool Mailbox::iterator::operator==(const iterator &i) const { return realIterator == i.realIterator; } bool Mailbox::iterator::operator!=(const iterator &i) const { return realIterator != i.realIterator; } void Mailbox::iterator::erase() { realIterator.erase(); } unsigned int Mailbox::iterator::getSqnr() const { return realIterator.sqnr; } void Mailbox::setName(const std::string &name) { this->name = name; } const std::string Mailbox::getName() const { return name; } const std::string &Mailbox::getLastError() const { return lastError; } void Mailbox::setLastError(const std::string &error) const { lastError = error; }