Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef TESTCLASS_H_
00009 #define TESTCLASS_H_
00010
00011
00012 #include <telekyb_base/Options.hpp>
00013
00014 #include "Eigen/Dense"
00015
00016 #include <boost/program_options.hpp>
00017 namespace po = boost::program_options;
00018
00019 #include <telekyb_base/Spaces.hpp>
00020
00021
00022 #include <telekyb_defines/enum.hpp>
00023
00024 TELEKYB_ENUM(Level,
00025 (Abort)
00026 (Error)
00027 (Alert)
00028 (Info)
00029 (Trace)
00030 (Debug)
00031 )
00032
00033 TELEKYB_ENUM_VALUES(LevelVal, const char*,
00034 (Abort)("unrecoverable problem")
00035 (Error)("recoverable problem")
00036 (Alert)("unexpected behavior")
00037 (Info) ("expected behavior")
00038 (Trace)("normal flow of execution")
00039 (Debug)("detailed object state listings")
00040 )
00041
00042 class TestOptionContainer : public telekyb::OptionContainer {
00043 public:
00044 TestOptionContainer();
00045 telekyb::Option<int>* intOp1;
00046 telekyb::Option<int>* intOp2;
00047 telekyb::Option<double>* doubleOp1;
00048 telekyb::Option<Eigen::Matrix3i>* matOp3;
00049 telekyb::Option<LevelValBaseEnum<const char*>::Type>* levelVarOption;
00050 telekyb::Option<LevelBaseEnum::Type >* levelOption;
00051 telekyb::Option<telekyb::Position3D>* pos3D;
00052 telekyb::Option<Eigen::Quaterniond>* testQuatOption;
00053 telekyb::Option<Eigen::Matrix<double, Eigen::Dynamic, 2> >* dynamicVec;
00054 };
00055
00056 class TestListener : public telekyb::OptionListener<int>, public telekyb::OptionListener<double> {
00057 void optionDidChange(const telekyb::Option<int>* option);
00058 void optionShouldDelete(const telekyb::Option<int>* option);
00059 void optionDidChange(const telekyb::Option<double>* option) {
00060 std::cout << "Option changed! " << option->getValue() << std::endl;
00061 }
00062 void optionShouldDelete(const telekyb::Option<double>* option) {
00063 std::cout << "Option should deleted! " << option->getValue() << std::endl;
00064 }
00065
00066
00067 };
00068
00069
00070
00071 #endif