include/IPSA/viewer/instructions/NVInstructionAnswerParsing.h File Reference

#include <vector>
#include <string>
#include <sstream>
#include <iostream>

Include dependency graph for NVInstructionAnswerParsing.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
bool convertAnswerToType (const std::string &answer, T &result)
template<typename T >
bool convertAnswerToVector (const std::string &answer, std::vector< T > &result, unsigned int numberOfExpectedValues=3)


Detailed Description

Contains functions to parse the strings returned as answers from Instructions send to the NetworkViewer over the TCP/IP connection.

Definition in file NVInstructionAnswerParsing.h.


Function Documentation

template<typename T >
bool convertAnswerToType ( const std::string &  answer,
T &  result 
) [inline]

This method converts the string answer into a value of type T and stores it in the variable result. The parameter answer should by of the form "<T>" for the method to work.

Parameters:
answer the string to convert into a value of type T
result the variable to store the result in
Returns:
true if conversion passed and false if an error occured.

Definition at line 86 of file NVInstructionAnswerParsing.h.

template<typename T >
bool convertAnswerToVector ( const std::string &  answer,
std::vector< T > &  result,
unsigned int  numberOfExpectedValues = 3 
) [inline]

This method converts the string answer into values of type T and stores them in the vector result. result needs to be of size numberOfExpectedValues (default = 3). The parameter answer must be of the form "<T_0> <T_1> .. <T_numberOfExpectedValues>".

Parameters:
answer the string to convert into values of type T
result the vector to store the result in (needs to be of size numberOfExpectedValues)
numberOfExpectedValues tells the method how many values are exptected as a result (default = 3)
Returns:
true if conversion passed and false if an error occured.

Definition at line 47 of file NVInstructionAnswerParsing.h.

Referenced by IpsaDialog::evaluateAnswer().


Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:16 2012 for IPSA by  doxygen 1.5.8