|
template<typename F , typename ArgStream > |
result_type< F >::type | call (F f, ArgStream &astream) |
|
template<class T , typename F , typename ArgStream > |
result_type< F >::type | call (T *that, F f, ArgStream &astream) |
|
template<typename F , typename Dictionary , typename SingleArg > |
arg_stream::result_type< F >::type | call_with_dictionary (F f, Dictionary const &dict, SingleArg const &key_or_key_range) |
|
template<typename ArgStream > |
bool | eof (ArgStream const &as) |
|
template<typename R > |
R | get_dictionary_entry (adobe::dictionary_t const &dict, adobe::name_t const &key) |
|
template<typename R , typename ArgStream > |
R | get_next_arg (ArgStream const &as) |
|
arg_stream
is a namespace wrapping together the concept of a stream from which you can retrieve items (ie function arguments) of various types.
An arg_stream is any object which implements a templatized member function
and (optionally) implements
arg_stream implementors can communicate that they have an eof function by specializing arg_stream::traits<T>::has_eof_memberfunction
.
namespace adobe {
namespace arg_stream {
template <typename>
struct traits<my_arg_stream_goes_here>
{
static const bool has_eof_memberfunction = true;
};
} }
Alternatively, you may rely on the default implementation of traits<T>, which uses compile time type inspection to determine if T has an eof function.
The point of arg_stream is the arg_stream::call()
function:
template<typename F, typename ArgStream>
§ call() [1/2]
result_type<F>::type adobe::arg_stream::call |
( |
F |
f, |
|
|
ArgStream & |
astream |
|
) |
| |
Calls function/callable-object f with function arguments supplied by the arg_stream.
- This is the point of arg_stream. To call a function with typed-args pulled out of some abstracted object.
Definition at line 306 of file arg_stream.hpp.
§ call() [2/2]
result_type<F>::type adobe::arg_stream::call |
( |
T * |
that, |
|
|
F |
f, |
|
|
ArgStream & |
astream |
|
) |
| |
§ call_with_dictionary()
arg_stream::result_type<F>::type adobe::call_with_dictionary |
( |
F |
f, |
|
|
Dictionary const & |
dict, |
|
|
SingleArg const & |
key_or_key_range |
|
) |
| |
call the function/callable-object f
with args pulled from dictionary dict
via keys from key_range
Definition at line 305 of file dictionary_arg_stream.hpp.
§ eof()
bool adobe::arg_stream::eof |
( |
ArgStream const & |
as | ) |
|
arg_stream::eof(argstream)
returns true if there are no more args available.
- This function is available for specialization by arg_streams. If not specialized, the default implementation attempts to call the arg_stream's member function eof() if one is available. If there is no member function, it returns false - ie if it is not known, then it is assumed that more args exist, and thus we must still always consider that the arg_stream::no_more_args exception may be thrown.
Definition at line 168 of file arg_stream.hpp.
§ get_dictionary_entry()
dictionary_arg_stream requires specializations of get_dictionary_entry for the dictionary. For example, the adobe::dictionary_t specializations.
- we use 'get_dictionary_entry' instead of the standard adobe::get_value because
- Seems a bit too specific of an interface to ask someone to implement
Definition at line 53 of file dictionary_arg_stream.hpp.
§ get_next_arg()
R adobe::arg_stream::get_next_arg |
( |
ArgStream const & |
as | ) |
|
arg_stream::get_next_arg<T>(argstream)
returns the next arg as a T
- This function is what defines something as an arg_stream. An arg_stream must either:
- implement a templatized member function get_next_arg<T>() or
- specialize arg_stream::get_next_arg<T>(YourArgStream & argstream) ie If not specialized, this default implementation attempts to call the arg_stream's member function get_next_arg<T>(). If there is no member function, and the global function is not specialized, it will not compile.
Definition at line 186 of file arg_stream.hpp.