export_PointRepFactory.cxx
Go to the documentation of this file.
1 
12 #ifdef _MSC_VER
13 // nonstandard extension used 'extern' before...
14 # pragma warning(disable:4231)
15 
16 // needs to have dll-interface used by client
17 # pragma warning(disable:4251)
18 
19 // non dll-interface struct
20 # pragma warning(disable:4275)
21 
22 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
23 # pragma warning(disable:4800)
24 #endif
25 
26 // include first to avoid _POSIX_C_SOURCE warning.
27 #include <boost/python.hpp>
28 
29 #include "pattern/Factory.h"
30 #include "reps/PointRepFactory.h"
31 #include "reps/RepBase.h"
32 
33 using std::vector;
34 using namespace boost::python;
35 
36 namespace hippodraw {
37 namespace Python {
38 
39 void
41 {
42  class_ < Factory < RepBase >,
43  bases <>,
45  boost::noncopyable >
46  ( "FactoryPointRep",
47  "A private base class for PointRepFactory.",
48  no_init )
49 
50  ;
51 }
52 
53 void
55 {
56  class_ < PointRepFactory,
57  bases < Factory < RepBase > >,
58  PointRepFactory, boost::noncopyable >
59  ( "PointRepFactory",
60  "A factory for creating object whose class derive from PointRep.",
61  no_init )
62 
63  .def ( "instance", &PointRepFactory::instance,
64  return_value_policy < reference_existing_object > (),
65  "instance () -> PointRepFactory\n"
66  "\n"
67  "Returns the instance of the PointRepFactory." )
68 
69  .staticmethod ( "instance" )
70 
71  .def ( "names", &PointRepFactory::names,
72  return_value_policy < copy_const_reference > (),
73  "names () -> sequence\n"
74  "\n"
75  "Returns the names of available PointRep classes." )
76 
77  .def ( "create", &PointRepFactory::create,
78  return_value_policy < reference_existing_object > (),
79  "create ( string ) -> PointRep\n"
80  "\n"
81  "Returns a PointRep object of type named in string." )
82  ;
83 
84 }
85 
86 } // namespace Python
87 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen