Rosetta
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 const *c)
 
string id () const override
 Generate string id that uniquely identify C++ binding object. For functions this is function prototype and for classes forward declaration. More...
 
clang::NamedDecl const * 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
 return vector of declarations that need to be binded before this one could More...
 
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
 return true if code was already generated for this object More...
 
stringcode ()
 return binding code More...
 
string const & code () const
 
bool is_in_system_header ()
 return true if object is 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 ()
 
void for_public_nested_classes (std::function< void(clang::CXXRecordDecl const *)> const &f) const
 
string bind_nested_classes (Context &context)
 
std::string bind_repr (Context &, Config const &)
 generate (if any) bindings for Python str by using appropriate global operator<< More...
 

Private Attributes

clang::CXXRecordDecl const * 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

◆ ClassBinder()

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

Member Function Documentation

◆ add_relevant_includes()

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

◆ bind()

void binder::ClassBinder::bind ( Context context)
overridevirtual

◆ bind_nested_classes()

string binder::ClassBinder::bind_nested_classes ( Context context)
private

◆ bind_repr()

std::string binder::ClassBinder::bind_repr ( Context context,
Config const &  config 
)
private

◆ bind_with()

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

◆ bindable()

bool binder::ClassBinder::bindable ( ) const
overridevirtual

check if generator can create binding

Implements binder::Binder.

References C, and binder::is_bindable().

◆ dependencies()

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

return vector of declarations that need to be binded before this one could

Reimplemented from binder::Binder.

References dependencies_.

◆ for_public_nested_classes()

void binder::ClassBinder::for_public_nested_classes ( std::function< void(clang::CXXRecordDecl const *)> const &  f) const
private

References C, create_a3b_hbs::f, and docking::s.

◆ generate_prefix_code()

void binder::ClassBinder::generate_prefix_code ( )
private

◆ id()

string binder::ClassBinder::id ( ) const
overridevirtual

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

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().

Referenced by schema.Job::__repr__().

◆ maybe_base_classes()

string binder::ClassBinder::maybe_base_classes ( Context context)
private

◆ named_decl()

clang::NamedDecl const* binder::ClassBinder::named_decl ( ) const
inlineoverridevirtual

Implements binder::Binder.

References C.

◆ prefix_code()

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

return prefix portion of bindings code

Reimplemented from binder::Binder.

References prefix_code_.

◆ request_bindings_and_skipping()

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

◆ C

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

Referenced by named_decl().

◆ dependencies_

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

Referenced by dependencies().

◆ prefix_code_

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

Referenced by prefix_code().

◆ prefix_includes_

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

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