1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
23 #include "FieldImpls.h"
25 #include "AccountManager.h"
26 #include "TableImpls.h"
31 Trace::Trace(SavableManagerPtr trace
) :
42 const std::string
& Trace::getDiff() const
44 return m_trace
->getValue(db::TableImpls::Get()->TRACES
->DIFF
)->getStringValue();
47 const std::string
& Trace::getDescription() const
49 return m_trace
->getValue(db::TableImpls::Get()->TRACES
->DESCRIPTION
)->getStringValue();
52 value_type
Trace::getAccount() const
54 return m_trace
->getValue(db::TableImpls::Get()->TRACES
->FKACCOUNTS
)->getIntegerValue();
57 time_t Trace::getTime() const
59 return m_trace
->getValue(db::TableImpls::Get()->TRACES
->TIME
)->getIntegerValue();
62 void Trace::setDiff(const std::string
& diff
)
65 ValuePtr
value(new FieldValue(db::TableImpls::Get()->TRACES
->DIFF
, diff
));
66 m_trace
->setValue(value
);
69 void Trace::setDescription(const std::string
& description
)
72 ValuePtr
value(new FieldValue(db::TableImpls::Get()->TRACES
->DESCRIPTION
, description
));
73 m_trace
->setValue(value
);
76 void Trace::setTime(time_t time
)
79 ValuePtr
value(new FieldValue(db::TableImpls::Get()->TRACES
->TIME
, time
));
80 m_trace
->setValue(value
);
83 void Trace::setAccount(value_type account
)
86 ValuePtr
value(new FieldValue(db::TableImpls::Get()->TRACES
->FKACCOUNTS
, account
));
87 m_trace
->setValue(value
);
103 void Trace::Discard()
111 return m_trace
->exists();
114 TableImplPtr
Trace::getTable() const
116 return m_trace
->getTable();
119 SavableManagerPtr
mud::Trace::getManager() const