This class associates a resource with its skills. More...

#include <model.h>

Inheritance diagram for frepple::ResourceSkill:

Public Member Functions

void beginElement (XMLInput &, const Attribute &)
 
void endElement (XMLInput &, const Attribute &, const DataElement &)
 
PyObject * getattro (const Attribute &)
 
ResourcegetResource () const
 
virtual size_t getSize () const
 
SkillgetSkill () const
 
virtual const MetaClassgetType () const
 
 ResourceSkill ()
 
 ResourceSkill (Skill *, Resource *, int)
 
 ResourceSkill (Skill *, Resource *, int, DateRange)
 
int setattro (const Attribute &, const PythonObject &)
 
void setResource (Resource *r)
 
void setSkill (Skill *s)
 
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 
- Public Member Functions inherited from frepple::utils::Object
virtual bool getHidden () const
 
 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)
 
virtual int compare (const PyObject *other) const
 
Py_ssize_t getReferenceCount () const
 
void initType (const MetaClass *t)
 
void initType (PyTypeObject *t)
 
virtual PyObject * iternext ()
 
 PythonExtensionBase ()
 
void resetReferenceCount ()
 
virtual PyObject * str () const
 
virtual ~PythonExtensionBase ()
 
- Public Member Functions inherited from frepple::utils::Association< A, B, C >::Node
DateRange getEffective () const
 
const string & getName () const
 
int getPriority () const
 
A * getPtrA () const
 
B * getPtrB () const
 
 Node ()
 
 Node (A *a, B *b, const ListA &al, const ListB &bl)
 
void setEffective (DateRange dr)
 
void setEffectiveEnd (Date d)
 
void setEffectiveStart (Date d)
 
void setName (const string x)
 
void setPriority (int i)
 
void setPtrA (A *a, const ListA &al)
 
void setPtrAB (A *a, B *b, const ListA &al, const ListB &bl)
 
void setPtrB (B *b, const ListB &bl)
 

Static Public Member Functions

static int initialize ()
 
static void writer (const MetaCategory *, XMLOutput *)
 
- Static Public Member Functions inherited from frepple::utils::Object
template<class T >
static PyObject * create (PyTypeObject *pytype, PyObject *args, PyObject *kwds)
 
template<class T >
static ObjectcreateDefault ()
 
template<class T >
static ObjectcreateString (const string &n)
 
static PyObject * toXML (PyObject *, PyObject *)
 

Static Public Attributes

static const MetaCategorymetadata
 

Additional Inherited Members

- Public Attributes inherited from frepple::utils::Association< A, B, C >::Node
DateRange effectivity
 
string name
 
C * nextA
 
C * nextB
 
int priority
 
A * ptrA
 
B * ptrB
 
- Static Protected Member Functions inherited from frepple::utils::PythonExtensionBase
static PythonTyperegisterPythonType (int, const type_info *)
 
- Static Protected Attributes inherited from frepple::utils::PythonExtensionBase
static vector< PythonType * > table
 

Detailed Description

This class associates a resource with its skills.

Definition at line 4115 of file model.h.

Constructor & Destructor Documentation

frepple::ResourceSkill::ResourceSkill ( )
inlineexplicit

Default constructor.

Definition at line 4119 of file model.h.

frepple::ResourceSkill::ResourceSkill ( Skill s,
Resource r,
int  u 
)
explicit

Constructor.

Definition at line 51 of file resourceskill.cpp.

frepple::ResourceSkill::ResourceSkill ( Skill s,
Resource r,
int  u,
DateRange  e 
)
explicit

Constructor.

Definition at line 68 of file resourceskill.cpp.

Member Function Documentation

void frepple::ResourceSkill::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::Object.

Definition at line 136 of file resourceskill.cpp.

void frepple::ResourceSkill::endElement ( XMLInput ,
const Attribute ,
const DataElement  
)
virtual

Called while restoring the model from an XML-file.
This is called when the corresponding close element tag is encountered, and the Data() member of pElement is valid.

Implements frepple::utils::Object.

Definition at line 145 of file resourceskill.cpp.

PyObject * frepple::ResourceSkill::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 189 of file resourceskill.cpp.

Resource* frepple::ResourceSkill::getResource ( ) const
inline

Returns the resource.

Definition at line 4137 of file model.h.

virtual size_t frepple::ResourceSkill::getSize ( ) const
inlinevirtual

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Definition at line 4147 of file model.h.

Skill* frepple::ResourceSkill::getSkill ( ) const
inline

Returns the skill.

Definition at line 4143 of file model.h.

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

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

Implements frepple::utils::Object.

Definition at line 4145 of file model.h.

int frepple::ResourceSkill::initialize ( )
static

Initialize the class.

Definition at line 30 of file resourceskill.cpp.

int frepple::ResourceSkill::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 205 of file resourceskill.cpp.

void frepple::ResourceSkill::setResource ( Resource r)
inline

Updates the resource. This method can only be called on an instance.

Definition at line 4140 of file model.h.

void frepple::ResourceSkill::setSkill ( Skill s)
inline

Updates the skill. This method can only be called on an instance.

Definition at line 4150 of file model.h.

void frepple::ResourceSkill::writeElement ( XMLOutput ,
const Keyword ,
mode  = DEFAULT 
) const
virtual

Called while writing the model into an XML-file. The user class should write itself out, using the IOutStream members for its "simple" members and calling writeElement recursively for any contained objects. Not all classes are expected to implement this method. In instances of such a class can be created but can't be persisted. E.g. Command

Reimplemented from frepple::utils::Object.

Definition at line 105 of file resourceskill.cpp.

void frepple::ResourceSkill::writer ( const MetaCategory c,
XMLOutput o 
)
static

Definition at line 86 of file resourceskill.cpp.

Member Data Documentation

const MetaCategory * frepple::ResourceSkill::metadata
static

Definition at line 4146 of file model.h.


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