Rosetta
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
binder::Context Class Reference

Context - root, hold bindings info for whole TranslationUnit. More...

#include <context.hpp>

Public Member Functions

void add (BinderOP &)
 
void generate (Config const &config)
 
void request_bindings (std::string const &type)
 find binder related to given type name and bind it More...
 
string module_variable_name (string const &namespace_)
 generate C++ expression for module variable for namespace_ More...
 
void add_insertion_operator (clang::FunctionDecl const *f)
 
clang::FunctionDecl const * global_insertion_operator (clang::CXXRecordDecl const *)
 find global insertion operator for given type, otherwise return nullptr More...
 
std::string trace_line (std::string const &info)
 generate unique trace line containing info to insert into the code More...
 

Private Types

typedef std::string string
 

Private Member Functions

void bind (Config const &config)
 bind all objects residing in namespaces and their dependencies More...
 
std::set< stringcreate_all_nested_namespaces ()
 examine binded objects and recursivly create all nested namespaces More...
 
bool is_forward_needed (clang::CXXRecordDecl const *)
 check if forward declaration for CXXRecordDecl needed More...
 
void add_to_binded (clang::CXXRecordDecl const *)
 add given class to 'already binded' set More...
 
void sort_binders ()
 sort vector of binders by dependency so python imports could work More...
 

Private Attributes

std::map< std::string, clang::FunctionDecl const * > insertion_operators
 map of function-ptr -> Decl* for global instertion operators so we can determine for which types we can bind repr More...
 
std::vector< BinderOPbinders
 array of all binders from translation unit More...
 
std::unordered_map< string, BinderOPtypes
 types → binder More...
 
std::unordered_set< stringids
 set of items unique id's to keep track of binders being added More...
 
std::set< stringbinded
 set of items unique id's to keep track of what is binded and not More...
 
int trace_counter = -1
 counter to generate unique trace lines for debug More...
 

Detailed Description

Context - root, hold bindings info for whole TranslationUnit.

Member Typedef Documentation

◆ string

typedef std::string binder::Context::string
private

Member Function Documentation

◆ add()

void binder::Context::add ( BinderOP b)

◆ add_insertion_operator()

void binder::Context::add_insertion_operator ( clang::FunctionDecl const *  f)

◆ add_to_binded()

void binder::Context::add_to_binded ( clang::CXXRecordDecl const *  )
private

add given class to 'already binded' set

add given class to 'aleady binded' set

References C, and binder::class_qualified_name().

◆ bind()

void binder::Context::bind ( Config const &  config)
private

bind all objects residing in namespaces and their dependencies

walk over all binders and bind one that belong to requested namespaces

References compute_difference::b, kmeans_adaptive_kernel_density_bb_dependent_rotlib::flag, O_verbose, and outs.

◆ create_all_nested_namespaces()

std::set< string > binder::Context::create_all_nested_namespaces ( )
private

examine binded objects and recursivly create all nested namespaces

References compute_difference::b, binder::base_namespace(), binder::namespace_from_named_decl(), and docking::s.

◆ generate()

void binder::Context::generate ( Config const &  config)

◆ global_insertion_operator()

clang::FunctionDecl const * binder::Context::global_insertion_operator ( clang::CXXRecordDecl const *  C)

find global insertion operator for given type, otherwise return nullptr

find global insertion operator for given type, return nullptr if not such operator find

References C, binder::class_qualified_name(), binder::fix_boolean_types(), create_a3b_hbs::i, subloop_histogram::size, binder::standard_name(), predPRE::t, and numeric::interpolation::to_string().

Referenced by binder::ClassBinder::bind_repr().

◆ is_forward_needed()

bool binder::Context::is_forward_needed ( clang::CXXRecordDecl const *  )
private

check if forward declaration for CXXRecordDecl needed

References C, binder::class_qualified_name(), and binder::is_python_builtin().

◆ module_variable_name()

std::string binder::Context::module_variable_name ( std::string const &  namespace_)

◆ request_bindings()

void binder::Context::request_bindings ( std::string const &  type)

find binder related to given type name and bind it

References binder::is_python_builtin().

Referenced by binder::request_bindings().

◆ sort_binders()

void binder::Context::sort_binders ( )
private

◆ trace_line()

std::string binder::Context::trace_line ( std::string const &  info)

generate unique trace line containing info to insert into the code

References info(), and numeric::interpolation::to_string().

Member Data Documentation

◆ binded

std::set<string> binder::Context::binded
private

set of items unique id's to keep track of what is binded and not

◆ binders

std::vector<BinderOP> binder::Context::binders
private

array of all binders from translation unit

◆ ids

std::unordered_set<string> binder::Context::ids
private

set of items unique id's to keep track of binders being added

◆ insertion_operators

std::map<std::string, clang::FunctionDecl const *> binder::Context::insertion_operators
private

map of function-ptr -> Decl* for global instertion operators so we can determine for which types we can bind repr

◆ trace_counter

int binder::Context::trace_counter = -1
private

counter to generate unique trace lines for debug

◆ types

std::unordered_map<string, BinderOP> binder::Context::types
private

types → binder


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