lib

Kross::Api::List Class Reference

#include <list.h>

Inheritance diagram for Kross::Api::List:

Kross::Api::Value< T, V > Kross::Api::Object Kross::Api::ListT< OBJECT > List of all members.

Detailed Description

The List class implementates Value to handle lists and collections.

Definition at line 36 of file list.h.


Public Types

typedef KSharedPtr< ListPtr

Public Member Functions

 List (QValueList< Object::Ptr > value=QValueList< Object::Ptr >())
virtual ~List ()
virtual const QString getClassName () const
virtual const QString toString ()
Object::Ptr item (uint idx, Object *defaultobject=0)
uint count ()
void append (Object::Ptr object)

Static Public Member Functions

template<typename TYPE>
static Object::Ptr toObject (TYPE t)

Friends

class Value< List, QValueList< Object::Ptr > >

Member Typedef Documentation

typedef KSharedPtr<List> Kross::Api::List::Ptr

Shared pointer to implement reference-counting.

Reimplemented from Kross::Api::Object.

Definition at line 44 of file list.h.


Constructor & Destructor Documentation

List::List ( QValueList< Object::Ptr value = QValueList< Object::Ptr >()  ) 

Constructor.

Parameters:
value The list of Object instances this list has initialy.

Definition at line 25 of file list.cpp.

List::~List (  )  [virtual]

Destructor.

Definition at line 30 of file list.cpp.


Member Function Documentation

const QString List::getClassName (  )  const [virtual]

See.

See also:
Kross::Api::Object::getClassName()

Implements Kross::Api::Object.

Definition at line 34 of file list.cpp.

const QString List::toString (  )  [virtual]

Returns:
a string representation of the whole list.

See also:
Kross::Api::Object::toString()

Reimplemented from Kross::Api::Object.

Definition at line 39 of file list.cpp.

Object::Ptr List::item ( uint  idx,
Object defaultobject = 0 
)

Return the Object with defined index from the QValueList this list holds.

Exceptions:
TypeException If index is out of bounds.
Parameters:
idx The QValueList-index.
defaultobject The default Object which should be used if there exists no item with such an index. This Object instance will be returned if not NULL and if the index is out of bounds. If its NULL a TypeException will be thrown.
Returns:
The Object instance.

Definition at line 48 of file list.cpp.

uint List::count (  ) 

Return the number of items in the QValueList this list holds.

Returns:
The number of items.

Definition at line 60 of file list.cpp.

void List::append ( Object::Ptr  object  ) 

Append an Kross::Api::Object to the list.

Parameters:
object The Kross::Api::Object instance to append to this list.

Definition at line 65 of file list.cpp.

template<typename TYPE>
static Object::Ptr Kross::Api::List::toObject ( TYPE  t  )  [inline, static]

This method got used by the ProxyFunction classes to translate an unknown TYPE to a Object instance.

Classes like Value or ListT or Class are overwriting this method to transparently translate these passed type while this method just assumes that the type is already a Object instance.

Reimplemented from Kross::Api::Value< T, V >.

Reimplemented in Kross::Api::ListT< OBJECT >.

Definition at line 111 of file list.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys