1
2
3
4
5
6 """Contains definition of call policies classes"""
7
8 import algorithm
9 import python_traits
10 from pygccxml import declarations
19
21 """base class for all classes, which generate "call policies" code"""
24
26 """Creates code from the call policies class instance.
27 @param function_creator: parent code creator
28 @type function_creator: L{code_creators.function_t} or L{code_creators.constructor_t}
29
30 @param creation_policy: indicates whether we this call policy used as template
31 argument or as an instance
32 @type creation_policy: L{CREATION_POLICY}
33 """
34 code = self._create_impl( function_creator )
35 if code and creation_policy == CREATION_POLICY.AS_INSTANCE:
36 code = code + '()'
37 return code
38
42
46
48 """return True is self is instance of L{default_call_policies_t} class"""
49 return False
50
52 """return True if call policy is defined in Boost.Python library, False otherwise"""
53 return True
54
56 raise NotImplementedError()
57
58 @property
60 """return a name of the header file the call policy is defined in"""
61 return "boost/python.hpp"
62
64 """implements code generation for boost::python::default_call_policies"""
67
70
73
75 return 'default_call_policies'
76
78 """create ::boost::python::default_call_policies call policies code generator"""
79 return default_call_policies_t()
80
82 """base class for all call policies, except the default one"""