#include <servicing.h>
Inheritance diagram for Transferrable:

Public Member Functions | |
| Transferrable (ResourceWatch &s, ResourceWatch &d) | |
| virtual ASCString | getName ()=0 |
| virtual int | getMax (ContainerBase *c, bool avail)=0 |
| get maximum amount for that unit. | |
| virtual int | getMin (ContainerBase *c, bool avail)=0 |
| virtual int | transfer (ContainerBase *target, int delta)=0 |
| virtual int | getAmount (const ContainerBase *target)=0 |
| virtual void | commit (const Context &context)=0 |
| virtual bool | isExchangable () const=0 |
| virtual int | getID ()=0 |
| the id is used to identify the transferrable when serializng to disk. In each service operation, the id must be unique through all transferrables | |
| ContainerBase * | getSrcContainer () |
| ContainerBase * | getDstContainer () |
| bool | setDestAmount (long amount) |
| void | showAll () |
| int | setAmount (ContainerBase *target, int newamount) |
| void | fill (ContainerBase *target) |
| void | empty (ContainerBase *target) |
| virtual | ~Transferrable () |
Public Attributes | |
| SigC::Signal1< void, const std::string & > | sigSourceAmount |
| SigC::Signal1< void, const std::string & > | sigDestAmount |
Protected Member Functions | |
| ResourceWatch & | getResourceWatch (const ContainerBase *unit) |
| ResourceWatch & | getOpposingResourceWatch (const ContainerBase *unit) |
| ContainerBase * | opposingContainer (const ContainerBase *unit) |
| void | show (const ContainerBase *unit) |
Protected Attributes | |
| ResourceWatch & | source |
| ResourceWatch & | dest |
Definition at line 48 of file servicing.h.
| Transferrable::Transferrable | ( | ResourceWatch & | s, | |
| ResourceWatch & | d | |||
| ) |
Definition at line 169 of file servicing.cpp.
| virtual Transferrable::~Transferrable | ( | ) | [inline, virtual] |
Definition at line 89 of file servicing.h.
| ResourceWatch & Transferrable::getResourceWatch | ( | const ContainerBase * | unit | ) | [protected] |
Definition at line 136 of file servicing.cpp.
References dest, ResourceWatch::getContainer(), and source.
Referenced by ResourceTransferrable::getAmount(), ResourceTransferrable::getAvail(), ResourceTransferrable::getMax(), getOpposingResourceWatch(), and ResourceTransferrable::transfer().
| ResourceWatch & Transferrable::getOpposingResourceWatch | ( | const ContainerBase * | unit | ) | [protected] |
Definition at line 145 of file servicing.cpp.
References getResourceWatch(), and opposingContainer().
Referenced by ResourceTransferrable::getMax(), ResourceTransferrable::getMin(), and ResourceTransferrable::transfer().
| ContainerBase * Transferrable::opposingContainer | ( | const ContainerBase * | unit | ) | [protected] |
Definition at line 150 of file servicing.cpp.
References dest, ResourceWatch::getContainer(), and source.
Referenced by AmmoTransferrable::getMax(), AmmoTransferrable::getMin(), getOpposingResourceWatch(), AmmoTransferrable::transfer(), and ResourceTransferrable::transfer().
| void Transferrable::show | ( | const ContainerBase * | unit | ) | [protected] |
Definition at line 159 of file servicing.cpp.
References dest, getAmount(), ResourceWatch::getContainer(), sigDestAmount, sigSourceAmount, source, and ASCString::toString().
Referenced by showAll().
| virtual ASCString Transferrable::getName | ( | ) | [pure virtual] |
Implemented in AmmoTransferrable, and ResourceTransferrable.
Referenced by TransferWidget::TransferWidget().
| virtual int Transferrable::getMax | ( | ContainerBase * | c, | |
| bool | avail | |||
| ) | [pure virtual] |
get maximum amount for that unit.
| c | the container for which the maximum amount is calculated | |
| avail | If true, the amount is limited by the resources which can actually provided by the other unit. If false, return the storage capacity |
Implemented in AmmoTransferrable, and ResourceTransferrable.
Referenced by fill().
| virtual int Transferrable::getMin | ( | ContainerBase * | c, | |
| bool | avail | |||
| ) | [pure virtual] |
Implemented in AmmoTransferrable, and ResourceTransferrable.
| virtual int Transferrable::transfer | ( | ContainerBase * | target, | |
| int | delta | |||
| ) | [pure virtual] |
| virtual int Transferrable::getAmount | ( | const ContainerBase * | target | ) | [pure virtual] |
| virtual void Transferrable::commit | ( | const Context & | context | ) | [pure virtual] |
Implemented in AmmoTransferrable, and ResourceTransferrable.
| virtual bool Transferrable::isExchangable | ( | ) | const [pure virtual] |
Implemented in AmmoTransferrable, and ResourceTransferrable.
Referenced by TransferWidget::TransferWidget().
| virtual int Transferrable::getID | ( | ) | [pure virtual] |
the id is used to identify the transferrable when serializng to disk. In each service operation, the id must be unique through all transferrables
Implemented in AmmoTransferrable, and ResourceTransferrable.
| ContainerBase * Transferrable::getSrcContainer | ( | ) |
| ContainerBase * Transferrable::getDstContainer | ( | ) |
Definition at line 176 of file servicing.cpp.
References dest, and ResourceWatch::getContainer().
Referenced by setDestAmount().
| bool Transferrable::setDestAmount | ( | long | amount | ) |
Definition at line 181 of file servicing.cpp.
References getDstContainer(), and setAmount().
Referenced by TransferWidget::TransferWidget().
| void Transferrable::showAll | ( | ) |
Definition at line 186 of file servicing.cpp.
References dest, ResourceWatch::getContainer(), show(), and source.
| int Transferrable::setAmount | ( | ContainerBase * | target, | |
| int | newamount | |||
| ) |
Definition at line 192 of file servicing.cpp.
References getAmount(), and transfer().
Referenced by empty(), fill(), and setDestAmount().
| void Transferrable::fill | ( | ContainerBase * | target | ) |
| void Transferrable::empty | ( | ContainerBase * | target | ) |
ResourceWatch& Transferrable::source [protected] |
Definition at line 50 of file servicing.h.
Referenced by AmmoTransferrable::commit(), ResourceTransferrable::commit(), getResourceWatch(), getSrcContainer(), opposingContainer(), ResourceTransferrable::ResourceTransferrable(), show(), and showAll().
ResourceWatch& Transferrable::dest [protected] |
Definition at line 51 of file servicing.h.
Referenced by AmmoTransferrable::commit(), ResourceTransferrable::commit(), getDstContainer(), getResourceWatch(), opposingContainer(), ResourceTransferrable::ResourceTransferrable(), show(), and showAll().
| SigC::Signal1<void,const std::string&> Transferrable::sigSourceAmount |
Definition at line 83 of file servicing.h.
Referenced by show(), and TransferWidget::TransferWidget().
| SigC::Signal1<void,const std::string&> Transferrable::sigDestAmount |
Definition at line 84 of file servicing.h.
Referenced by show(), and TransferWidget::TransferWidget().
1.5.1