This class models skills that can be assigned to resources. More...

#include <model.h>

Inheritance diagram for frepple::Skill:

List of all members.

Public Types

typedef Association< Resource,
Skill, ResourceSkill >::ListB 
resourcelist

Public Member Functions

void beginElement (XMLInput &, const Attribute &)
void endElement (XMLInput &, const Attribute &, const DataElement &)
size_t extrasize () const
virtual PyObject * getattro (const Attribute &)
const resourcelistgetResources () const
virtual size_t getSize () const
virtual const MetaClassgetType () const
virtual int setattro (const Attribute &, const PythonObject &)
 Skill (const string &n)
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 ~Skill ()
- Public Member Functions inherited from frepple::utils::HasName< Skill >
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
 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 ()

Static Public Member Functions

static PyObject * addPythonResource (PyObject *, PyObject *)
static int initialize ()
- Static Public Member Functions inherited from frepple::utils::HasName< Skill >
static Skilladd (const string &k, const MetaClass &cls)
static Skilladd (Skill *t)
static Skilladd (Skill *t, Skill *hint)
static iterator begin ()
static void clear ()
static bool empty ()
static iterator end ()
static Skillfind (const string &k)
static SkillfindLowerBound (const string &k, bool *f=NULL)
static Objectreader (const MetaClass *cat, const AttributeList &in)
static size_t size ()
static void verify ()
static void writer (const MetaCategory *c, XMLOutput *o)
- 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

Friends

class ResourceSkill

Detailed Description

This class models skills that can be assigned to resources.

Definition at line 3704 of file model.h.


Member Typedef Documentation

Definition at line 3715 of file model.h.


Constructor & Destructor Documentation

frepple::Skill::Skill ( const string &  n)
inline

Default constructor.

Definition at line 3710 of file model.h.

frepple::Skill::~Skill ( )

Destructor.

Definition at line 92 of file skill.cpp.


Member Function Documentation

static PyObject* frepple::Skill::addPythonResource ( PyObject *  ,
PyObject *   
)
static

Python interface to add a new resource.

void frepple::Skill::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 73 of file skill.cpp.

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

Reimplemented from frepple::utils::HasName< Skill >.

Definition at line 86 of file skill.cpp.

size_t frepple::Skill::extrasize ( ) const
inline

Definition at line 3739 of file model.h.

PyObject * frepple::Skill::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 106 of file skill.cpp.

const resourcelist& frepple::Skill::getResources ( ) const
inline

Returns an reference to the list of resources having this skill.

Definition at line 3718 of file model.h.

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

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Reimplemented in frepple::SkillDefault.

Definition at line 3733 of file model.h.

virtual const MetaClass& frepple::Skill::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::SkillDefault.

Definition at line 3730 of file model.h.

int frepple::Skill::initialize ( )
static

Reimplemented in frepple::SkillDefault.

Definition at line 32 of file skill.cpp.

int frepple::Skill::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 116 of file skill.cpp.

void frepple::Skill::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 56 of file skill.cpp.


Friends And Related Function Documentation

friend class ResourceSkill
friend

Definition at line 3706 of file model.h.


Member Data Documentation

const MetaCategory * frepple::Skill::metadata
static

Reimplemented in frepple::SkillDefault.

Definition at line 3731 of file model.h.


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