Rosetta  2019.07
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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)
 
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 gloval insertion operator for given type, return nullptr if not such operator find 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 it dependency 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 'aleady binded' set More...
 
void sort_binders ()
 sort vector of binders by dependecy 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 determent for which types can bind repr More...
 
std::vector< BinderOPbinders
 array of all binderes from translation unit More...
 
std::unordered_map< string,
BinderOP
types
 types → binder More...
 
std::unordered_set< stringids
 set of items unique id's to keep track of whats binders being added More...
 
std::set< stringbinded
 set of items unique id's to keep track of whats 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

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

Member Function Documentation

void binder::Context::add ( BinderOP b)
void binder::Context::add_insertion_operator ( clang::FunctionDecl const *  f)
void binder::Context::add_to_binded ( clang::CXXRecordDecl const *  )
private

add given class to 'aleady binded' set

References binder::class_qualified_name().

void binder::Context::bind ( Config const &  config)
private
std::set< string > binder::Context::create_all_nested_namespaces ( )
private
void binder::Context::generate ( Config const &  config)
clang::FunctionDecl const * binder::Context::global_insertion_operator ( clang::CXXRecordDecl const *  C)

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

References binder::class_qualified_name(), binder::fix_boolean_types(), binder::standard_name(), basic::options::OptionKeys::in::file::t, and numeric::interpolation::to_string().

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

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

check if forward declaration for CXXRecordDecl needed

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

std::string binder::Context::module_variable_name ( std::string const &  namespace_)
void binder::Context::request_bindings ( std::string const &  type)
void binder::Context::sort_binders ( )
private
std::string binder::Context::trace_line ( std::string const &  info)

generate unique trace line containing info to insert into the code

References numeric::interpolation::to_string().

Member Data Documentation

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

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

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

array of all binderes from translation unit

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

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

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

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

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

counter to generate unique trace lines for debug

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

types → binder


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