![]() |
Rosetta
2019.12
|
Classes | |
class | Binder |
Bindings Generator - represent object that can generate binding info for function, class, enum or data variable. More... | |
class | ClassBinder |
class | Config |
struct | ConstructorBindingInfo |
class | Context |
Context - root, hold bindings info for whole TranslationUnit. More... | |
class | EnumBinder |
class | FunctionBinder |
class | IncludeSet |
class | map_binder |
class | vector_binder |
Typedefs | |
typedef std::shared_ptr< Binder > | BinderOP |
typedef std::vector< BinderOP > | Binders |
Functions | |
string | template_specialization (clang::CXXRecordDecl const *C) |
string | class_name (CXXRecordDecl const *C) |
string | python_class_name (CXXRecordDecl const *C) |
string | class_qualified_name (CXXRecordDecl const *C) |
vector< QualType > | get_type_dependencies (CXXRecordDecl const *C) |
bool | is_inherited_from_enable_shared_from_this (CXXRecordDecl const *C) |
bool | is_field_assignable (FieldDecl const *f) |
bool | is_bindable (FieldDecl *f) |
check if generator can create binding More... | |
string | bind_data_member (FieldDecl const *d, string const &class_qualified_name) |
bool | is_const_overload (CXXMethodDecl *mc) |
bool | is_std_function_bindable (CXXRecordDecl const *C) |
bool | is_bindable_raw (clang::CXXRecordDecl const *C) |
check if generator can create binding More... | |
bool | is_bindable (clang::CXXRecordDecl const *C) |
check if generator can create binding More... | |
bool | is_binding_requested (clang::CXXRecordDecl const *C, Config const &config) |
check if user requested binding for the given declaration More... | |
bool | is_skipping_requested (clang::CXXRecordDecl const *C, Config const &config) |
check if user requested skipping for the given declaration More... | |
void | add_relevant_includes (clang::CXXRecordDecl const *C, IncludeSet &includes, int level) |
bool | base_default_default_constructor_available (CXXRecordDecl const *C) |
DEPRECATED Check if all bases have public default constructors. More... | |
string | binding_public_data_members (CXXRecordDecl const *C) |
string | callback_structure_name (CXXRecordDecl const *C) |
bool | is_callback_structure_needed (CXXRecordDecl const *C) |
bool | is_callback_structure_constructible (CXXRecordDecl const *C) |
string | bind_member_functions_for_call_back (CXXRecordDecl const *C, string const &class_name, set< string > &binded, int &ret_id, std::vector< clang::FunctionDecl const * > &prefix_includes) |
string | binding_public_member_functions (CXXRecordDecl const *C, bool callback_structure, bool callback_structure_constructible, Context &context) |
string | binding_template_bases (CXXRecordDecl const *C, bool callback_structure, bool callback_structure_constructible, Context &context) |
string | bind_forward_declaration (CXXRecordDecl const *C, Context &context) |
Create forward-binding for given class which consist of only class type without any member, function or constructors. More... | |
string | bind_constructor (ConstructorBindingInfo const &CBI, uint args_to_bind, bool request_bindings_f) |
string | bind_default_constructor (ConstructorBindingInfo const &CBI) |
Generate code for binding default constructor. More... | |
string | bind_copy_constructor (ConstructorBindingInfo const &CBI) |
string | bind_constructor (ConstructorBindingInfo const &CBI) |
std::string | class_name (clang::CXXRecordDecl const *C) |
std::string | class_qualified_name (clang::CXXRecordDecl const *C) |
std::vector< clang::QualType > | get_type_dependencies (clang::CXXRecordDecl const *C) |
std::vector< clang::NamedDecl const * > | get_decl_dependencies (clang::CXXRecordDecl const *C) |
std::string | bind_forward_declaration (clang::CXXRecordDecl const *C, Context &) |
Create forward-binding for given class which consist of only class type without any member, function or constructors. More... | |
std::pair< string, string > | split_in_two (string const &s, string const &error_string) |
Split string in two by ether space or tab character. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &os, Binder const &b) |
string | generate_include_directives (IncludeSet const &include_set) |
string | file_name_prefix_for_binder (BinderOP &b) |
Generate file name where binding for given generator should be stored. More... | |
void | add_relevant_includes (clang::EnumDecl const *E, IncludeSet &includes, int level) |
extract include needed for this generator and add it to includes vector More... | |
bool | is_bindable (EnumDecl const *E) |
check if generator can create binding More... | |
std::string | bind_enum (std::string const &module, EnumDecl const *E) |
bool | is_bindable (clang::EnumDecl const *E) |
check if generator can create binding More... | |
std::string | bind_enum (std::string const &module, clang::EnumDecl const *E) |
string | function_arguments (clang::FunctionDecl const *record) |
pair< string, string > | function_arguments_for_lambda (clang::FunctionDecl const *record, uint n) |
tuple< string, string, string > | function_arguments_for_py_overload (clang::FunctionDecl const *record) |
string | template_specialization (FunctionDecl const *F) |
string | python_function_name (FunctionDecl const *F) |
string | function_pointer_type (FunctionDecl const *F) |
string | function_qualified_name (FunctionDecl const *F, bool omit_return_type) |
vector< QualType > | get_type_dependencies (FunctionDecl const *F) |
generate human redable C++ type signature for given function More... | |
bool | is_binding_requested (FunctionDecl const *F, Config const &config) |
check if user requested binding for the given declaration More... | |
bool | is_skipping_requested (FunctionDecl const *F, Config const &config) |
check if user requested skipping for the given declaration More... | |
string | bind_function (FunctionDecl const *F, uint args_to_bind, bool request_bindings_f, Context &context, CXXRecordDecl const *parent, bool always_use_lambda) |
string | bind_function (string const &module, FunctionDecl const *F, Context &context, CXXRecordDecl const *parent, bool always_use_lambda) |
void | add_relevant_includes (FunctionDecl const *F, IncludeSet &includes, int level) |
extract include needed for this generator and add it to includes vector More... | |
bool | is_bindable (FunctionDecl const *F) |
check if generator can create binding More... | |
bool | is_overloadable (CXXMethodDecl const *M) |
check if methods could be overload in Python More... | |
std::string | python_function_name (clang::FunctionDecl const *F) |
std::string | function_pointer_type (clang::FunctionDecl const *record) |
std::string | function_qualified_name (clang::FunctionDecl const *F, bool omit_return_type=false) |
bool | is_binding_requested (clang::FunctionDecl const *F, Config const &config) |
check if user requested binding for the given declaration More... | |
bool | is_skipping_requested (clang::FunctionDecl const *F, Config const &config) |
check if user requested skipping for the given declaration More... | |
std::string | bind_function (std::string const &module, clang::FunctionDecl const *F, Context &, clang::CXXRecordDecl const *parent=nullptr, bool always_use_lambda=false) |
void | add_relevant_includes (clang::FunctionDecl const *F, IncludeSet &includes, int level) |
extract include needed for this generator and add it to includes vector More... | |
bool | is_bindable (clang::FunctionDecl const *F) |
check if generator can create binding More... | |
bool | is_overloadable (clang::CXXMethodDecl const *M) |
check if methods could be overload in Python More... | |
bool | is_binding_requested (clang::QualType const &qt, Config const &config) |
check if user requested binding for the given QualType More... | |
bool | is_skipping_requested (QualType const &qt, Config const &config) |
string | relevant_include (NamedDecl const *decl) |
void | add_relevant_include_for_decl (NamedDecl const *decl, IncludeSet &includes) |
void | add_relevant_includes (QualType const &qt, IncludeSet &includes, int level) |
extract include needed for this generator and add it to includes vector More... | |
bool | is_bindable (QualType const &qt) |
void | request_bindings (clang::QualType const &qt, Context &context) |
extract type info from QualType if any and bind relative type More... | |
string | standard_name (string const &type) |
string | simplify_std_class_name (string const &type) |
Attempt to simplify std:: name by removing unneded template arguments. Function assume that there is no 'std::' namespaces prefix at the beginning of the argument string. More... | |
bool | is_python_builtin (NamedDecl const *C) |
check if given class/struct is builtin in Python and therefor should not be binded More... | |
bool | is_banned_symbol (clang::NamedDecl const *D) |
bool | is_skipping_requested (clang::QualType const &qt, Config const &config) |
check if user requested skipping for the given QualType More... | |
std::string | relevant_include (clang::NamedDecl const *decl) |
void | add_relevant_include_for_decl (clang::NamedDecl const *decl, IncludeSet &includes) |
void | add_relevant_includes (clang::QualType const &qt, IncludeSet &includes, int level) |
extract include needed for this generator and add it to includes vector More... | |
bool | is_bindable (clang::QualType const &qt) |
bool | is_python_builtin (clang::NamedDecl const *C) |
check if given class/struct is builtin in Python and therefor should not be binded More... | |
vector< string > | split (string const &buffer, string const &separator) |
Split string using given separator. More... | |
void | replace (string &r, string const &from, string const &to) |
Replace all occurrences of string. More... | |
string | replace_ (string const &s, string const &from, string const &to) |
Replace all occurrences of string and return result as new string. More... | |
bool | begins_with (std::string const &source, std::string const &prefix) |
check if string begins with given prefix More... | |
bool | ends_with (std::string const &source, std::string const &prefix) |
check if string ends with given prefix More... | |
string | indent (std::string const &code, std::string const &indentation) |
indent given code More... | |
void | update_source_file (std::string const &prefix, std::string const &file_name, std::string const &code) |
Try to read exisitng file and if content does not match to code - write a new version. Also create nested dirs starting from prefix if nessesary. More... | |
string | namespace_from_named_decl (NamedDecl const *decl) |
string | typename_from_type_decl (TypeDecl *decl) |
generate unique string representation of type represented by given declaration More... | |
string | base_namespace (string const &ns) |
Calculate base (upper) namespace for given one: core::pose::motif –> core::pose. More... | |
string | last_namespace (string const &ns) |
Calculate last namespace for given one: core::pose::motif –> motif. More... | |
void | fix_boolean_types (std::string &type) |
replace all _Bool types with bool More... | |
string | expresion_to_string (clang::Expr *e) |
Generate string representation of given expression. More... | |
string | template_argument_to_string (clang::TemplateArgument const &) |
Generate string representation of given TemplateArgument. More... | |
string | line_number (NamedDecl const *decl) |
string | mangle_type_name (string const &name, bool mark_template) |
string | generate_comment_for_declaration (clang::NamedDecl const *decl) |
string | get_text (comments::Comment const *C, SourceManager const &SM, SourceLocation previous) |
std::string | generate_documentation_string_for_declaration (clang::Decl const *decl) |
std::string | namespace_from_named_decl (clang::NamedDecl const *decl) |
calculate namespace path from given NamedDecl, like: std, core::pose More... | |
std::string | typename_from_type_decl (clang::TypeDecl *decl) |
std::string | line_number (clang::NamedDecl const *decl) |
calcualte line in source file for NamedDecl More... | |
Variables | |
const char * | call_back_function_body_template |
char const * | constructor_template = "\tcl.def( pybind11::init( []({0}){{ return new {2}({1}); }} ), \"doc\");" |
char const * | constructor_with_trampoline_template = "\tcl.def( pybind11::init( []({0}){{ return new {2}({1}); }}, []({0}){{ return new {3}({1}); }} ), \"doc\");" |
const char * | main_module_header |
const char * | module_header |
const char * | module_function_suffix = "(std::function< pybind11::module &(std::string const &namespace_) > &M)" |
static std::map< string, string > const | cpp_python_operator_map |
typedef std::shared_ptr< Binder > binder::BinderOP |
typedef std::vector<BinderOP> binder::Binders |
void binder::add_relevant_include_for_decl | ( | clang::NamedDecl const * | decl, |
IncludeSet & | includes | ||
) |
void binder::add_relevant_include_for_decl | ( | NamedDecl const * | decl, |
IncludeSet & | includes | ||
) |
void binder::add_relevant_includes | ( | clang::EnumDecl const * | E, |
IncludeSet & | includes, | ||
int | level | ||
) |
extract include needed for this generator and add it to includes vector
References binder::IncludeSet::add_decl(), and add_relevant_include_for_decl().
void binder::add_relevant_includes | ( | clang::QualType const & | qt, |
IncludeSet & | includes, | ||
int | level | ||
) |
extract include needed for this generator and add it to includes vector
void binder::add_relevant_includes | ( | clang::FunctionDecl const * | F, |
IncludeSet & | includes, | ||
int | level | ||
) |
extract include needed for this generator and add it to includes vector
void binder::add_relevant_includes | ( | QualType const & | qt, |
IncludeSet & | includes, | ||
int | level | ||
) |
extract include needed for this generator and add it to includes vector
References test.T009_Exceptions::e, and basic::options::OptionKeys::out::level.
void binder::add_relevant_includes | ( | clang::CXXRecordDecl const * | C, |
IncludeSet & | includes, | ||
int | level | ||
) |
References binder::IncludeSet::add_decl(), add_relevant_include_for_decl(), test.T020_Pose_Bindings::ft, ObjexxFCL::get(), is_bindable(), is_skipping_requested(), test.T110_Numeric::m, basic::options::OptionKeys::in::file::s, basic::options::OptionKeys::in::file::t, and test.T850_SubClassing::v.
Referenced by binder::EnumBinder::add_relevant_includes(), binder::ClassBinder::add_relevant_includes(), binder::FunctionBinder::add_relevant_includes(), and add_relevant_includes().
void binder::add_relevant_includes | ( | FunctionDecl const * | F, |
IncludeSet & | includes, | ||
int | level | ||
) |
extract include needed for this generator and add it to includes vector
References binder::IncludeSet::add_decl(), add_relevant_include_for_decl(), add_relevant_includes(), get_type_dependencies(), and basic::options::OptionKeys::in::file::t.
bool binder::base_default_default_constructor_available | ( | CXXRecordDecl const * | C | ) |
DEPRECATED Check if all bases have public default constructors.
References basic::options::OptionKeys::score::fiber_diffraction::b, and basic::options::OptionKeys::in::file::t.
Referenced by binder::ClassBinder::bind().
std::string binder::base_namespace | ( | string const & | ns | ) |
Calculate base (upper) namespace for given one: core::pose::motif –> core::pose.
References demo.D060_Folding::f.
Referenced by binder::Context::create_all_nested_namespaces(), and binder::Context::generate().
bool binder::begins_with | ( | std::string const & | source, |
std::string const & | prefix | ||
) |
check if string begins with given prefix
References erraser_single_res_analysis::prefix.
Referenced by add_relevant_include_for_decl(), bind_function(), file_name_prefix_for_binder(), is_banned_symbol(), is_bindable(), binder::Config::is_include_skipping_requested(), binder::Config::is_namespace_binding_requested(), binder::Config::is_namespace_skipping_requested(), and standard_name().
string binder::bind_constructor | ( | ConstructorBindingInfo const & | CBI, |
uint | args_to_bind, | ||
bool | request_bindings_f | ||
) |
References DRRAFTER::args, binder::ConstructorBindingInfo::C, binder::ConstructorBindingInfo::class_qualified_name, constructor_template, constructor_with_trampoline_template, binder::ConstructorBindingInfo::context, fmt::format(), function_arguments(), function_arguments_for_lambda(), basic::options::OptionKeys::dna::specificity::params, request_bindings(), binder::ConstructorBindingInfo::T, binder::ConstructorBindingInfo::trampoline, and binder::ConstructorBindingInfo::trampoline_qualified_name.
string binder::bind_constructor | ( | ConstructorBindingInfo const & | CBI | ) |
References binder::ConstructorBindingInfo::T.
Referenced by binder::ClassBinder::bind().
string binder::bind_copy_constructor | ( | ConstructorBindingInfo const & | CBI | ) |
Generate copy constructor in most cases this will be just: "\tcl.def(pybind11::init<{} const &>());\n"_format(binding_qualified_name); but for POD structs with zero data mambers this will be a lambda function. This is done as a workaround for Pybind11 2,2+ bug
References binder::ConstructorBindingInfo::C, binder::ConstructorBindingInfo::class_qualified_name, binder::ConstructorBindingInfo::T, binder::ConstructorBindingInfo::trampoline, and binder::ConstructorBindingInfo::trampoline_qualified_name.
Referenced by binder::ClassBinder::bind().
string binder::bind_data_member | ( | FieldDecl const * | d, |
string const & | class_qualified_name | ||
) |
References class_qualified_name().
Referenced by binding_public_data_members().
string binder::bind_default_constructor | ( | ConstructorBindingInfo const & | CBI | ) |
Generate code for binding default constructor.
References binder::ConstructorBindingInfo::C, binder::ConstructorBindingInfo::class_qualified_name, binder::ConstructorBindingInfo::trampoline, and binder::ConstructorBindingInfo::trampoline_qualified_name.
Referenced by binder::ClassBinder::bind().
std::string binder::bind_enum | ( | std::string const & | module, |
clang::EnumDecl const * | E | ||
) |
std::string binder::bind_enum | ( | std::string const & | module, |
EnumDecl const * | E | ||
) |
References test.T009_Exceptions::e, generate_documentation_string_for_declaration(), and name.
Referenced by binder::EnumBinder::bind(), and binder::ClassBinder::bind().
std::string binder::bind_forward_declaration | ( | clang::CXXRecordDecl const * | C, |
Context & | |||
) |
Create forward-binding for given class which consist of only class type without any member, function or constructors.
string binder::bind_forward_declaration | ( | CXXRecordDecl const * | C, |
Context & | context | ||
) |
Create forward-binding for given class which consist of only class type without any member, function or constructors.
References class_qualified_name(), is_inherited_from_enable_shared_from_this(), line_number(), binder::Context::module_variable_name(), namespace_from_named_decl(), python_class_name(), and relevant_include().
std::string binder::bind_function | ( | std::string const & | module, |
clang::FunctionDecl const * | F, | ||
Context & | , | ||
clang::CXXRecordDecl const * | parent = nullptr , |
||
bool | always_use_lambda = false |
||
) |
string binder::bind_function | ( | FunctionDecl const * | F, |
uint | args_to_bind, | ||
bool | request_bindings_f, | ||
Context & | context, | ||
CXXRecordDecl const * | parent, | ||
bool | always_use_lambda | ||
) |
References DRRAFTER::args, begins_with(), class_qualified_name(), ObjexxFCL::format::F(), function_arguments(), function_arguments_for_lambda(), function_pointer_type(), function_qualified_name(), generate_documentation_string_for_declaration(), ObjexxFCL::get(), test.T110_Numeric::m, basic::options::OptionKeys::score::fiber_diffraction::p, python_function_name(), request_bindings(), standard_name(), and template_specialization().
Referenced by binding_public_member_functions().
string binder::bind_function | ( | string const & | module, |
FunctionDecl const * | F, | ||
Context & | context, | ||
CXXRecordDecl const * | parent, | ||
bool | always_use_lambda | ||
) |
Referenced by binder::FunctionBinder::bind().
string binder::bind_member_functions_for_call_back | ( | CXXRecordDecl const * | C, |
string const & | class_name, | ||
set< string > & | binded, | ||
int & | ret_id, | ||
std::vector< clang::FunctionDecl const * > & | prefix_includes | ||
) |
References DRRAFTER::args, basic::options::OptionKeys::score::fiber_diffraction::b, call_back_function_body_template, fix_boolean_types(), fmt::format(), function_arguments_for_py_overload(), ObjexxFCL::get(), indent(), is_bindable(), is_const_overload(), is_overloadable(), is_skipping_requested(), basic::options::OptionKeys::cloud::key, test.T110_Numeric::m, basic::options::OptionKeys::stepwise::move, python_function_name(), and numeric::interpolation::to_string().
Referenced by binder::ClassBinder::generate_prefix_code().
string binder::binding_public_data_members | ( | CXXRecordDecl const * | C | ) |
References bind_data_member(), class_qualified_name(), demo.D060_Folding::f, is_bindable(), and basic::options::OptionKeys::in::file::s.
Referenced by binder::ClassBinder::bind(), and binding_template_bases().
|
inline |
References namespace_from_named_decl(), python_class_name(), and replace_().
Referenced by binder::ClassBinder::bind(), and binder::ClassBinder::generate_prefix_code().
std::string binder::class_name | ( | clang::CXXRecordDecl const * | C | ) |
string binder::class_name | ( | CXXRecordDecl const * | C | ) |
References namespace_from_named_decl(), res, simplify_std_class_name(), standard_name(), and template_specialization().
Referenced by python_class_name().
std::string binder::class_qualified_name | ( | clang::CXXRecordDecl const * | C | ) |
string binder::class_qualified_name | ( | CXXRecordDecl const * | C | ) |
References standard_name(), and template_specialization().
Referenced by binder::Context::add_to_binded(), binder::ClassBinder::bind(), bind_data_member(), bind_forward_declaration(), bind_function(), binder::ClassBinder::bind_repr(), binding_public_data_members(), function_pointer_type(), binder::ClassBinder::generate_prefix_code(), binder::Context::global_insertion_operator(), binder::ClassBinder::id(), is_binding_requested(), binder::Context::is_forward_needed(), is_skipping_requested(), binder::ClassBinder::maybe_base_classes(), and binder::Context::sort_binders().
bool binder::ends_with | ( | std::string const & | source, |
std::string const & | prefix | ||
) |
check if string ends with given prefix
References erraser_single_res_analysis::prefix.
std::string binder::expresion_to_string | ( | clang::Expr * | e | ) |
Generate string representation of given expression.
References basic::options::OptionKeys::in::file::s.
string binder::file_name_prefix_for_binder | ( | BinderOP & | b | ) |
Generate file name where binding for given generator should be stored.
References begins_with(), namespace_from_named_decl(), relevant_include(), and replace().
Referenced by binder::Context::generate().
void binder::fix_boolean_types | ( | string & | type | ) |
replace all _Bool types with bool
Referenced by bind_member_functions_for_call_back(), binder::ClassBinder::bind_with(), function_arguments(), function_arguments_for_lambda(), function_arguments_for_py_overload(), function_pointer_type(), function_qualified_name(), binder::Context::global_insertion_operator(), standard_name(), and template_specialization().
std::string binder::function_arguments | ( | clang::FunctionDecl const * | record | ) |
References fix_boolean_types(), and standard_name().
Referenced by binder::FunctionBinder::bind(), bind_constructor(), bind_function(), function_pointer_type(), and function_qualified_name().
std::pair< std::string, std::string > binder::function_arguments_for_lambda | ( | clang::FunctionDecl const * | record, |
uint | n | ||
) |
References basic::options::OptionKeys::score::fiber_diffraction::a, fix_boolean_types(), and numeric::interpolation::to_string().
Referenced by bind_constructor(), and bind_function().
std::tuple< std::string, std::string, std::string > binder::function_arguments_for_py_overload | ( | clang::FunctionDecl const * | record | ) |
std::string binder::function_pointer_type | ( | clang::FunctionDecl const * | record | ) |
string binder::function_pointer_type | ( | FunctionDecl const * | F | ) |
References class_qualified_name(), fix_boolean_types(), function_arguments(), test.T110_Numeric::m, erraser_single_res_analysis::prefix, and standard_name().
Referenced by binder::Context::add_insertion_operator(), and bind_function().
std::string binder::function_qualified_name | ( | clang::FunctionDecl const * | F, |
bool | omit_return_type = false |
||
) |
string binder::function_qualified_name | ( | FunctionDecl const * | F, |
bool | omit_return_type | ||
) |
References fix_boolean_types(), function_arguments(), test.T110_Numeric::m, standard_name(), and template_specialization().
Referenced by bind_function(), binder::FunctionBinder::id(), is_binding_requested(), is_const_overload(), and is_skipping_requested().
std::string binder::generate_comment_for_declaration | ( | clang::NamedDecl const * | decl | ) |
References line_number(), relevant_include(), and standard_name().
Referenced by binder::EnumBinder::bind(), binder::ClassBinder::bind(), binder::ClassBinder::bind_with(), and binder::ClassBinder::generate_prefix_code().
std::string binder::generate_documentation_string_for_declaration | ( | clang::Decl const * | decl | ) |
References get_text(), replace(), and utility::options::OptionKeys::options::table::text.
Referenced by binder::ClassBinder::bind(), bind_enum(), and bind_function().
string binder::generate_include_directives | ( | IncludeSet const & | include_set | ) |
References ObjexxFCL::get(), and binder::IncludeSet::includes().
Referenced by binder::Context::generate().
std::vector<clang::NamedDecl const *> binder::get_decl_dependencies | ( | clang::CXXRecordDecl const * | C | ) |
string binder::get_text | ( | comments::Comment const * | C, |
SourceManager const & | SM, | ||
SourceLocation | previous | ||
) |
Referenced by generate_documentation_string_for_declaration().
std::vector<clang::QualType> binder::get_type_dependencies | ( | clang::CXXRecordDecl const * | C | ) |
vector<QualType> binder::get_type_dependencies | ( | CXXRecordDecl const * | C | ) |
References basic::options::OptionKeys::in::file::t.
Referenced by is_binding_requested(), and is_skipping_requested().
vector<QualType> binder::get_type_dependencies | ( | FunctionDecl const * | F | ) |
generate human redable C++ type signature for given function
Referenced by add_relevant_includes(), is_binding_requested(), and is_skipping_requested().
std::string binder::indent | ( | string const & | code, |
string const & | indentation | ||
) |
indent given code
References basic::options::OptionKeys::in::file::l, erraser_analysis::lines, and split().
Referenced by binder::ClassBinder::bind(), bind_member_functions_for_call_back(), basic::YamlEmitter::do_indent(), basic::JsonEmitter::do_indent(), basic::YamlEmitter::end_raw(), utility::options::OptionCollection::load_options_from_stream(), basic::Emitter::start_list(), basic::Emitter::start_map(), basic::YamlEmitter::start_raw(), basic::JsonEmitter::start_raw(), and basic::YamlEmitter::write_list_marker().
bool binder::is_banned_symbol | ( | clang::NamedDecl const * | D | ) |
References begins_with(), name, and standard_name().
Referenced by is_bindable(), and is_bindable_raw().
bool binder::is_bindable | ( | clang::EnumDecl const * | E | ) |
check if generator can create binding
bool binder::is_bindable | ( | EnumDecl const * | E | ) |
check if generator can create binding
References name.
Referenced by binder::EnumBinder::bindable().
bool binder::is_bindable | ( | clang::QualType const & | qt | ) |
bool binder::is_bindable | ( | clang::FunctionDecl const * | F | ) |
check if generator can create binding
bool binder::is_bindable | ( | FieldDecl * | f | ) |
check if generator can create binding
References is_field_assignable().
Referenced by binder::FunctionBinder::bindable(), BinderVisitor::VisitCXXRecordDecl(), and BinderVisitor::VisitFunctionDecl().
bool binder::is_bindable | ( | clang::CXXRecordDecl const * | C | ) |
check if generator can create binding
References is_bindable_raw().
Referenced by add_relevant_includes(), binder::ClassBinder::bind(), bind_member_functions_for_call_back(), binder::ClassBinder::bind_nested_classes(), binder::ClassBinder::bindable(), binding_public_data_members(), binding_public_member_functions(), is_callback_structure_constructible(), is_callback_structure_needed(), is_std_function_bindable(), and binder::ClassBinder::maybe_base_classes().
bool binder::is_bindable | ( | QualType const & | qt | ) |
References begins_with(), and standard_name().
bool binder::is_bindable | ( | FunctionDecl const * | F | ) |
check if generator can create binding
References cpp_python_operator_map, ObjexxFCL::format::F(), is_banned_symbol(), and basic::options::OptionKeys::score::fiber_diffraction::p.
bool binder::is_bindable_raw | ( | clang::CXXRecordDecl const * | C | ) |
check if generator can create binding
References is_banned_symbol(), is_const_overload(), is_python_builtin(), is_std_function_bindable(), and test.T110_Numeric::m.
Referenced by is_bindable().
bool binder::is_binding_requested | ( | clang::QualType const & | qt, |
Config const & | config | ||
) |
check if user requested binding for the given QualType
References basic::options::OptionKeys::frags::scoring::config.
bool binder::is_binding_requested | ( | clang::FunctionDecl const * | F, |
Config const & | config | ||
) |
check if user requested binding for the given declaration
bool binder::is_binding_requested | ( | FunctionDecl const * | F, |
Config const & | config | ||
) |
check if user requested binding for the given declaration
References function_qualified_name(), get_type_dependencies(), is_binding_requested(), binder::Config::is_function_binding_requested(), binder::Config::is_namespace_binding_requested(), namespace_from_named_decl(), and basic::options::OptionKeys::in::file::t.
Referenced by binder::FunctionBinder::request_bindings_and_skipping().
bool binder::is_binding_requested | ( | clang::CXXRecordDecl const * | C, |
Config const & | config | ||
) |
check if user requested binding for the given declaration
References class_qualified_name(), get_type_dependencies(), binder::Config::is_class_binding_requested(), binder::Config::is_namespace_binding_requested(), is_skipping_requested(), namespace_from_named_decl(), standard_name(), and basic::options::OptionKeys::in::file::t.
Referenced by is_binding_requested(), and binder::ClassBinder::request_bindings_and_skipping().
bool binder::is_callback_structure_constructible | ( | CXXRecordDecl const * | C | ) |
References basic::options::OptionKeys::score::fiber_diffraction::b, ObjexxFCL::get(), is_bindable(), is_skipping_requested(), and test.T110_Numeric::m.
Referenced by binder::ClassBinder::bind().
bool binder::is_callback_structure_needed | ( | CXXRecordDecl const * | C | ) |
References basic::options::OptionKeys::score::fiber_diffraction::b, is_bindable(), and test.T110_Numeric::m.
Referenced by binder::ClassBinder::bind(), and binder::ClassBinder::generate_prefix_code().
bool binder::is_const_overload | ( | CXXMethodDecl * | mc | ) |
References C, function_qualified_name(), test.T110_Numeric::m, and name.
Referenced by bind_member_functions_for_call_back(), binding_public_member_functions(), and is_bindable_raw().
bool binder::is_field_assignable | ( | FieldDecl const * | f | ) |
References C, and test.T110_Numeric::m.
Referenced by is_bindable().
bool binder::is_inherited_from_enable_shared_from_this | ( | CXXRecordDecl const * | C | ) |
References basic::options::OptionKeys::score::fiber_diffraction::b.
Referenced by binder::ClassBinder::bind(), and bind_forward_declaration().
bool binder::is_overloadable | ( | clang::CXXMethodDecl const * | M | ) |
check if methods could be overload in Python
bool binder::is_overloadable | ( | CXXMethodDecl const * | M | ) |
check if methods could be overload in Python
Referenced by bind_member_functions_for_call_back().
bool binder::is_python_builtin | ( | clang::NamedDecl const * | C | ) |
check if given class/struct is builtin in Python and therefor should not be binded
bool binder::is_python_builtin | ( | NamedDecl const * | C | ) |
check if given class/struct is builtin in Python and therefor should not be binded
References name, and standard_name().
Referenced by is_bindable_raw(), binder::Binder::is_binded(), binder::Context::is_forward_needed(), and binder::Context::request_bindings().
bool binder::is_skipping_requested | ( | clang::QualType const & | qt, |
Config const & | config | ||
) |
check if user requested skipping for the given QualType
bool binder::is_skipping_requested | ( | QualType const & | qt, |
Config const & | config | ||
) |
References basic::options::OptionKeys::frags::scoring::config.
Referenced by request_bindings().
bool binder::is_skipping_requested | ( | clang::FunctionDecl const * | F, |
Config const & | config | ||
) |
check if user requested skipping for the given declaration
bool binder::is_skipping_requested | ( | FunctionDecl const * | F, |
Config const & | config | ||
) |
check if user requested skipping for the given declaration
References C, function_qualified_name(), get_type_dependencies(), binder::Config::is_function_skipping_requested(), binder::Config::is_namespace_skipping_requested(), test.T007_TracerIO::M, name, namespace_from_named_decl(), basic::options::OptionKeys::rescore::skip, standard_name(), and basic::options::OptionKeys::in::file::t.
Referenced by binder::FunctionBinder::request_bindings_and_skipping().
bool binder::is_skipping_requested | ( | clang::CXXRecordDecl const * | C, |
Config const & | config | ||
) |
check if user requested skipping for the given declaration
References class_qualified_name(), get_type_dependencies(), binder::Config::is_class_skipping_requested(), binder::Config::is_namespace_skipping_requested(), namespace_from_named_decl(), basic::options::OptionKeys::rescore::skip, standard_name(), and basic::options::OptionKeys::in::file::t.
Referenced by add_relevant_includes(), binder::ClassBinder::bind(), bind_member_functions_for_call_back(), binding_public_member_functions(), binding_template_bases(), is_binding_requested(), is_callback_structure_constructible(), binder::ClassBinder::maybe_base_classes(), and binder::ClassBinder::request_bindings_and_skipping().
bool binder::is_std_function_bindable | ( | CXXRecordDecl const * | C | ) |
References test.T020_Pose_Bindings::ft, is_bindable(), and basic::options::OptionKeys::in::file::t.
Referenced by is_bindable_raw().
std::string binder::last_namespace | ( | string const & | ns | ) |
Calculate last namespace for given one: core::pose::motif –> motif.
References demo.D060_Folding::f.
Referenced by binder::Context::generate().
std::string binder::line_number | ( | clang::NamedDecl const * | decl | ) |
calcualte line in source file for NamedDecl
string binder::line_number | ( | NamedDecl const * | decl | ) |
References numeric::interpolation::to_string().
Referenced by binder::FunctionBinder::bind(), bind_forward_declaration(), and generate_comment_for_declaration().
std::string binder::mangle_type_name | ( | string const & | name, |
bool | mark_template | ||
) |
Referenced by binder::ClassBinder::bind_with(), and python_class_name().
std::string binder::namespace_from_named_decl | ( | clang::NamedDecl const * | decl | ) |
calculate namespace path from given NamedDecl, like: std, core::pose
string binder::namespace_from_named_decl | ( | NamedDecl const * | decl | ) |
References basic::options::OptionKeys::in::path::path, and standard_name().
Referenced by binder::EnumBinder::bind(), binder::ClassBinder::bind(), binder::FunctionBinder::bind(), bind_forward_declaration(), binder::ClassBinder::bind_with(), callback_structure_name(), class_name(), binder::Context::create_all_nested_namespaces(), file_name_prefix_for_binder(), binder::Context::generate(), is_binding_requested(), is_skipping_requested(), and binder::EnumBinder::request_bindings_and_skipping().
llvm::raw_ostream & binder::operator<< | ( | llvm::raw_ostream & | os, |
Binder const & | b | ||
) |
References name, binder::Binder::named_decl(), and basic::options::OptionKeys::in::path::path.
string binder::python_class_name | ( | CXXRecordDecl const * | C | ) |
References class_name(), mangle_type_name(), and name.
Referenced by binder::ClassBinder::bind(), bind_forward_declaration(), and callback_structure_name().
std::string binder::python_function_name | ( | clang::FunctionDecl const * | F | ) |
string binder::python_function_name | ( | FunctionDecl const * | F | ) |
References cpp_python_operator_map.
Referenced by bind_function(), and bind_member_functions_for_call_back().
std::string binder::relevant_include | ( | clang::NamedDecl const * | decl | ) |
string binder::relevant_include | ( | NamedDecl const * | decl | ) |
void binder::replace | ( | string & | r, |
string const & | from, | ||
string const & | to | ||
) |
Replace all occurrences of string.
Replace all occurrences of string inplace.
Referenced by utility::file::PathName::assign(), utility::file::FileName::assign(), erraser_wrapper::erraser(), erraser_wrapper::erraser_single_res(), erraser_util::extract_pdb(), file_name_prefix_for_binder(), erraser_option.erraser_option::finalize(), erraser_util::find_chi_angle(), erraser_single_res_analysis::find_chi_angle_std_pdb(), erraser_analysis::find_chi_angle_std_pdb(), binder::Context::generate(), generate_documentation_string_for_declaration(), DRRAFTER::get_coord_csts(), get_final_ddG_scores::get_scores(), DRRAFTER::get_sequences(), find_lowest_scoring_relaxed_struct::main(), get_lowest_scoring_relaxed_models::main(), get_final_ddG_scores::main(), utility::file::PathName::path(), utility::file::FileName::path(), erraser_util::phenix_rna_validate(), replace_(), erraser_util::rosetta2phenix_merge_back(), self-test::run_test(), erraser_wrapper::seq_rebuild(), erraser_wrapper::seq_rebuild_new(), standard_name(), and erraser_wrapper::SWA_rebuild_erraser().
std::string binder::replace_ | ( | string const & | s, |
string const & | from, | ||
string const & | to | ||
) |
Replace all occurrences of string and return result as new string.
References replace().
Referenced by callback_structure_name(), and binder::Context::generate().
void binder::request_bindings | ( | clang::QualType const & | qt, |
Context & | context | ||
) |
extract type info from QualType if any and bind relative type
References ObjexxFCL::get(), is_skipping_requested(), binder::Context::request_bindings(), and typename_from_type_decl().
Referenced by bind_constructor(), bind_function(), binder::ClassBinder::maybe_base_classes(), binder::EnumBinder::request_bindings_and_skipping(), binder::ClassBinder::request_bindings_and_skipping(), and binder::FunctionBinder::request_bindings_and_skipping().
std::string binder::simplify_std_class_name | ( | string const & | type | ) |
Attempt to simplify std:: name by removing unneded template arguments. Function assume that there is no 'std::' namespaces prefix at the beginning of the argument string.
References basic::options::OptionKeys::score::fiber_diffraction::p, res, and DRRAFTER::type.
Referenced by class_name(), and standard_name().
std::vector< std::string > binder::split | ( | string const & | buffer, |
string const & | separator | ||
) |
Split string using given separator.
References line, and erraser_analysis::lines.
Referenced by pyrosetta.distributed.dask::_normflags(), make_bindings_via_cmake::compile_sources(), build::create_package(), pyrosetta.distributed.dask.worker::dask_setup(), erraser_wrapper::erraser_single_res(), arls_impl::find_programs(), build::generate_bindings(), build::generate_rosetta_external_cmake_files(), build::get_compiler_version(), erraser_util::get_fasta(), build::get_rosetta_include_directories(), build::get_rosetta_system_include_directories(), apps::pilot::frankdt::import_motifs(), indent(), get_final_ddG_scores::main(), best_ifaceE::main(), get_scores::main(), prune_atdiff_top5pct::main(), sphinx-doc-generator::main(), make_bindings_via_cmake::make_bindings_code(), erraser_util::pdb2rosetta(), erraser_util::phenix_rna_validate(), register_options(), pyrosetta.bindings.energies::residue_pair_energies_array(), erraser_util::rosetta2phenix_merge_back(), run(), self-test::run_test(), demo.D090_Ala_scan::scanning_analysis(), split_in_two(), erraser_util::subprocess_out(), update_source_file(), and pyrosetta::version().
std::pair<string, string> binder::split_in_two | ( | string const & | s, |
string const & | error_string | ||
) |
Split string in two by ether space or tab character.
References min(), ObjexxFCL::space(), and split().
Referenced by binder::Config::read().
std::string binder::standard_name | ( | string const & | type | ) |
References begins_with(), fix_boolean_types(), basic::options::OptionKeys::score::fiber_diffraction::p, replace(), and simplify_std_class_name().
Referenced by binder::ClassBinder::add_relevant_includes(), binder::ClassBinder::bind(), bind_function(), binder::ClassBinder::bind_with(), class_name(), class_qualified_name(), function_arguments(), function_pointer_type(), function_qualified_name(), generate_comment_for_declaration(), binder::Context::global_insertion_operator(), is_banned_symbol(), is_bindable(), is_binding_requested(), is_python_builtin(), is_skipping_requested(), binder::ClassBinder::maybe_base_classes(), namespace_from_named_decl(), template_specialization(), and typename_from_type_decl().
std::string binder::template_argument_to_string | ( | clang::TemplateArgument const & | t | ) |
Generate string representation of given TemplateArgument.
References basic::options::OptionKeys::in::file::s.
Referenced by binder::ClassBinder::bind_with(), and template_specialization().
std::string binder::template_specialization | ( | clang::CXXRecordDecl const * | C | ) |
References fix_boolean_types(), basic::options::OptionKeys::in::file::t, and template_argument_to_string().
Referenced by binder::ClassBinder::bind_with(), class_name(), and class_qualified_name().
string binder::template_specialization | ( | FunctionDecl const * | F | ) |
References fmt::arg(), fix_boolean_types(), standard_name(), and template_argument_to_string().
Referenced by bind_function(), and function_qualified_name().
std::string binder::typename_from_type_decl | ( | clang::TypeDecl * | decl | ) |
string binder::typename_from_type_decl | ( | TypeDecl * | decl | ) |
generate unique string representation of type represented by given declaration
References standard_name().
Referenced by binder::Context::add(), and request_bindings().
void binder::update_source_file | ( | std::string const & | prefix, |
std::string const & | file_name, | ||
std::string const & | code | ||
) |
Try to read exisitng file and if content does not match to code - write a new version. Also create nested dirs starting from prefix if nessesary.
References demo.D060_Folding::f, O_verbose, basic::options::OptionKeys::in::path::path, erraser_single_res_analysis::prefix, and split().
const char* binder::call_back_function_body_template |
Referenced by bind_member_functions_for_call_back().
char const* binder::constructor_template = "\tcl.def( pybind11::init( []({0}){{ return new {2}({1}); }} ), \"doc\");" |
Referenced by bind_constructor().
char const* binder::constructor_with_trampoline_template = "\tcl.def( pybind11::init( []({0}){{ return new {2}({1}); }}, []({0}){{ return new {3}({1}); }} ), \"doc\");" |
Referenced by bind_constructor().
|
static |
Referenced by is_bindable(), and python_function_name().
const char* binder::main_module_header |
Referenced by binder::Context::generate().
const char* binder::module_function_suffix = "(std::function< pybind11::module &(std::string const &namespace_) > &M)" |
Referenced by binder::Context::generate().
const char* binder::module_header |
Referenced by binder::Context::generate().