Rosetta  2020.28
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
binder::ClassBinder Class Reference

#include <class.hpp>

Inheritance diagram for binder::ClassBinder:
Inheritance graph
[legend]

Public Member Functions

 ClassBinder (clang::CXXRecordDecl *c)
 
string id () const override
 Generate string id that uniquly identify C++ binding object. For functions this is function prototype and for classes forward declaration. More...
 
clang::NamedDecl * named_decl () const override
 
bool bindable () const override
 check if generator can create binding More...
 
virtual void request_bindings_and_skipping (Config const &) override
 check if user requested binding for the given declaration More...
 
void add_relevant_includes (IncludeSet &includes) const override
 extract include needed for this generator and add it to includes vector More...
 
void bind_with (string const &binder, Context &)
 generate binding code for this object by using external user-provided binder More...
 
void bind (Context &) override
 generate binding code for this object and all its dependencies More...
 
std::vector
< clang::CXXRecordDecl const * > 
dependencies () const override
 
string prefix_code () const override
 return prefix portion of bindings code More...
 
- Public Member Functions inherited from binder::Binder
virtual ~Binder ()
 
bool binding_requested () const
 
bool skipping_requested () const
 
void request_bindings ()
 request bindings for this generator More...
 
void request_skipping ()
 request skipping for this generator More...
 
bool is_binded () const
 
stringcode ()
 
string const & code () const
 
bool is_in_system_header ()
 return true if object declared in system header More...
 
 operator std::string () const
 return unique strting ID for this binder More...
 

Private Member Functions

std::string maybe_base_classes (Context &context)
 check if any of the base classes is wrappable and if generate a string describing them: , pybind11::base<BaseClass>() More...
 
void generate_prefix_code ()
 
string bind_nested_classes (clang::CXXRecordDecl const *EC, Context &context)
 
std::string bind_repr (Context &)
 generate (if any) bindings for Python str by using appropriate global operator<< More...
 

Private Attributes

clang::CXXRecordDecl * C
 
std::string prefix_code_
 
std::vector
< clang::FunctionDecl const * > 
prefix_includes
 
std::vector
< clang::CXXRecordDecl const * > 
dependencies_
 

Additional Inherited Members

- Public Types inherited from binder::Binder
typedef std::string string
 

Constructor & Destructor Documentation

binder::ClassBinder::ClassBinder ( clang::CXXRecordDecl *  c)
inline

Member Function Documentation

void binder::ClassBinder::add_relevant_includes ( IncludeSet includes) const
overridevirtual

extract include needed for this generator and add it to includes vector

Implements binder::Binder.

References binder::IncludeSet::add_include(), binder::add_relevant_includes(), C, ObjexxFCL::get(), test.T110_numeric::m, O_annotate_includes, and binder::standard_name().

void binder::ClassBinder::bind ( Context context)
overridevirtual
string binder::ClassBinder::bind_nested_classes ( clang::CXXRecordDecl const *  EC,
Context context 
)
private
std::string binder::ClassBinder::bind_repr ( Context context)
private

generate (if any) bindings for Python str by using appropriate global operator<<

References C, binder::class_qualified_name(), ObjexxFCL::format::F(), and binder::Context::global_insertion_operator().

void binder::ClassBinder::bind_with ( string const &  binder,
Context context 
)
bool binder::ClassBinder::bindable ( ) const
overridevirtual

check if generator can create binding

Implements binder::Binder.

References C, and binder::is_bindable().

std::vector<clang::CXXRecordDecl const *> binder::ClassBinder::dependencies ( ) const
inlineoverridevirtual

Reimplemented from binder::Binder.

References dependencies_.

void binder::ClassBinder::generate_prefix_code ( )
private
string binder::ClassBinder::id ( ) const
overridevirtual

Generate string id that uniquly identify C++ binding object. For functions this is function prototype and for classes forward declaration.

Implements binder::Binder.

References C, and binder::class_qualified_name().

string binder::ClassBinder::maybe_base_classes ( Context context)
private
clang::NamedDecl* binder::ClassBinder::named_decl ( ) const
inlineoverridevirtual

Implements binder::Binder.

References C.

string binder::ClassBinder::prefix_code ( ) const
inlineoverridevirtual

return prefix portion of bindings code

Reimplemented from binder::Binder.

References prefix_code_.

Referenced by bind_nested_classes().

void binder::ClassBinder::request_bindings_and_skipping ( Config const &  config)
overridevirtual

check if user requested binding for the given declaration

Implements binder::Binder.

References C, binder::is_binding_requested(), binder::is_skipping_requested(), and binder::request_bindings().

Member Data Documentation

clang::CXXRecordDecl* binder::ClassBinder::C
private

Referenced by named_decl().

std::vector<clang::CXXRecordDecl const *> binder::ClassBinder::dependencies_
private

Referenced by dependencies().

std::string binder::ClassBinder::prefix_code_
private

Referenced by prefix_code().

std::vector<clang::FunctionDecl const *> binder::ClassBinder::prefix_includes
private

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