Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Pothos::ProxyEnvironment Class Referenceabstract

#include <Environment.hpp>

Inheritance diagram for Pothos::ProxyEnvironment:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< ProxyEnvironmentSptr
 

Public Member Functions

virtual ~ProxyEnvironment (void)
 Virtual destructor for subclassing. More...
 
virtual std::string getNodeId (void) const
 
virtual std::string getUniquePid (void) const
 
virtual std::string getPeeringAddress (void)
 
virtual std::string getName (void) const =0
 
virtual Proxy findProxy (const std::string &name)=0
 
virtual Proxy convertObjectToProxy (const Object &local)
 
template<typename ValueType >
Proxy makeProxy (ValueType &&local)
 
virtual Object convertProxyToObject (const Proxy &proxy)
 
virtual void serialize (const Proxy &proxy, std::ostream &os)=0
 
virtual Proxy deserialize (std::istream &is)=0
 
template<typename ValueType >
Pothos::Proxy makeProxy (ValueType &&local)
 
- Public Member Functions inherited from Pothos::Util::RefHolder
virtual ~RefHolder (void)
 Virtual destructor for derived classes. More...
 
void holdRef (const Object &container)
 Store a copy of this object container. More...
 
void dropRef (const Object &container)
 Drop a copy of this object container. More...
 

Static Public Member Functions

static Sptr make (const std::string &name, const ProxyEnvironmentArgs &args=ProxyEnvironmentArgs())
 
static std::string getLocalUniquePid (void)
 

Detailed Description

A ProxyEnvironment is the interaction point for dealing with managed objects. Managed objects can take a variety of forms. For example:

Member Typedef Documentation

◆ Sptr

Constructor & Destructor Documentation

◆ ~ProxyEnvironment()

virtual Pothos::ProxyEnvironment::~ProxyEnvironment ( void  )
virtual

Virtual destructor for subclassing.

Member Function Documentation

◆ convertObjectToProxy()

virtual Proxy Pothos::ProxyEnvironment::convertObjectToProxy ( const Object local)
virtual

Convert a local object into a proxy object in this environment.

Exceptions
ProxyEnvironmentConvertErrorif conversion failed
Parameters
localan Object that contains something in local memory
Returns
a new Proxy that represents the Object's contents

◆ convertProxyToObject()

virtual Object Pothos::ProxyEnvironment::convertProxyToObject ( const Proxy proxy)
virtual

Convert a proxy object in this environment into a local object.

Exceptions
ProxyEnvironmentConvertErrorif conversion failed
Parameters
proxya Proxy that represents an object in the environment
Returns
a new Object that contains something in local memory

◆ deserialize()

virtual Proxy Pothos::ProxyEnvironment::deserialize ( std::istream &  is)
pure virtual

Deserialize the stream into the contents of a Proxy.

Exceptions
ProxySerializeErroris the operation cant complete
Parameters
isthe input stream holding serialized data
Returns
a new proxy from the serialized data

◆ findProxy()

virtual Proxy Pothos::ProxyEnvironment::findProxy ( const std::string &  name)
pure virtual

Find a proxy object given its class name. The resulting object will have calls to create class instances, make static calls, and others.

Exceptions
ProxyEnvironmentFindErrorif cannot find
Parameters
namethe name of a class in the registry
Returns
a Proxy representing the class

◆ getLocalUniquePid()

static std::string Pothos::ProxyEnvironment::getLocalUniquePid ( void  )
static

Static method to get the unique ID of the caller process. The ID is universally unique, based on the nodeId and pid.

◆ getName()

virtual std::string Pothos::ProxyEnvironment::getName ( void  ) const
pure virtual

Get the name of the environment. This should be the same name passed into the factory.

◆ getNodeId()

virtual std::string Pothos::ProxyEnvironment::getNodeId ( void  ) const
virtual

Get the unique ID of the node that this environment is running on. Remote environments will report the node id of the remote server.

◆ getPeeringAddress()

virtual std::string Pothos::ProxyEnvironment::getPeeringAddress ( void  )
virtual

Get the peering address of the connection for this environment. Remote environment will report the peering address of the caller as seen by the remote server's socket acceptor.

◆ getUniquePid()

virtual std::string Pothos::ProxyEnvironment::getUniquePid ( void  ) const
virtual

Get the unique ID of the process that this environment is running on. Remote environments will report the process id of the remote server.

◆ make()

static Sptr Pothos::ProxyEnvironment::make ( const std::string &  name,
const ProxyEnvironmentArgs args = ProxyEnvironmentArgs() 
)
static

Create a new environment given the name of the factory. Plugins for custom BufferManagers should be located in the plugin registry: /proxy/environment/[name]

Exceptions
ProxyEnvironmentFactoryErrorif the factory function fails.
Parameters
namethe name of a ProxyEnvironment factory in the plugin tree
argsthe proxy environment init arguments
Returns
a new shared pointer to a proxy environment

◆ makeProxy() [1/2]

template<typename ValueType >
Proxy Pothos::ProxyEnvironment::makeProxy ( ValueType &&  local)

Convert a local object into a proxy object in this environment. Convenience templated version that takes the ValueType as input.

◆ makeProxy() [2/2]

template<typename ValueType >
Pothos::Proxy Pothos::ProxyEnvironment::makeProxy ( ValueType &&  local)

◆ serialize()

virtual void Pothos::ProxyEnvironment::serialize ( const Proxy proxy,
std::ostream &  os 
)
pure virtual

Serialize the contents of the proxy into a stream.

Exceptions
ProxySerializeErroris the operation cant complete
Parameters
proxythe input proxy object to serialize
osthe output stream for the serialized data

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