Update of /cvsroot/objecthandler/ObjectHandler/oh
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10361/oh
Modified Files:
demo.hpp
Added Files:
demo.cpp
Log Message:
- transfer from QLXL to OHXL the infrastructure for looping behavior
- supplement ohThing() with additional member functions for testing loops
--- NEW FILE: demo.cpp ---
/*
Copyright (C) 2007 Eric Ehlers
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program 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 license for more details.
*/
#include <oh/demo.hpp>
namespace ObjHandler {
std::string Thing::ohThingFunc0(const std::string &p0) {
return p0;
}
double Thing::ohThingFunc1(const double &p0) {
return p0;
}
std::string Thing::ohThingFunc2(const std::string &p0, const std::string &p1, const std::string &p2) {
return p0 + " | " + p1 + " | " + p2;
}
std::string Thing::ohThingFunc3(const std::string &p0, const std::vector<std::string> &p1) {
std::string ret = p0;
for (std::vector<std::string>::const_iterator i = p1.begin(); i != p1.end(); i++) {
ret += " | " + *i;
}
return ret;
}
std::vector<std::string> Thing::ohThingFunc4(const std::string &p0, const std::vector<std::string> &p1) {
std::vector<std::string> ret;
for (std::vector<std::string>::const_iterator i = p1.begin(); i != p1.end(); i++) {
ret.push_back(*i + " | " + p0);
}
return ret;
}
std::string Thing::ohThingFunc5(const std::string &p0, const std::string &p1) {
return p0 + " | " + p1;
}
std::vector<std::string> Thing::ohThingFunc6(const std::string &p0) {
std::vector<std::string> ret;
ret.push_back(p0);
return ret;
}
}
Index: demo.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/demo.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** demo.hpp 2 Jan 2007 10:59:39 -0000 1.2
--- demo.hpp 12 Jan 2007 08:33:43 -0000 1.3
***************
*** 39,42 ****
--- 39,50 ----
return doubleParameter_;
}
+
+ std::string ohThingFunc0(const std::string &);
+ double ohThingFunc1(const double &);
+ std::string ohThingFunc2(const std::string &, const std::string &, const std::string &);
+ std::string ohThingFunc3(const std::string &, const std::vector<std::string> &);
+ std::vector<std::string> ohThingFunc4(const std::string &, const std::vector<std::string> &);
+ std::string ohThingFunc5(const std::string &, const std::string &);
+ std::vector<std::string> ohThingFunc6(const std::string &);
private:
std::string stringParameter_;
|