Pothos
0.4.0-gd11861cd
The Pothos dataflow programming software suite
|
#include <Proxy.hpp>
Public Member Functions | |
Proxy (void) | |
Proxy (const std::shared_ptr< ProxyHandle > &handle) | |
Proxy (ProxyHandle *handle) | |
operator bool (void) const | |
std::shared_ptr< ProxyHandle > | getHandle (void) const |
Get the handle held in this proxy object. More... | |
std::shared_ptr< ProxyEnvironment > | getEnvironment (void) const |
template<typename ValueType > | |
ValueType | convert (void) const |
template<typename ReturnType , typename... ArgsType> | |
ReturnType | call (const std::string &name, ArgsType &&...args) const |
Call a method with a return type and variable args. More... | |
template<typename... ArgsType> | |
Proxy | callProxy (const std::string &name, ArgsType &&...args) const |
Call a method with a Proxy return and variable args. More... | |
template<typename... ArgsType> | |
void | callVoid (const std::string &name, ArgsType &&...args) const |
Call a method with a void return and variable args. More... | |
template<typename ReturnType > | |
ReturnType | get (const std::string &name) const |
Call a field getter with specified return type. More... | |
Proxy | get (const std::string &name) const |
Call a field getter with Proxy return type. More... | |
template<typename ValueType > | |
void | set (const std::string &name, ValueType &&value) const |
Call a field setter. More... | |
template<typename... ArgsType> | |
Proxy | operator() (ArgsType &&...args) const |
Call the function operator() with a Proxy return and variable args. More... | |
int | compareTo (const Proxy &other) const |
size_t | hashCode (void) const |
Object | toObject (void) const |
std::string | toString (void) const |
std::string | getClassName (void) const |
bool | operator< (const Proxy &obj) const |
Comparable operator for stl containers. More... | |
bool | operator> (const Proxy &obj) const |
Comparable operator for stl containers. More... | |
The Proxy is a wrapper class for making calls in a ProxyEnvironment. Proxys are created by the Environment and by using Proxy call(). The Proxy methods are simply just templated convenience methods that take any argument type provided and handle the automatic conversions.
Pothos::Proxy::Proxy | ( | void | ) |
Create a null Proxy.
Pothos::Proxy::Proxy | ( | const std::shared_ptr< ProxyHandle > & | handle | ) |
Create a Proxy from a handle. This constructor will typically be called by the implementation.
handle | a ProxyHandle shared pointer created by an environment |
Pothos::Proxy::Proxy | ( | ProxyHandle * | handle | ) |
Create a Proxy from a handle. The Proxy is responsible for deletion of the pointer. This constructor will typically be called by the implementation.
handle | a ProxyHandle pointer created by an environment |
ReturnType Pothos::Proxy::call | ( | const std::string & | name, |
ArgsType &&... | args | ||
) | const |
Call a method with a return type and variable args.
Proxy Pothos::Proxy::callProxy | ( | const std::string & | name, |
ArgsType &&... | args | ||
) | const |
Call a method with a Proxy return and variable args.
void Pothos::Proxy::callVoid | ( | const std::string & | name, |
ArgsType &&... | args | ||
) | const |
Call a method with a void return and variable args.
int Pothos::Proxy::compareTo | ( | const Proxy & | other | ) | const |
Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
ProxyCompareError | when the compare isnt possible |
other | the other proxy object to compare against |
ValueType Pothos::Proxy::convert | ( | void | ) | const |
Convert this proxy to the specified ValueType.
ProxyEnvironmentConvertError | if conversion failed |
ReturnType Pothos::Proxy::get | ( | const std::string & | name | ) | const |
Call a field getter with specified return type.
Proxy Pothos::Proxy::get | ( | const std::string & | name | ) | const |
Call a field getter with Proxy return type.
std::string Pothos::Proxy::getClassName | ( | void | ) | const |
Get the class name of the underlying object. The class name should be a unique identifier for objects of the same type as the one contained. This name is used to help convert proxies to local objects.
std::shared_ptr<ProxyEnvironment> Pothos::Proxy::getEnvironment | ( | void | ) | const |
Get the Environment that created this Object's Handle.
std::shared_ptr<ProxyHandle> Pothos::Proxy::getHandle | ( | void | ) | const |
Get the handle held in this proxy object.
size_t Pothos::Proxy::hashCode | ( | void | ) | const |
Get a hash code for the underlying object. The hash code should be identical for equivalent objects.
|
explicit |
Is this Proxy have a handle?
Proxy Pothos::Proxy::operator() | ( | ArgsType &&... | args | ) | const |
Call the function operator() with a Proxy return and variable args.
bool Pothos::Proxy::operator< | ( | const Proxy & | obj | ) | const |
Comparable operator for stl containers.
bool Pothos::Proxy::operator> | ( | const Proxy & | obj | ) | const |
Comparable operator for stl containers.
void Pothos::Proxy::set | ( | const std::string & | name, |
ValueType && | value | ||
) | const |
Call a field setter.
Object Pothos::Proxy::toObject | ( | void | ) | const |
Convert this proxy in this environment to a local object.
ProxyEnvironmentConvertError | if conversion failed |
std::string Pothos::Proxy::toString | ( | void | ) | const |
Get the string representation of the Proxy. The format of the string is highly specific, depending upon the underlying object.