Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleParam.cpp

Example for using the BIAS::Param parameter object

Author
MIP
/*
This file is part of the BIAS library (Basic ImageAlgorithmS).
Copyright (C) 2003-2009 (see file CONTACT for details)
Multimediale Systeme der Informationsverarbeitung
Institut fuer Informatik
Christian-Albrechts-Universitaet Kiel
BIAS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
BIAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with BIAS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/** @example ExampleParam.cpp
* @relates Param
@ingroup g_examples
@brief Example for using the BIAS::Param parameter object
@author MIP */
#include <iostream>
#include <Utils/Param.hh>
#include <Base/Math/Vector.hh>
using namespace std;
using namespace BIAS;
// class MyAlgorithm : public ParamCallbackInterface
// {
// public:
// MyAlgorithm(){};
// ~MyAlgorithm(){};
// void AddParam(Param &p) {
// p.AddParamInt("coollevel","Really cool threshold");
// };
// };
int main(int argc, char *argv[])
{
Param *p = new Param();
Vector<int> vi(3);
vector<string> myenums;
// p.SetDebugLevel(D_PARAM_PARSECMDL);
myenums.push_back("foo");
myenums.push_back("bar");
p->AddParamInt("int-test","Help for testint",42,3,100,'i');
p->AddParamDouble("dbl-test","Help for testdbl",1.42,-3.1415,3.1415);
p->AddParamString("str-test","Help for teststr","halloe!");
p->AddParamDouble("dbl-more-test","Help for testdbl",1.42,-3.1415,3.1415);
p->AddParamString("str-more-test","Help for teststr","halloe!");
p->AddParamBool("bool","Help for bool",false);
p->AddParamVecDbl("dbl-vec","Help me, if you can",vd);
p->AddParamVecInt("int-vec","Help me, if you can",vi);
p->AddParamEnum("enum","Help me, if you can",myenums);
p->ParseCommandLine(argc,argv);
p->ShowData();
return 0;
}