Roll back changes from last 2 checkins - user defined type conversions are going to be too slow and too hard to keep track of. Need more portable / generic approach to solving the actual problem - the ability to deal with inhertance properly

This commit is contained in:
Jason Turner
2010-07-23 14:55:32 +00:00
parent 3d19138c95
commit f7086c10ec
4 changed files with 0 additions and 303 deletions

View File

@@ -21,7 +21,6 @@
#include "boxed_value.hpp"
#include "type_info.hpp"
#include "type_conversion.hpp"
#include "proxy_functions.hpp"
#include "proxy_constructors.hpp"
#include "dynamic_object.hpp"
@@ -44,11 +43,6 @@ namespace chaiscript
return *this;
}
Module &add(const Type_Conversion &tc)
{
m_conversions.push_back(tc);
return *this;
}
//Add a bit of chaiscript to eval during module implementation
Module &eval(const std::string &str)
@@ -68,14 +62,12 @@ namespace chaiscript
{
apply(m_typeinfos.begin(), m_typeinfos.end(), t_engine);
apply(m_funcs.begin(), m_funcs.end(), t_engine);
apply_nameless(m_conversions.begin(), m_conversions.end(), t_engine);
apply_eval(m_evals.begin(), m_evals.end(), t_eval);
}
private:
std::vector<std::pair<Type_Info, std::string> > m_typeinfos;
std::vector<std::pair<Proxy_Function, std::string> > m_funcs;
std::vector<Type_Conversion> m_conversions;
std::vector<std::string> m_evals;
template<typename T, typename InItr>
@@ -88,16 +80,6 @@ namespace chaiscript
}
}
template<typename T, typename InItr>
void apply_nameless(InItr begin, InItr end, T &t) const
{
while (begin != end)
{
t.add(*begin);
++begin;
}
}
template<typename T, typename InItr>
void apply_eval(InItr begin, InItr end, T &t) const
{
@@ -220,7 +202,6 @@ namespace chaiscript
{
std::multimap<std::string, Proxy_Function> m_functions;
std::map<std::string, Boxed_Value> m_global_objects;
Type_Converter m_type_converter;
Type_Name_Map m_types;
std::set<std::string> m_reserved_words;
};
@@ -249,19 +230,6 @@ namespace chaiscript
return add_function(f, name);
}
/**
* Add a new type converter to the system
*/
void add(const Type_Conversion &tc)
{
#ifndef CHAISCRIPT_NO_THREADS
boost::unique_lock<boost::shared_mutex> l(m_mutex);
#endif
m_state.m_type_converter.add(tc);
}
/**
* Set the value of an object, by name. If the object
* is not available in the current scope it is created