Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PythonBasicType Class Reference

#include <python_compile.h>

Public Types

enum  { MYSTRING, MYLONG, MYDOUBLE }
 

Public Member Functions

 PythonBasicType (const std::string &mystr)
 
 PythonBasicType (const long mystr)
 
 PythonBasicType (const float mystr)
 
PyObject * NewObject () const
 

Public Attributes

std::string objects
 
long objecti
 
double objectd
 
enum PythonBasicType:: { ... }  type
 

Detailed Description

Definition at line 16 of file python_compile.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MYSTRING 
MYLONG 
MYDOUBLE 

Definition at line 22 of file python_compile.h.

Constructor & Destructor Documentation

PythonBasicType::PythonBasicType ( const std::string &  mystr)
inline

Definition at line 23 of file python_compile.h.

References MYSTRING, objects, and type.

24  {
25  type = MYSTRING;
26  objects = mystr;
27  }
PythonBasicType::PythonBasicType ( const long  mystr)
inline

Definition at line 28 of file python_compile.h.

References MYLONG, objecti, and type.

29  {
30  type = MYLONG;
31  objecti = mystr;
32  }
PythonBasicType::PythonBasicType ( const float  mystr)
inline

Definition at line 33 of file python_compile.h.

References MYDOUBLE, objectd, and type.

34  {
35  type = MYDOUBLE;
36  objectd = mystr;
37  }

Member Function Documentation

PyObject* PythonBasicType::NewObject ( ) const
inline

Definition at line 38 of file python_compile.h.

References MYDOUBLE, MYLONG, MYSTRING, objectd, objecti, objects, and type.

39  {
40  switch (type)
41  {
42  case MYSTRING:
43  return PyString_FromString( objects.c_str() );
44 
45  case MYLONG:
46  return PyLong_FromLong( objecti );
47 
48  case MYDOUBLE:
49  return PyFloat_FromDouble( objectd );
50  }
51  return NULL;
52  }

Member Data Documentation

double PythonBasicType::objectd

Definition at line 21 of file python_compile.h.

Referenced by NewObject(), and PythonBasicType().

long PythonBasicType::objecti

Definition at line 20 of file python_compile.h.

Referenced by NewObject(), and PythonBasicType().

std::string PythonBasicType::objects

Definition at line 19 of file python_compile.h.

Referenced by NewObject(), and PythonBasicType().

enum { ... } PythonBasicType::type

Referenced by NewObject(), and PythonBasicType().


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