libvisiontransfer  10.0.0
Public Member Functions | List of all members
visiontransfer::internal::ParameterTransfer Class Reference

Allows a configuration of device parameters over the network. More...

#include <visiontransfer/parametertransfer.h>

Public Member Functions

 ParameterTransfer (const char *address, const char *service="7683")
 Creates an object and connects to the given server. More...
 
int readIntParameter (const char *id)
 Reads an integer value from the parameter server. More...
 
double readDoubleParameter (const char *id)
 Reads a double precision floating point value from the parameter server. More...
 
bool readBoolParameter (const char *id)
 Reads a boolean value from the parameter server. More...
 
void writeIntParameter (const char *id, int value)
 Writes an integer value to a parameter of the parameter server. More...
 
void writeDoubleParameter (const char *id, double value)
 Writes a double precision floating point value to a parameter of the parameter server. More...
 
void writeBoolParameter (const char *id, bool value)
 Writes a boolean value to a parameter of the parameter server. More...
 
template<typename T >
void writeParameter (const char *id, const T &value)
 Writes a scalar value to a parameter of the parameter server. More...
 
std::map< std::string, ParameterInfogetAllParameters ()
 Enumerates all parameters as reported by the device. More...
 
param::ParameterSetgetParameterSet ()
 Returns a reference to the internal parameter set (once the network handshake is complete) More...
 
template<>
void writeParameter (const char *id, const std::string &value)
 

Detailed Description

Allows a configuration of device parameters over the network.

A TCP connection is established to a parameter server. The protocol allows writing and reading of individual parameters, which are identified by a unique ID. There are three supported types of parameters: integers, double precision floating point values, and booleans.

This class is only used internally. Users should use the class DeviceParameters instead.

Definition at line 45 of file parametertransfer.h.

Constructor & Destructor Documentation

◆ ParameterTransfer()

visiontransfer::internal::ParameterTransfer::ParameterTransfer ( const char *  address,
const char *  service = "7683" 
)

Creates an object and connects to the given server.

Parameters
addressIP address or host name of the server.
serviceThe port number that should be used as string or as textual service name.

Definition at line 39 of file parametertransfer.cpp.

Member Function Documentation

◆ getAllParameters()

std::map< std::string, ParameterInfo > visiontransfer::internal::ParameterTransfer::getAllParameters ( )

Enumerates all parameters as reported by the device.

Definition at line 185 of file parametertransfer.cpp.

◆ getParameterSet()

ParameterSet & visiontransfer::internal::ParameterTransfer::getParameterSet ( )

Returns a reference to the internal parameter set (once the network handshake is complete)

Definition at line 367 of file parametertransfer.cpp.

◆ readBoolParameter()

bool visiontransfer::internal::ParameterTransfer::readBoolParameter ( const char *  id)

Reads a boolean value from the parameter server.

Parameters
idUnique ID of the parameter to be read.
Returns
If successful, the value of the parameter that has been read

If reading the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 165 of file parametertransfer.cpp.

◆ readDoubleParameter()

double visiontransfer::internal::ParameterTransfer::readDoubleParameter ( const char *  id)

Reads a double precision floating point value from the parameter server.

Parameters
idUnique ID of the parameter to be read.
Returns
If successful, the value of the parameter that has been read

If reading the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 157 of file parametertransfer.cpp.

◆ readIntParameter()

int visiontransfer::internal::ParameterTransfer::readIntParameter ( const char *  id)

Reads an integer value from the parameter server.

Parameters
idUnique ID of the parameter to be read.
Returns
If successful, the value of the parameter that has been read

If reading the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 149 of file parametertransfer.cpp.

◆ writeBoolParameter()

void visiontransfer::internal::ParameterTransfer::writeBoolParameter ( const char *  id,
bool  value 
)

Writes a boolean value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 181 of file parametertransfer.cpp.

◆ writeDoubleParameter()

void visiontransfer::internal::ParameterTransfer::writeDoubleParameter ( const char *  id,
double  value 
)

Writes a double precision floating point value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 177 of file parametertransfer.cpp.

◆ writeIntParameter()

void visiontransfer::internal::ParameterTransfer::writeIntParameter ( const char *  id,
int  value 
)

Writes an integer value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 173 of file parametertransfer.cpp.

◆ writeParameter()

template<typename T >
void visiontransfer::internal::ParameterTransfer::writeParameter ( const char *  id,
const T &  value 
)

Writes a scalar value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 97 of file parametertransfer.cpp.


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