7 #ifndef cf3_Python_Component_hpp
8 #define cf3_Python_Component_hpp
10 #include <boost/python/object.hpp>
16 namespace common {
class Component; }
17 template<
typename T>
class Handle;
33 virtual boost::python::object
get_item(
const Uint i)
const = 0;
36 virtual void set_item(
const Uint i, boost::python::object& value) = 0;
39 virtual std::string
to_str()
const = 0;
53 template<
typename ComponentT>
56 ComponentT* comp =
dynamic_cast<ComponentT*
>(&
component());
88 #endif // cf3_Python_Component_hpp
virtual void set_item(const Uint i, boost::python::object &value)=0
Set item i in the list.
ComponentT & component()
Properly typed access to the wrapped component.
std::string type_name(const boost::python::api::object &python_object)
PythonListInterface * get_list_interface()
Get the curent list interface, or null if there is none.
void def_component()
Python wrapping for the Component class.
virtual Uint len() const =0
The number of items in the list.
friend boost::python::object wrap_component(const cf3::Handle< common::Component > &)
Wrap the passed component in a python object.
boost::python::object wrap_component(const Handle< common::Component > &component)
Wrap the passed component in a python object.
virtual boost::python::object get_item(const Uint i) const =0
Get item i from the list.
virtual std::string to_str() const =0
Get the whole list as a string.
Top-level namespace for coolfluid.
ComponentWrapper(const Handle< common::Component > &component)
unsigned int Uint
typedef for unsigned int
virtual ~PythonListInterface()
boost::shared_ptr< Implementation > m_implementation
Base class for defining CF components.
Wrapper class for components.
common::Component & component()
Access to the wrapped component.
void set_list_interface(PythonListInterface *interface)