147 template <
typename FT>
150 FT *value =
dynamic_cast<FT *
>(t.
datum());
171 template <
typename FT>
174 FT *old =
dynamic_cast<FT *
>(t.
datum());
187 template <
typename FT,
class D>
190 Token t(
new D(value));
204 template <
typename FT>
207 return newToken2<FT,NameDatum>(value);
247 std::string getValue<std::string>(
const Token&);
249 void setValue<std::string>(
const Token&, std::string
const &value);
253 Token newToken<std::string>(std::string
const &value);
262 std::vector<long> getValue<std::vector<long> >(
const Token&);
264 void setValue<std::vector<long> >(
const Token&, std::vector<long>
const &value);
267 Token newToken<std::vector<long> >(std::vector<long>
const &value);
272 std::vector<double> getValue<std::vector<double> >(
const Token&);
274 void setValue<std::vector<double> >(
const Token&, std::vector<double>
const &value);
277 Token newToken<std::vector<double> >(std::vector<double>
const &value);
283 std::valarray<long> getValue<std::valarray<long> >(
const Token&);
285 void setValue<std::valarray<long> >(
const Token&, std::valarray<long>
const &value);
288 Token newToken<std::valarray<long> >(std::valarray<long>
const &value);
293 std::valarray<double> getValue<std::valarray<double> >(
const Token&);
295 void setValue<std::valarray<double> >(
const Token&, std::valarray<double>
const &value);
298 Token newToken<std::valarray<double> >(std::valarray<double>
const &value);
bool getValue< bool >(const Token &)
Definition: tokenutils.cc:124
float getValue< float >(const Token &)
Definition: tokenutils.cc:92
void setValue(const Token &t, FT const &value)
setValue provides easy write-access to a Token's contents.
Definition: tokenutils.h:172
Exception to be thrown if a given SLI type does not match the expected type.
Definition: sliexceptions.h:147
void setValue< double >(const Token &, double const &value)
Definition: tokenutils.cc:80
void setValue< long >(const Token &, long const &value)
Definition: tokenutils.cc:48
Token newToken(FT const &value)
Create a new Token from a fundamental data type.
Definition: tokenutils.h:205
FT getValue(const Token &t)
getValue provides easy read-access to a Token's contents.
Definition: tokenutils.h:148
Token newToken< long >(long const &value)
Definition: tokenutils.cc:61
void setValue< float >(const Token &, float const &value)
Definition: tokenutils.cc:105
long getValue< long >(const Token &)
Definition: tokenutils.cc:36
void setValue< bool >(const Token &, bool const &value)
Definition: tokenutils.cc:137
Token newToken< bool >(bool const &value)
Definition: tokenutils.cc:152
Token newToken< double >(double const &value)
Definition: tokenutils.cc:118
double getValue< double >(const Token &)
Definition: tokenutils.cc:68
A type-independent container for C++-types.
Definition: token.h:68
Token newToken2(FT const &value)
Create a new Token from a fundamental data type.
Definition: tokenutils.h:188
Datum * datum(void) const
Definition: token.h:249