An item defines the products being planned, sold, stored and/or manufactured. Buffers and demands have a reference an item. More...

#include <model.h>

Inheritance diagram for frepple::Item:

List of all members.

Public Member Functions

void beginElement (XMLInput &, const Attribute &)
void endElement (XMLInput &, const Attribute &, const DataElement &)
virtual PyObject * getattro (const Attribute &)
OperationgetOperation () const
double getPrice () const
virtual const MetaClassgetType () const
 Item (const string &str)
virtual int setattro (const Attribute &, const PythonObject &)
void setOperation (Operation *o)
void setPrice (const double c)
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
virtual ~Item ()
- Public Member Functions inherited from frepple::utils::HasHierarchy< Item >
memberIterator beginMember () const
unsigned short getHierarchyLevel () const
ItemgetOwner () const
 HasHierarchy (const string &n)
bool hasOwner () const
bool isGroup () const
void setOwner (Item *f)
 ~HasHierarchy ()
- Public Member Functions inherited from frepple::utils::HasName< Item >
int compare (const PyObject *other) const
 HasName (const string &n)
 HasName (const char *n)
void setName (const string &newname)
virtual PyObject * str () const
 ~HasName ()
- Public Member Functions inherited from frepple::utils::Tree::TreeNode
TreeNodedecrement () const
const string & getName () const
TreeNodeincrement () const
bool operator< (const TreeNode &o)
 TreeNode (const string &n)
virtual ~TreeNode ()
- Public Member Functions inherited from frepple::utils::Object
virtual bool getHidden () const
virtual size_t getSize () const =0
 Object ()
virtual void setHidden (bool b)
virtual ~Object ()
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
virtual PyObject * call (const PythonObject &args, const PythonObject &kwds)
Py_ssize_t getReferenceCount () const
void initType (const MetaClass *t)
void initType (PyTypeObject *t)
virtual PyObject * iternext ()
 PythonExtensionBase ()
void resetReferenceCount ()
virtual ~PythonExtensionBase ()
- Public Member Functions inherited from frepple::utils::HasDescription
string getCategory () const
string getDescription () const
string getSubCategory () const
void setCategory (const string &f)
void setDescription (const string &f)
void setSubCategory (const string &f)

Static Public Member Functions

static int initialize ()

Static Public Attributes

static const MetaCategorymetadata

Additional Inherited Members

- Protected Member Functions inherited from frepple::utils::HasDescription
size_t extrasize () const

Detailed Description

An item defines the products being planned, sold, stored and/or manufactured. Buffers and demands have a reference an item.

This is an abstract class.

Definition at line 2591 of file model.h.


Constructor & Destructor Documentation

frepple::Item::Item ( const string &  str)
inlineexplicit

Constructor. Don't use this directly!

Definition at line 2595 of file model.h.

frepple::Item::~Item ( )
virtual

Destructor.

Definition at line 53 of file item.cpp.


Member Function Documentation

void frepple::Item::beginElement ( XMLInput ,
const Attribute  
)
virtual

Called while restoring the model from an XML-file.
This is called for each element within the "this" element, for which the "this" element is immediate parent.
It is called when the open element tag is encountered.

Reimplemented from frepple::utils::HasHierarchy< Item >.

Definition at line 86 of file item.cpp.

void frepple::Item::endElement ( XMLInput pIn,
const Attribute pAttr,
const DataElement pElement 
)

Reimplemented from frepple::utils::HasDescription.

Definition at line 95 of file item.cpp.

PyObject * frepple::Item::getattro ( const Attribute attr)
virtual

Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.

Reimplemented from frepple::utils::PythonExtensionBase.

Definition at line 113 of file item.cpp.

Operation* frepple::Item::getOperation ( ) const
inline

Returns the delivery operation.
This field is inherited from a parent item, if it hasn't been specified.

Definition at line 2602 of file model.h.

double frepple::Item::getPrice ( ) const
inline

Return the selling price of the item.
The default value is 0.0.

Definition at line 2624 of file model.h.

virtual const MetaClass& frepple::Item::getType ( ) const
inlinevirtual

This returns the type information on the object, a bit similar to the standard type_info information.

Implements frepple::utils::Object.

Reimplemented in frepple::ItemDefault.

Definition at line 2643 of file model.h.

int frepple::Item::initialize ( )
static

Reimplemented in frepple::ItemDefault.

Definition at line 32 of file item.cpp.

int frepple::Item::setattro ( const Attribute attr,
const PythonObject field 
)
virtual

Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.

Reimplemented from frepple::utils::PythonExtensionBase.

Definition at line 137 of file item.cpp.

void frepple::Item::setOperation ( Operation o)
inline

Updates the delivery operation.
If some demands have already been planned using the old delivery operation they are left untouched and won't be replanned.

Definition at line 2619 of file model.h.

void frepple::Item::setPrice ( const double  c)
inline

Update the selling price of the item.

Definition at line 2627 of file model.h.

void frepple::Item::writeElement ( XMLOutput o,
const Keyword tag,
mode  m = DEFAULT 
) const
virtual

Reimplemented from frepple::utils::HasDescription.

Definition at line 65 of file item.cpp.


Member Data Documentation

const MetaCategory * frepple::Item::metadata
static

Reimplemented in frepple::ItemDefault.

Definition at line 2644 of file model.h.


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