stlab.adobe.com Adobe Systems Incorporated

virtual_machine.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_VIRTUAL_MACHINE_HPP
00010 #define ADOBE_VIRTUAL_MACHINE_HPP
00011 
00012 #include <adobe/config.hpp>
00013 
00014 #include <bitset>
00015 #include <vector>
00016 
00017 #define BOOST_FUNCTION_NO_DEPRECATED
00018 #include <boost/function.hpp>
00019 #include <boost/operators.hpp>
00020 
00021 #include <adobe/array_fwd.hpp>
00022 #include <adobe/name_fwd.hpp>
00023 #include <adobe/dictionary_fwd.hpp>
00024 
00025 #include <adobe/move.hpp>
00026 
00027 #include <adobe/any_regular.hpp>
00028 
00029 /*************************************************************************************************/
00030 
00031 namespace adobe {
00032 
00033 /*************************************************************************************************/
00034 
00035 class virtual_machine_t
00036 {
00037  public:
00038     typedef array_t             expression_t;
00039 
00040     typedef any_regular_t(variable_lookup_signature_t)(name_t);
00041     typedef any_regular_t(dictionary_function_lookup_signature_t)(name_t, const dictionary_t&);
00042     typedef any_regular_t(array_function_lookup_signature_t)(name_t, const array_t&);
00043     typedef any_regular_t(named_index_lookup_signature_t)(const adobe::any_regular_t&, adobe::name_t index);
00044     typedef any_regular_t(numeric_index_lookup_signature_t)(const adobe::any_regular_t&, std::size_t index);
00045 
00046     typedef boost::function<variable_lookup_signature_t>            variable_lookup_t;
00047     typedef boost::function<dictionary_function_lookup_signature_t> dictionary_function_lookup_t;
00048     typedef boost::function<array_function_lookup_signature_t>      array_function_lookup_t;
00049     typedef boost::function<named_index_lookup_signature_t>         named_index_lookup_t;
00050     typedef boost::function<numeric_index_lookup_signature_t>       numeric_index_lookup_t;
00051 
00052 #if !defined(ADOBE_NO_DOCUMENTATION)
00053     virtual_machine_t();
00054     virtual_machine_t(const virtual_machine_t&);
00055 
00056     virtual_machine_t& operator = (const virtual_machine_t& rhs);
00057 
00058     ~virtual_machine_t();
00059 #endif
00060 
00061     void evaluate(const expression_t& expression);
00062 #if 0
00063     void evaluate_named_arguments(const dictionary_t&);
00064 #endif
00065 
00066     const any_regular_t& back() const;
00067     any_regular_t& back();
00068     void pop_back();
00069 
00070     void set_variable_lookup(const variable_lookup_t&);
00071     void set_array_function_lookup(const array_function_lookup_t&);
00072     void set_dictionary_function_lookup(const dictionary_function_lookup_t&);
00073     void set_named_index_lookup(const named_index_lookup_t&);
00074     void set_numeric_index_lookup(const numeric_index_lookup_t&);
00075 
00076     class implementation_t;
00077  private:
00078 
00079     implementation_t* object_m;
00080 };
00081 
00082 /*************************************************************************************************/
00083 
00084 } // namespace adobe
00085 
00086 /*************************************************************************************************/
00087 
00088 #endif
00089 
00090 /*************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google