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

#include <model.h>

Inheritance diagram for frepple::Skill:

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
 
void endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement)
 
 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
 

Additional Inherited Members

- Protected Member Functions inherited from frepple::utils::NonCopyable
 NonCopyable ()
 
 ~NonCopyable ()
 
- 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 models skills that can be assigned to resources.

Definition at line 3789 of file model.h.

Member Typedef Documentation

Definition at line 3800 of file model.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 3795 of file model.h.

frepple::Skill::~Skill ( )

Destructor.

Definition at line 93 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 74 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.

Implements frepple::utils::Object.

Definition at line 87 of file skill.cpp.

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

Definition at line 3824 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 107 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 3803 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 3818 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 3815 of file model.h.

int frepple::Skill::initialize ( )
static

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 117 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 3791 of file model.h.

Member Data Documentation

const MetaCategory * frepple::Skill::metadata
static

Definition at line 3816 of file model.h.


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