/[adonthell]/adonthell/src/python/script.h
ViewVC logotype

Diff of /adonthell/src/python/script.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by ksterker, Sun Jun 27 11:20:58 2004 UTC revision 1.6 by ksterker, Tue Jan 18 12:05:05 2005 UTC
# Line 79  namespace python Line 79  namespace python
79           * @param args Python tuple containing the arguments to pass to the           * @param args Python tuple containing the arguments to pass to the
80           *             Python class constructor.           *             Python class constructor.
81           */           */
82          bool create_instance (const std::string & file, const std::string & classname, PyObject * args = NULL);          bool create_instance (const string & file, const string & classname, PyObject * args = NULL);
83            
84          /**          /**
85           * Similar to create_instance, except that it will reload the module           * Similar to create_instance, except that it will reload the module
# Line 91  namespace python Line 91  namespace python
91           * @param args Python tuple containing the arguments to pass to the           * @param args Python tuple containing the arguments to pass to the
92           *             Python class constructor.           *             Python class constructor.
93           */           */
94          bool reload_instance (const std::string & file, const std::string & classname, PyObject * args = NULL);          bool reload_instance (const string & file, const string & classname, PyObject * args = NULL);
95          //@}          //@}
96            
97          /**          /**
# Line 106  namespace python Line 106  namespace python
106           * @return the return value of the method as PyObject. Needs to be           * @return the return value of the method as PyObject. Needs to be
107           *     Py_DECREF'd when no longer needed.           *     Py_DECREF'd when no longer needed.
108           */           */
109          PyObject *call_method_ret (const std::string &name, PyObject *args = NULL) const;          PyObject *call_method_ret (const string &name, PyObject *args = NULL) const;
110                    
111          /**          /**
112           * Call a method of this object.           * Call a method of this object.
# Line 114  namespace python Line 114  namespace python
114           * @param name name of the method to call.           * @param name name of the method to call.
115           * @param args Python tuple containing the arguments to pass to the method.           * @param args Python tuple containing the arguments to pass to the method.
116           */           */
117          void call_method (const std::string & name, PyObject * args = NULL) const          void call_method (const string & name, PyObject * args = NULL) const
118          {          {
119              PyObject *result = call_method_ret (name, args);              PyObject *result = call_method_ret (name, args);
120              Py_XDECREF (result);              Py_XDECREF (result);
# Line 132  namespace python Line 132  namespace python
132           * @param name Name of the attribute to test for           * @param name Name of the attribute to test for
133           * @return <b>true</b> if the attribute exists, <b>false</b> otherwise.           * @return <b>true</b> if the attribute exists, <b>false</b> otherwise.
134           */           */
135          bool has_attribute (const std::string & name) const;          bool has_attribute (const string & name) const;
136            
137          /**          /**
138           * Returns a new reference to an attribute of this object.           * Returns a new reference to an attribute of this object.
# Line 140  namespace python Line 140  namespace python
140           * @param name Name of the attribute to access           * @param name Name of the attribute to access
141           * @return New reference to the attribute or NULL on error           * @return New reference to the attribute or NULL on error
142           */           */
143          PyObject* get_attribute (const std::string & name) const;          PyObject* get_attribute (const string & name) const;
144            
145          /**          /**
146           * Returns the given attribute as integer value.           * Returns the given attribute as integer value.
# Line 148  namespace python Line 148  namespace python
148           * @param name Name of the attribute to access           * @param name Name of the attribute to access
149           * @return An integer.           * @return An integer.
150           */           */
151          s_int32 get_attribute_int (const std::string & name) const;          s_int32 get_attribute_int (const string & name) const;
152            
153          /**          /**
154           * Returns the given attribute as string value.           * Returns the given attribute as string value.
# Line 156  namespace python Line 156  namespace python
156           * @param name Name of the attribute to access           * @param name Name of the attribute to access
157           * @return A string.           * @return A string.
158           */           */
159          std::string get_attribute_string (const std::string & name) const;          std::string get_attribute_string (const string & name) const;
160            
161          /**          /**
162           * Assign a new attribute to the module, overriding an existing           * Assign a new attribute to the module, overriding an existing
# Line 165  namespace python Line 165  namespace python
165           * @param name The attribute's name           * @param name The attribute's name
166           * @param value The attribute's value           * @param value The attribute's value
167           */           */
168          void set_attribute (const std::string & name, PyObject *value);          void set_attribute (const string & name, PyObject *value);
169            
170          /**          /**
171           * Assign a new integer attribute to the module, overriding an           * Assign a new integer attribute to the module, overriding an
# Line 174  namespace python Line 174  namespace python
174           * @param name The attribute's name           * @param name The attribute's name
175           * @param value The attribute's value           * @param value The attribute's value
176           */           */
177          void set_attribute_int (const std::string & name, s_int32 value);          void set_attribute_int (const string & name, s_int32 value);
178            
179          /**          /**
180           * Assign a new string attribute to the module, overriding an           * Assign a new string attribute to the module, overriding an
# Line 183  namespace python Line 183  namespace python
183           * @param name The attribute's name           * @param name The attribute's name
184           * @param value The attribute's value           * @param value The attribute's value
185           */           */
186          void set_attribute_string (const std::string & name, const std::string & value);          void set_attribute_string (const string & name, const string & value);
187          //@}          //@}
188                    
189          /**          /**

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26