Pothos  0.4.1-gb758ed46
The Pothos dataflow programming software suite
Public Member Functions | List of all members
Pothos::Proxy Class Reference

#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< ProxyHandlegetHandle (void) const
 Get the handle held in this proxy object. More...
 
std::shared_ptr< ProxyEnvironmentgetEnvironment (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
handlea 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.

Parameters
handlea ProxyHandle pointer created by an environment

Member Function Documentation

template<typename ReturnType , typename... ArgsType>
ReturnType Pothos::Proxy::call ( const std::string &  name,
ArgsType &&...  args 
) const

Call a method with a return type and variable args.

template<typename... ArgsType>
Proxy Pothos::Proxy::callProxy ( const std::string &  name,
ArgsType &&...  args 
) const

Call a method with a Proxy return and variable args.

template<typename... ArgsType>
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.

Exceptions
ProxyCompareErrorwhen the compare isnt possible
Parameters
otherthe other proxy object to compare against
Returns
an int representing less than, equal to, or greater than
template<typename ValueType >
ValueType Pothos::Proxy::convert ( void  ) const

Convert this proxy to the specified ValueType.

Exceptions
ProxyEnvironmentConvertErrorif conversion failed
Returns
the Proxy's value as ValueType
template<typename ReturnType >
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.

Pothos::Proxy::operator bool ( void  ) const
explicit

Is this Proxy have a handle?

Returns
true if the handle is set.
template<typename... ArgsType>
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.

template<typename ValueType >
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.

Exceptions
ProxyEnvironmentConvertErrorif conversion failed
Returns
a new Object that contains something in local memory
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.


The documentation for this class was generated from the following files: