COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | List of all members
PythonListInterface Struct Referenceabstract

#include <ComponentWrapper.hpp>

Inherited by List< ValueT >, and TableList< ValueT >.

Public Member Functions

virtual ~PythonListInterface ()
 
virtual Uint len () const =0
 The number of items in the list. More...
 
virtual boost::python::object get_item (const Uint i) const =0
 Get item i from the list. More...
 
virtual void set_item (const Uint i, boost::python::object &value)=0
 Set item i in the list. More...
 
virtual std::string to_str () const =0
 Get the whole list as a string. More...
 

Detailed Description

Encapsulates the behavior required for Python lists. When wrapping a component for Python, these functions will always be defined, but they throw exceptions when list functions are called on components that can't behave like a list. This is necessary because adding methods like len dynamically can't work, because Python expects these to be defined at the level of the class, not just at the level of the object

Definition at line 25 of file ComponentWrapper.hpp.

Constructor & Destructor Documentation

virtual ~PythonListInterface ( )
inlinevirtual

Definition at line 27 of file ComponentWrapper.hpp.

Member Function Documentation

virtual boost::python::object get_item ( const Uint  i) const
pure virtual

Get item i from the list.

Implemented in TableList< ValueT >, and List< ValueT >.

virtual Uint len ( ) const
pure virtual

The number of items in the list.

Implemented in TableList< ValueT >, and List< ValueT >.

virtual void set_item ( const Uint  i,
boost::python::object &  value 
)
pure virtual

Set item i in the list.

Implemented in List< ValueT >.

virtual std::string to_str ( ) const
pure virtual

Get the whole list as a string.

Implemented in TableList< ValueT >, and List< ValueT >.


The documentation for this struct was generated from the following file:
Send comments to:
COOLFluiD Web Admin