/usr/include/bulletml/formula-variables.h is in libbulletml-dev 0.0.6-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #ifndef FORMULA_VARIABLE_H_
#define FORMULA_VARIABLE_H_
#include "formula.h"
#include "bulletmlrunner.h"
#include "bulletmlcommon.h"
#include <cstdlib>
#include <vector>
namespace Variables {
DECLSPEC extern double rank;
DECLSPEC extern std::vector<double>* parameters;
DECLSPEC extern BulletMLRunner* runner;
}
template <typename Val_>
class Random : public AbstractNumber<Val_> {
public:
DECLSPEC virtual Val_ value() const {
return Variables::runner->getRand();
}
};
template <typename Val_>
class Rank : public AbstractNumber<Val_> {
public:
DECLSPEC virtual Val_ value() const {
return Variables::rank;
}
};
template <typename Val_>
class Param : public AbstractNumber<Val_> {
public:
DECLSPEC explicit Param(unsigned int id) : id_(id) {}
DECLSPEC virtual Val_ value() const {
if (Variables::parameters && id_ < Variables::parameters->size()) {
return (*Variables::parameters)[id_];
}
else {
return 1;
}
}
private:
unsigned int id_;
};
#endif // ! FORMULA_VARIABLE_H_
|