Namespaces | |
| namespace | api |
| Wrapper for platform-specific function calls. | |
| namespace | internal |
| Contains code not for public use. | |
| namespace | types |
| Contains implementations of all variable types. | |
Classes | |
| class | exception |
| The base class of C++Script's exceptions. More... | |
| class | not_found |
| Exception indicating that a member has not been found in an object. More... | |
| class | not_supported |
| Exception indicating that an operation attempted on an object is not supported. More... | |
| class | wrong_number_of_args |
| Exception indicating that the wrong number of arguments has been passed to a functor. More... | |
| class | too_many_arguments |
| Exception indicating that too many arguments has been passed to a functor. More... | |
| class | invalid_string |
| Exception when a string is in the wrong format. More... | |
| class | expired_iterator |
| Exception when an iterator is used after its underlying object has been modified. More... | |
| class | stack_trace_entry |
| Used to create a new item on the stack, for later retrieval by stack_trace(). More... | |
| class | shared_var_impl |
| The base class for all shared objects. More... | |
| class | inline_var_impl |
| Helper class to implement var_impl. More... | |
| class | kingsley_heap |
| Implements a Kingsley allocator. More... | |
| struct | allocator |
| An allocator which allocates memory in the local heap. More... | |
| class | scopeguard |
| Executes a given functor when the scopeguard is destroyed. More... | |
| class | pickler |
| A helper class used by the pickle() function to keep track of pickling. More... | |
| class | unpickler |
| A helper class used by the unpickle() function. More... | |
| class | var |
| The var type that the users see. More... | |
| class | var_impl |
| This is the interface which all objects implement. More... | |
| class | posix_filesystem_api |
| A wrapper for the POSIX filesystem calls. More... | |
| class | apartment |
| A mutually exclusive garbage-collected heap. More... | |
| class | win32_filesystem_api |
Typedefs | |
| typedef var(* | f0 )() |
| typedef var(* | f1 )(var) |
| typedef var(* | f2 )(var, var) |
| typedef var(* | f3 )(var, var, var) |
| typedef var(* | f4 )(var, var, var, var) |
| typedef var(* | f5 )(var, var, var, var, var) |
| typedef var(* | f6 )(var, var, var, var, var, var) |
| typedef var(* | f7 )(var, var, var, var, var, var, var) |
| typedef var(* | f8 )(var, var, var, var, var, var, var, var) |
| typedef var(* | f9 )(var, var, var, var, var, var, var, var, var) |
| typedef var(* | f10 )(var, var, var, var, var, var, var, var, var, var) |
| typedef void(* | vf0 )() |
| typedef void(* | vf1 )(var) |
| typedef void(* | vf2 )(var, var) |
| typedef void(* | vf3 )(var, var, var) |
| typedef void(* | vf4 )(var, var, var, var) |
| typedef void(* | vf5 )(var, var, var, var, var) |
| typedef void(* | vf6 )(var, var, var, var, var, var) |
| typedef void(* | vf7 )(var, var, var, var, var, var, var) |
| typedef void(* | vf8 )(var, var, var, var, var, var, var, var) |
| typedef void(* | vf9 )(var, var, var, var, var, var, var, var, var) |
| typedef void(* | vf10 )(var, var, var, var, var, var, var, var, var, var) |
|
typedef std::basic_ostream < wchar_t > | wostream |
| typedef std::basic_ostream< char > | ostream |
| typedef std::basic_string< char > | string |
|
typedef std::basic_string < wchar_t > | wstring |
| typedef dynamic::internal::variant < var_impl, 16 > | var_variant |
| typedef posix_filesystem_api | filesystem_api |
| The platform-specific filesystem implementation. | |
Enumerations | |
| enum | var_cmp_index { cmp_null, cmp_false, cmp_true, cmp_char, cmp_wchar, cmp_int, cmp_double, cmp_string, cmp_wstring, cmp_array, cmp_list, cmp_set, cmp_multiset, cmp_map, cmp_multimap, cmp_reference, cmp_object, cmp_function_0, cmp_function_v0, cmp_function_1, cmp_function_v1, cmp_function_2, cmp_function_v2, cmp_function_3, cmp_function_v3, cmp_function_4, cmp_function_v4, cmp_function_5, cmp_function_v5, cmp_function_6, cmp_function_v6, cmp_function_7, cmp_function_v7, cmp_function_8, cmp_function_v8, cmp_function_9, cmp_function_v9, cmp_function_10, cmp_function_v10, cmp_bind, cmp_native, cmp_sequence, cmp_varargs, cmp_proxy, cmp_reverse, cmp_dispatcher, cmp_filter, cmp_transform, cmp_tail, cmp_python, cmp_user = 1000 } |
| The internal type-id of a variable. More... | |
| enum | var_cmp_result { cmp_equal, cmp_not_equal, cmp_lt, cmp_gt } |
| The result of comparing two vars. | |
Functions | |
| DYNAMIC_API var | exception_description (const var &ex) |
| Creates an exception string from an exception. | |
| template<typename T > | |
| var | create (const T &t) |
| Creates a shared object wrappering a C++ object. | |
| template<typename T > | |
| var | create () |
| Creates a shared object wrappering a C++ object - default constructor. | |
| template<typename B , typename T > | |
| var | create_base (const T &t) |
| Creates a shared object wrapping a C++ object. | |
| template<typename B , typename T > | |
| var | create_base () |
| template<typename B , typename T > | |
| var | create_ref (T &t) |
| template<typename B , typename T > | |
| T & | as_derived (const var &v) |
| DYNAMIC_API var | global () |
| Access the global object (for global variables). | |
| DYNAMIC_API var | version () |
| Retrieves the version-string of the library. | |
| DYNAMIC_API var | stack_trace () |
| Retrieves a list of the current stack, as a list of strings. | |
| DYNAMIC_API var | bind (const var &fn, const var &arg) |
| Takes a functor (fn) and returns a functor taking fewer arguments. | |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3, const var &a4) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3, const var &a4, const var &a5) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3, const var &a4, const var &a5, const var &a6) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3, const var &a4, const var &a5, const var &a6, const var &a7) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3, const var &a4, const var &a5, const var &a6, const var &a7, const var &a8) |
| DYNAMIC_API var | bind (const var &fn, const var &a0, const var &a1, const var &a2, const var &a3, const var &a4, const var &a5, const var &a6, const var &a7, const var &a8, const var &a9) |
| DYNAMIC_API var | object () |
| Creates an empty object (a container mapping strings to values). | |
| DYNAMIC_API var | object (const char *class_name) |
| Creates an empty object with a specified name. | |
| DYNAMIC_API var | string_from (const var &container) |
| Creates a string with elements from another container. | |
| template<typename FwdIterator > | |
| var | string_it (FwdIterator from, FwdIterator to) |
| Creates a string with elements assigned from the iterators. | |
| DYNAMIC_API std::string | pickle (const var &) |
| Converts most vars to a string. | |
| DYNAMIC_API var | unpickle (const std::string &) |
| Converts a string from pickle() back into a var. | |
| DYNAMIC_API var | tail (const var &container) |
| Removes the first element of a container. | |
| DYNAMIC_API var | map () |
| Creates an empty map. | |
| DYNAMIC_API var | map (const var &key, const var &value) |
| Creates a map with one key-value pair. | |
| DYNAMIC_API var | set () |
| Creates an empty set. | |
| DYNAMIC_API var | set (const var &) |
| Creates a set with one element. | |
| DYNAMIC_API var | set (const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a set with given elements. | |
| DYNAMIC_API var | set_from (const var &container) |
| Creates a set with elements populated from another container. | |
| template<typename FwdIterator > | |
| var | set_it (FwdIterator start, FwdIterator end) |
| Creates a set with elements populated from the two iterators. | |
| DYNAMIC_API var | fill_array (const var &size, const var &item) |
| Creates an array of given size containing the same item. | |
| DYNAMIC_API var | array () |
| Creates an empty array. | |
| DYNAMIC_API var | array (const var &) |
| Creates an array with a single element. | |
| DYNAMIC_API var | array (const var &, const var &) |
| Creates an array with two elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &) |
| Creates an array with three elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates an array with given elements. | |
| DYNAMIC_API var | array_from (const var &) |
| Creates an array with elements from another container. | |
| template<typename It > | |
| var | array_it (It a, It b) |
| Creates an array with elements between the iterators. | |
| template<std::size_t N> | |
| var | array (var(&l)[N]) |
| Creates an array from a C-style array. | |
| DYNAMIC_API var | list () |
| Creates an empty list. | |
| DYNAMIC_API var | fill_list (const var &size, const var &item) |
| Creates a list of given size containing the specified item. | |
| template<typename It > | |
| var | list_it (It a, It b) |
| Creates a list from elements between a pair of iterators. | |
| DYNAMIC_API var | list (const var &item) |
| Creates a list containing a single item. | |
| DYNAMIC_API var | list (const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &) |
| Creates a list containing given items. | |
| DYNAMIC_API var | list_from (const var &container) |
| Creates a list containing elements from a given container. | |
| template<std::size_t N> | |
| var | list (var(&ca)[N]) |
| Creates a list with elements from a C-style array. | |
| DYNAMIC_API var | range (const var &from, const var &to) |
| Creates sequences. | |
| DYNAMIC_API var | range (const var &from, const var &to, const var &step) |
| Creates sequences. | |
| DYNAMIC_API var | range_ex (const var &from, const var &to) |
| Creates sequences. | |
| DYNAMIC_API var | range_ex (const var &from, const var &to, const var &step) |
| Creates sequences. | |
| DYNAMIC_API var | sequence (const var &start, const var &len) |
| Creates sequences. | |
| DYNAMIC_API var | sequence (const var &start, const var &len, const var &step) |
| Creates sequences. | |
| DYNAMIC_API var | reverse (const var &) |
| Creates a container with its elements reversed. | |
| DYNAMIC_API var | filter (const var &container, const var &pred) |
| Creates a container which filters the contents of another container using a predicate. | |
| DYNAMIC_API var | transform (const var &container, const var &fn) |
| Creates a container which transforms the elements of another container. | |
| DYNAMIC_API var | dispatcher (const var &object) |
| Creates a dispatcher object. | |
| DYNAMIC_API var | max (const var &a, const var &b) |
| Returns the larger of a or b. | |
| DYNAMIC_API var | min (const var &a, const var &b) |
| Returns the smaller of a or b. | |
| DYNAMIC_API var | open_file (const var &filename, std::ios_base::openmode flags) |
| Opens the file and returns a file object. | |
| DYNAMIC_API var | write_file (const var &filename) |
| Opens a file for write. | |
| DYNAMIC_API var | read_file (const var &filename) |
| Opens a file for reading. | |
| DYNAMIC_API var | fstat (const var &filename) |
| Returns status information about a file. | |
| DYNAMIC_API var | in () |
| Returns the file for standard input. | |
| DYNAMIC_API var | out () |
| Returns the file for standard output. | |
| DYNAMIC_API var | err () |
| Returns the file for standard errors. | |
| DYNAMIC_API var | mem_file () |
| Creates an in-memory file. | |
| DYNAMIC_API var | characters (const var &file) |
| Enumerates through all characters in a file. | |
| DYNAMIC_API var | lines (const var &file) |
| Enumerates through all lines in a file. | |
| DYNAMIC_API var | enumerate (const var &fn) |
| Enumerates any function until it returns null. | |
| DYNAMIC_API void | write (const var &) |
| Writes a string to standard output. | |
| DYNAMIC_API void | writeln (const var &) |
| Writes a string to standard output, followed by new line. | |
| DYNAMIC_API void | writeln () |
| Writes a new line to standard output. | |
| DYNAMIC_API var | readln () |
| Reads a new line from standard input. | |
| DYNAMIC_API void | pickle_file (const var &name, const var &object) |
| Pickles an object into a file. | |
| DYNAMIC_API var | unpickle_file (const var &name) |
| Reads an object file a file. | |
| DYNAMIC_API void | sleep (const var &seconds) |
| Pauses the current thread for the given interval. | |
| DYNAMIC_API var | system (const var &) |
| Executes a system call. | |
| DYNAMIC_API var | thread (const var &thread_fn) |
| Creates a thread, and executes the given functor in the thread. | |
| DYNAMIC_API var | global (const var &fn) |
| Executes the given functor in a globally-shared apartment. | |
| DYNAMIC_API var | shared (const var &fn) |
| Executes the given functor in a new apartment. | |
| DYNAMIC_API var | event () |
| Creates a event object. | |
| DYNAMIC_API var | mutex () |
| Creates a mutex object. | |
| DYNAMIC_API var | exec (const var &file, const var &args) |
| Executes the given command (does not return). | |
| DYNAMIC_API var | queue () |
| Creates a queue object. | |
| DYNAMIC_API var | message_queue (const var &consumer, const var &threads=1) |
| Creates a message queue object, with a given consumer functor running in the specified number of threads. | |
| DYNAMIC_API var | substring (const var &str, const var &range) |
| Returns a substring of a string. | |
| DYNAMIC_API var | split_chars (var predicate, var str) |
| Splits the string and returns an array of strings matching the predicate. | |
| DYNAMIC_API var | string_find (const var &str, const var &needle) |
| Returns the range of the first occurrence of a particular string, or null. | |
| DYNAMIC_API var | string_find_last (const var &str, const var &needle) |
| Returns the range of the last occurrance of a particular string, or null. | |
| DYNAMIC_API var | string_find_all (const var &str, const var &needle) |
| Returns an array of ranges. | |
| DYNAMIC_API var | pad (const var &str, const var &size) |
| Returns a string of a fixed size by truncating it or padding it with spaces. | |
| DYNAMIC_API var | is_space (var ch) |
| Returns true if ch is a space. | |
| DYNAMIC_API var | is_one_of (var str, var ch) |
| Returns true if ch appears in str. | |
| DYNAMIC_API var | is_not_one_of (var str, var ch) |
| Returns false if ch appears in str. | |
| DYNAMIC_API var | is_not (var predicate, var value) |
| Negates the given predicate. | |
| DYNAMIC_API var | varargs (const var &fn) |
| Returns a functor taking a variable number of arguments. | |
| DYNAMIC_API void | gc_enable () |
| Temporarily disable the GC (can be nested). | |
| DYNAMIC_API void | gc_disable () |
| Reenable the GC. | |
| DYNAMIC_API void | gc_hint_collect () |
| Advise to perform a collection now (may not do anything) - put this into an idle loop. | |
| DYNAMIC_API void | gc_force_collect () |
| Perform a collection now (inadvisible). | |
| DYNAMIC_API void | gc_tune (int heap_factor=30, int idle_factor=20, int min_objects=1000) |
| Wait until the heap has grown by a factor of 3 before automatically performing a GC. | |
| DYNAMIC_API void | assertx (const var &v) |
| Throws an exception if v is false. | |
| DYNAMIC_API var | run_tests (const var &tests) |
| Executes all tests in the map tests. | |
| DYNAMIC_API double | timer () |
| Returns the time in seconds since the start of the program. | |
| template<typename T > | |
| var | create_impl (const T &t) |
| Creates a var containing a specified var_impl. | |
| DYNAMIC_API void | register_pickle_type (var_cmp_index, const var &) |
| Register a prototype object to instantiate when unpickling. | |
| DYNAMIC_API var | unpickle_type (var_cmp_index) |
| Create an of a given object type. | |
| DYNAMIC_API std::ostream & | operator<< (std::ostream &os, var const &a) |
| Output a var to a stream. | |
| DYNAMIC_API wostream & | operator<< (wostream &os, var const &a) |
| Output a var to a wide stream. | |
| void | write_int_to_stream (wostream &, int) |
| DYNAMIC_API var | create_closure (const var &object, const char *method, const var &fn) |
Variables | |
| const var | null |
| The null value, same as var(). | |
| const int | dir_separator = '/' |
| typedef var(* dynamic::f0)() |
| typedef dynamic::internal::variant<var_impl, 16> dynamic::var_variant |
Definition at line 117 of file var_variant.hpp.
| typedef void(* dynamic::vf0)() |
The internal type-id of a variable.
This enum is used for two things: 1) For comparing different vars, and 2) For pickling and unpickling. Do not change the order of these enums or add numbers to the middle of the list, because otherwise pickled data would not be readable.
Definition at line 19 of file var_methods.hpp.
| var dynamic::unpickle_type | ( | var_cmp_index | i | ) |
Create an of a given object type.
The type must previously have been registered by register_pickle_type
Definition at line 371 of file pickle.cpp.
Referenced by dynamic::unpickler::read_object().
1.5.7.1