objecthandler-cvs Mailing List for ObjectHandler (Page 10)
Brought to you by:
ericehlers,
nando
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(115) |
Jun
(109) |
Jul
(85) |
Aug
(49) |
Sep
(19) |
Oct
(105) |
Nov
(16) |
Dec
(43) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(63) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Eric E. <eri...@us...> - 2006-10-04 03:42:26
|
Update of /cvsroot/objecthandler/ObjectHandler/Docs/pages In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9029/Docs/pages Modified Files: history.docs Log Message: update docs Index: history.docs =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Docs/pages/history.docs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** history.docs 19 May 2006 15:12:41 -0000 1.1 --- history.docs 3 Oct 2006 11:24:21 -0000 1.2 *************** *** 24,27 **** --- 24,66 ---- /*! \page history Version History + <strong>Release 0.2.0 - October 2006</strong> + + EXCEL + + - new function "ohRetrieveError()" returns whatever error message + is associated with the active range + + LOG4CXX + + No changes to the log4cxx environment. ObjectHandler 0.2.0 continues + to rely on the customized log4cxx "0.9.7a" package which shipped + with ObjectHandler version 0.1.4 (see below). + + REQUIRED PACKAGES + + - Boost version 1.31.0 or later + - log4cxx version 0.9.7.a + - gensrc version 0.2.0 + + <strong>Release 0.1.4 - August 2006</strong> + + EXCEL + + - support for permanent objects not deleted by garbage collection + - use gensrc where possible to generate source code for ObjectHandler + + LOG4CXX + + Created package "log4cxx 0.9.7a" which is a customization of log4cxx0.9.7, + providing better support for VC, boost-format version numbers for lib files, + etc. log4cxx 0.9.7a is available from the ObjectHandler section of the + QuantLib downloads page. + + REQUIRED PACKAGES + + - Boost version 1.31.0 or later + - log4cxx version 0.9.7.a + - gensrc version 0.1.4 + <strong>Release 0.1.3 - March 2006</strong> |
From: Eric E. <eri...@us...> - 2006-10-04 03:39:11
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Functions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14894/ohxl/Functions Added Files: .cvsignore Log Message: subdivide function registration code into multiple source files --- NEW FILE: .cvsignore --- *.* |
From: Ferdinando A. <na...@us...> - 2006-09-28 15:46:23
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19980/ohxl Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 28 Sep 2006 15:44:51 -0000 1.3 --- .cvsignore 28 Sep 2006 15:46:20 -0000 1.4 *************** *** 2,6 **** Makefile.in export.hpp ! functioncount.cpp functions.cpp register.cpp --- 2,6 ---- Makefile.in export.hpp ! functioncount.hpp functions.cpp register.cpp |
From: Ferdinando A. <na...@us...> - 2006-09-28 15:44:54
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19907/ohxl Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 6 Jun 2006 09:44:26 -0000 1.2 --- .cvsignore 28 Sep 2006 15:44:51 -0000 1.3 *************** *** 1,6 **** Makefile Makefile.in - unregister.cpp export.hpp functions.cpp ! register.cpp \ No newline at end of file --- 1,7 ---- Makefile Makefile.in export.hpp + functioncount.cpp functions.cpp ! register.cpp ! unregister.cpp |
From: Francois du V. <fd...@us...> - 2006-09-27 16:04:20
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11132 Modified Files: config.xml excel.xml Log Message: move implicit conversions from excel to config Index: config.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/config/config.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.xml 15 Sep 2006 10:07:11 -0000 1.5 --- config.xml 27 Sep 2006 16:04:16 -0000 1.6 *************** *** 8,11 **** --- 8,13 ---- </categoryNames> + <implicitConversions/> + </Config> Index: excel.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/config/excel.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** excel.xml 11 Jul 2006 13:30:39 -0000 1.2 --- excel.xml 27 Sep 2006 16:04:16 -0000 1.3 *************** *** 13,17 **** <Buffer name='exportStub' fileName='stub.excel.exports' local='true'/> - <implicitConversions/> - </root> --- 13,15 ---- |
From: Eric E. <eri...@us...> - 2006-09-22 15:20:55
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27146/gensrc/metadata Modified Files: functions.xml Log Message: implement separate gensrc class to generate source code for loop functions Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** functions.xml 20 Sep 2006 20:17:07 -0000 1.17 --- functions.xml 22 Sep 2006 15:20:52 -0000 1.18 *************** *** 64,68 **** </Procedure> ! <Member name='ohPropertyNames' objectClass='Object' loopParameter='None'> <description>retrieve the property names of a given object</description> <libraryFunction>propertyNames</libraryFunction> --- 64,68 ---- </Procedure> ! <Member name='ohPropertyNames' objectClass='Object'> <description>retrieve the property names of a given object</description> <libraryFunction>propertyNames</libraryFunction> *************** *** 79,83 **** </Member> ! <Member name='ohPropertyValue' objectClass='Object' dependencyTrigger='true' loopParameter='None'> <description>retrieve the value of a named property</description> <libraryFunction>propertyValue</libraryFunction> --- 79,83 ---- </Member> ! <Member name='ohPropertyValue' objectClass='Object' dependencyTrigger='true'> <description>retrieve the value of a named property</description> <libraryFunction>propertyValue</libraryFunction> |
From: Eric E. <eri...@us...> - 2006-09-20 20:17:15
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/ohxll In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32397/ohxl/ohxll Modified Files: ohxll.vcproj ohxll_vc8.vcproj Log Message: enable user to right-click anywhere in range to retrieve error message Index: ohxll_vc8.vcproj =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/ohxll/ohxll_vc8.vcproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ohxll_vc8.vcproj 31 Aug 2006 08:41:37 -0000 1.10 --- ohxll_vc8.vcproj 20 Sep 2006 20:17:07 -0000 1.11 *************** *** 321,324 **** --- 321,332 ---- </File> <File + RelativePath="..\rangereference.cpp" + > + </File> + <File + RelativePath="..\rangereference.hpp" + > + </File> + <File RelativePath="..\register.cpp" > Index: ohxll.vcproj =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/ohxll/ohxll.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ohxll.vcproj 31 Aug 2006 09:12:15 -0000 1.5 --- ohxll.vcproj 20 Sep 2006 20:17:07 -0000 1.6 *************** *** 233,236 **** --- 233,242 ---- </File> <File + RelativePath="..\rangereference.cpp"> + </File> + <File + RelativePath="..\rangereference.hpp"> + </File> + <File RelativePath="..\register.cpp"> </File> |
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32397/ohxl Modified Files: callingrange.cpp callingrange.hpp objecthandlerxl.cpp objecthandlerxl.hpp Added Files: rangereference.cpp rangereference.hpp Log Message: enable user to right-click anywhere in range to retrieve error message Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** objecthandlerxl.cpp 18 Sep 2006 11:20:37 -0000 1.16 --- objecthandlerxl.cpp 20 Sep 2006 20:17:07 -0000 1.17 *************** *** 220,230 **** } ! std::string ObjectHandlerXL::retrieveError(const std::string& address) { ! for (rangeMapIter i = callingRanges_.begin(); i != callingRanges_.end(); i++) { ! boost::shared_ptr<CallingRange> callingRange = i->second; ! if (callingRange->getAddressString() == address) ! return callingRange->errorMessage(); } - return ""; } --- 220,257 ---- } ! std::string ObjectHandlerXL::retrieveError() { ! ! // XLOPER which might need freeing in the event of an exception ! ! XLOPER xSelectionRef, xSelectionText; ! ! try { ! ! Excel(xlfSelection, &xSelectionRef, 0); ! Excel(xlfReftext, &xSelectionText, 1, &xSelectionRef); ! std::string selectionText; ! operToScalar(selectionText, xSelectionText); ! Excel(xlFree, 0, 2, &xSelectionRef, &xSelectionText); ! RangeReference selectionReference(selectionText); ! ! for (rangeMapIter i = callingRanges_.begin(); i != callingRanges_.end(); i++) { ! boost::shared_ptr<CallingRange> callingRange = i->second; ! if (callingRange->contains(selectionReference)) ! return callingRange->errorMessage(); ! } ! return ""; ! ! } catch (const std::exception &e) { ! ! // free any memory that may have been allocated ! ! Excel(xlFree, 0, 2, &xSelectionRef, &xSelectionText); ! ! // propagate the exception ! ! std::ostringstream err; ! err << "ObjectHandlerXL::retrieveError(): " << e.what(); ! throw Exception(err.str()); } } Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** objecthandlerxl.hpp 18 Sep 2006 11:20:37 -0000 1.13 --- objecthandlerxl.hpp 20 Sep 2006 20:17:07 -0000 1.14 *************** *** 70,74 **** void logError(const std::string &message, const bool &append = false); ! std::string retrieveError(const std::string&); void clearError(); private: --- 70,74 ---- void logError(const std::string &message, const bool &append = false); ! std::string retrieveError(); void clearError(); private: --- NEW FILE: rangereference.cpp --- /* Copyright (C) 2006 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 <ohxl/rangereference.hpp> #include <oh/exception.hpp> #include <oh/utilities.hpp> #include <boost/regex.hpp> #include <boost/lexical_cast.hpp> namespace ObjHandler { RangeReference::RangeReference(const std::string &address) : originalAddress_(address) { std::string addressUpper = uppercase(address); static boost::regex r( "=?'?.*\\[([\\w\\s]+)(?:\\.XLS)?\\]([\\w\\s]+)'?!R(\\d*)C(\\d*)(?::R(\\d*)C(\\d*))?"); boost::smatch m; if (!boost::regex_match(addressUpper, m, r)) { std::ostringstream err; err << "the string '" << address << "' is not a valid range reference"; throw Exception(err.str().c_str()); } bookName_ = m[1]; sheetName_ = m[2]; rowStartNum_ = boost::lexical_cast<int>(m[3]); colStartNum_ = boost::lexical_cast<int>(m[4]); if (m[5].matched) { multicell_ = true; rowEndNum_ = boost::lexical_cast<int>(m[5]); colEndNum_ = boost::lexical_cast<int>(m[6]); } else { multicell_ = false; rowEndNum_ = -1; colEndNum_ = -1; } } bool RangeReference::contains(const RangeReference &r) const { if (*this == r) return true; if (this->bookName_ != r.bookName_) return false; if (this->sheetName_ != r.sheetName_) return false; if (this->multicell_) { if (r.multicell_) { return r.rowStartNum_ >= this->rowStartNum_ && r.rowEndNum_ <= this->rowEndNum_ && r.colStartNum_ >= this->colStartNum_ && r.colEndNum_ <= this->colEndNum_; } else { return r.rowStartNum_ >= this->rowStartNum_ && r.rowStartNum_ <= this->rowEndNum_ && r.colStartNum_ >= this->colStartNum_ && r.colStartNum_ <= this->colEndNum_; } } else { if (r.multicell_) return false; return r.rowStartNum_ == this->rowStartNum_ && r.colStartNum_ == this->colStartNum_; } } bool RangeReference::operator==(const RangeReference &r) const { if (this->originalAddress_ == r.originalAddress_) return true; return this->bookName_ == r.bookName_ && this->sheetName_ == r.sheetName_ && this->multicell_ == r.multicell_ && this->rowStartNum_ == r.rowStartNum_ && this->colStartNum_ == r.colStartNum_ && this->rowEndNum_ == r.rowEndNum_ && this->colEndNum_ == r.colEndNum_; } std::ostream &operator<<(std::ostream &out, const RangeReference &r) { out << "originalAddress = " << r.originalAddress_ << std::endl; out << "bookName = " << r.bookName_ << std::endl; out << "sheetName = " << r.sheetName_ << std::endl; out << "multicell = " << r.multicell_ << std::endl; out << "rowStartNum = " << r.rowStartNum_ << std::endl; out << "colStartNum = " << r.colStartNum_ << std::endl; out << "rowEndNum = " << r.rowEndNum_ << std::endl; out << "colEndNum = " << r.colEndNum_ << std::endl; return out; } } --- NEW FILE: rangereference.hpp --- /* Copyright (C) 2006 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. */ /*! \file \brief Object class */ #include <string> namespace ObjHandler { //! A utility class for parsing range references in string format. /*! The constructor to this class accepts strings returned from Excel functions such as xlfGetName and xlfReftext. Strings are parsed and their tokens stored in separate variables to facilitate comparisons such as determing whether one range contains another. Excel returns a variety of strings to represent references. The following formats are supported: normal: "[Book1.xls]Sheet1!R1C1" some excel functions prepend an '=' sign: "=[Book1.xls]Sheet1!R1C1" if book or sheet name contains spaces then Excel encloses the text in single quotes: "'[Bo ok1.xls]Sheet1'!R1C1" for a new book that hasn't yet been saved, excel omits the .xls suffix: "[Book1]Sheet1!R1C1" sometimes the string includes the filesystem path: "='C:\\path\\to\\[Book1.xls]Sheet1'!R1C1" In all cases, the cell reference, represented above as R1C1, may also be given as R1C1:R9C9 i.e. a range consisting of multiple cells, in which case the RangeReference constructor sets multicell_ to true. There is one further case which is not supported. If a workbook contains a single sheet which has the same name as the book, Excel gives the string reference in the following format, which the RangeReference constructor doesn't recognize: "xxx.xls!R1C1" Unsupported formats cause an exception to be thrown. */ class RangeReference { public: RangeReference(const std::string &address); bool operator==(const RangeReference&) const; bool contains(const RangeReference&) const; friend std::ostream &operator<<(std::ostream&, const RangeReference&); private: std::string originalAddress_; std::string bookName_; std::string sheetName_; bool multicell_; int rowStartNum_; int colStartNum_; int rowEndNum_; int colEndNum_; }; std::ostream &operator<<(std::ostream&, const RangeReference&); } Index: callingrange.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** callingrange.hpp 18 Sep 2006 11:20:37 -0000 1.8 --- callingrange.hpp 20 Sep 2006 20:17:07 -0000 1.9 *************** *** 24,27 **** --- 24,28 ---- #include <oh/object.hpp> + #include <ohxl/rangereference.hpp> #include <map> *************** *** 56,59 **** --- 57,61 ---- } std::string getAddressString() const; + bool contains(const RangeReference&); private: static int keyCount_; *************** *** 66,69 **** --- 68,72 ---- int invocationCount_; std::map<std::string, boost::shared_ptr<Object> > residentObjects_; + boost::shared_ptr<RangeReference> rangeReference_; }; Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** callingrange.cpp 18 Sep 2006 11:20:37 -0000 1.9 --- callingrange.cpp 20 Sep 2006 20:17:07 -0000 1.10 *************** *** 135,138 **** --- 135,139 ---- } + // FIXME cache this value std::string CallingRange::getAddressString() const { *************** *** 165,168 **** --- 166,176 ---- } + bool CallingRange::contains(const RangeReference &testReference) { + if (!rangeReference_) + rangeReference_ = boost::shared_ptr<RangeReference>( + new RangeReference(getAddressString())); + return rangeReference_->contains(testReference); + } + void CallingRange::setErrorMessage(const std::string &errorMessage, const bool &append) { if (append) { |
From: Eric E. <eri...@us...> - 2006-09-20 20:17:14
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/ohxllib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32397/ohxl/ohxllib Modified Files: ohxllib.vcproj ohxllib_vc8.vcproj Log Message: enable user to right-click anywhere in range to retrieve error message Index: ohxllib_vc8.vcproj =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/ohxllib/ohxllib_vc8.vcproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ohxllib_vc8.vcproj 31 Aug 2006 08:41:37 -0000 1.8 --- ohxllib_vc8.vcproj 20 Sep 2006 20:17:08 -0000 1.9 *************** *** 434,437 **** --- 434,445 ---- </File> <File + RelativePath="..\rangereference.cpp" + > + </File> + <File + RelativePath="..\rangereference.hpp" + > + </File> + <File RelativePath="..\register.cpp" > Index: ohxllib.vcproj =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/ohxllib/ohxllib.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ohxllib.vcproj 31 Aug 2006 08:41:37 -0000 1.4 --- ohxllib.vcproj 20 Sep 2006 20:17:08 -0000 1.5 *************** *** 413,416 **** --- 413,422 ---- </File> <File + RelativePath="..\rangereference.cpp"> + </File> + <File + RelativePath="..\rangereference.hpp"> + </File> + <File RelativePath="..\register.cpp"> </File> |
From: Eric E. <eri...@us...> - 2006-09-20 20:17:13
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32397/gensrc/metadata Modified Files: functions.xml Log Message: enable user to right-click anywhere in range to retrieve error message Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** functions.xml 15 Sep 2006 22:33:12 -0000 1.16 --- functions.xml 20 Sep 2006 20:17:07 -0000 1.17 *************** *** 407,417 **** </supportedPlatforms> <ParameterList> ! <Parameters> ! <Parameter name='address'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>cell address in format [BOOK.XLS]SHEET!$A$9</description> ! </Parameter> ! </Parameters> </ParameterList> <ReturnValue> --- 407,411 ---- </supportedPlatforms> <ParameterList> ! <Parameters/> </ParameterList> <ReturnValue> |
From: Eric E. <eri...@us...> - 2006-09-20 20:17:13
|
Update of /cvsroot/objecthandler/ObjectHandler/Examples/xl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32397/Examples/xl Modified Files: addindynamic1.cpp addinstatic.cpp Log Message: enable user to right-click anywhere in range to retrieve error message Index: addindynamic1.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Examples/xl/addindynamic1.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** addindynamic1.cpp 9 Jun 2006 18:58:27 -0000 1.7 --- addindynamic1.cpp 20 Sep 2006 20:17:07 -0000 1.8 *************** *** 72,75 **** --- 72,76 ---- functionCall = boost::shared_ptr < ObjHandler::FunctionCall > ( new ObjHandler::FunctionCall("addin1CreateAccount") ); + ObjHandler::ObjectHandlerXL::instance().resetCaller(true); boost::shared_ptr < ObjHandler::Object > objectPointer(new AccountObject( *accountNumber, Index: addinstatic.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Examples/xl/addinstatic.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** addinstatic.cpp 27 Jul 2006 09:37:35 -0000 1.10 --- addinstatic.cpp 20 Sep 2006 20:17:07 -0000 1.11 *************** *** 88,91 **** --- 88,92 ---- functionCall = boost::shared_ptr < ObjHandler::FunctionCall > ( new ObjHandler::FunctionCall("createAccount") ); + ObjHandler::ObjectHandlerXL::instance().resetCaller(true); bool permanentCpp; |
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16552/ohxl Modified Files: callingrange.cpp callingrange.hpp functioncall.cpp functioncall.hpp objecthandlerxl.cpp objecthandlerxl.hpp Log Message: separate error message for each iteration in a loop function Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** objecthandlerxl.cpp 31 Aug 2006 11:00:47 -0000 1.15 --- objecthandlerxl.cpp 18 Sep 2006 11:20:37 -0000 1.16 *************** *** 157,164 **** if (objectIDCount_ == ULONG_MAX) { std::ostringstream msg; ! msg << "ObjectHandler has exceeded the maximum limit of " << ULONG_MAX ! << " names that can be automatically generated for 'anonymous objects'" ! << " (objects where the user has supplied an empty string as an ID)." ! << " Please invoke ohDeleteAllObjects(TRUE) or restart the application."; throw Exception(msg.str()); } --- 157,164 ---- if (objectIDCount_ == ULONG_MAX) { std::ostringstream msg; ! msg << "ObjectHandler has exceeded the maximum limit of " << ULONG_MAX << ! " names that can be automatically generated for 'anonymous objects'" ! " (objects where the user has supplied an empty string as an ID)." ! " Please invoke ohDeleteAllObjects(TRUE) or restart the application."; throw Exception(msg.str()); } *************** *** 212,220 **** } ! void ObjectHandlerXL::logError(const std::string& message) { logMessage(message, 2); if (FunctionCall::instance().getCallerType() == Cell) { boost::shared_ptr<CallingRange> callingRange = getCallingRange(true); ! callingRange->setErrorMessage(message); } } --- 212,220 ---- } ! void ObjectHandlerXL::logError(const std::string& message, const bool &append) { logMessage(message, 2); if (FunctionCall::instance().getCallerType() == Cell) { boost::shared_ptr<CallingRange> callingRange = getCallingRange(true); ! callingRange->setErrorMessage(message, append); } } *************** *** 229,231 **** --- 229,236 ---- } + void ObjectHandlerXL::clearError() { + boost::shared_ptr<CallingRange> callingRange = getCallingRange(); + if (callingRange) callingRange->clearError(); + } + } Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** objecthandlerxl.hpp 31 Aug 2006 11:00:47 -0000 1.12 --- objecthandlerxl.hpp 18 Sep 2006 11:20:37 -0000 1.13 *************** *** 69,74 **** virtual void dump(std::ostream&); ! void logError(const std::string&); std::string retrieveError(const std::string&); private: boost::shared_ptr<CallingRange> getCallingRange(bool createIfNone = false); --- 69,75 ---- virtual void dump(std::ostream&); ! void logError(const std::string &message, const bool &append = false); std::string retrieveError(const std::string&); + void clearError(); private: boost::shared_ptr<CallingRange> getCallingRange(bool createIfNone = false); Index: callingrange.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** callingrange.hpp 31 Aug 2006 11:00:47 -0000 1.7 --- callingrange.hpp 18 Sep 2006 11:20:37 -0000 1.8 *************** *** 46,57 **** friend std::ostream &operator<<(std::ostream&, const CallingRange&); bool empty() { ! return (residentObjects_.size() == 0); ! } ! void setErrorMessage(const std::string &errorMessage) { ! errorMessage_ = errorMessage; } const std::string errorMessage() const { return errorMessage_; } std::string getAddressString() const; private: --- 46,58 ---- friend std::ostream &operator<<(std::ostream&, const CallingRange&); bool empty() { ! return (residentObjects_.empty()); } + void setErrorMessage(const std::string &errorMessage, const bool &append); const std::string errorMessage() const { return errorMessage_; } + void clearError() { + errorMessage_ = ""; + } std::string getAddressString() const; private: Index: functioncall.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** functioncall.cpp 17 Jul 2006 17:46:46 -0000 1.9 --- functioncall.cpp 18 Sep 2006 11:20:37 -0000 1.10 *************** *** 88,91 **** --- 88,95 ---- } + const std::string &FunctionCall::getFunctionName() { + return functionName_; + } + const std::string &FunctionCall::getFormula() { if (formula_.empty()) { Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** callingrange.cpp 31 Aug 2006 11:00:47 -0000 1.8 --- callingrange.cpp 18 Sep 2006 11:20:37 -0000 1.9 *************** *** 165,168 **** --- 165,178 ---- } + void CallingRange::setErrorMessage(const std::string &errorMessage, const bool &append) { + if (append) { + std::ostringstream err; + err << errorMessage_ << std::endl << std::endl << errorMessage; + errorMessage_ = err.str(); + } else { + errorMessage_ = errorMessage; + } + } + // FIXME use boost::regex here void CallingRange::setInvocationCount() { Index: functioncall.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functioncall.hpp 17 Jul 2006 17:46:46 -0000 1.6 --- functioncall.hpp 18 Sep 2006 11:20:37 -0000 1.7 *************** *** 49,52 **** --- 49,53 ---- const XLOPER *getCallerArray(); const std::string &getAddressString(); + const std::string &getFunctionName(); const std::string &getFormula(); //bool outerFunction(); |
From: Eric E. <eri...@us...> - 2006-09-15 22:33:16
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18568/gensrc/metadata Modified Files: functions.xml Log Message: streamline file I/O Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** functions.xml 4 Sep 2006 19:20:35 -0000 1.15 --- functions.xml 15 Sep 2006 22:33:12 -0000 1.16 *************** *** 4,7 **** --- 4,14 ---- <xlFunctionWizardCategory>ObjectHandler</xlFunctionWizardCategory> + <copyright> + Copyright (C) 2004, 2005 Ferdinando Ametrano + Copyright (C) 2004, 2005, 2006 Eric Ehlers + Copyright (C) 2005, 2006 Plamen Neykov + Copyright (C) 2004 StatPro Italia srl + </copyright> + <Functions> |
From: Eric E. <eri...@us...> - 2006-09-15 22:33:15
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/stubs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18568/gensrc/stubs Modified Files: stub.copyright Log Message: streamline file I/O Index: stub.copyright =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.copyright,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stub.copyright 6 Jun 2006 09:08:30 -0000 1.1 --- stub.copyright 15 Sep 2006 22:33:12 -0000 1.2 *************** *** 1,8 **** ! /* ! Copyright (C) 2004, 2005 Ferdinando Ametrano ! Copyright (C) 2004, 2005, 2006 Eric Ehlers ! Copyright (C) 2005, 2006 Plamen Neykov ! Copyright (C) 2004 StatPro Italia srl This file is part of QuantLib, a free-software/open-source library --- 1,4 ---- ! /* %(copyright)s This file is part of QuantLib, a free-software/open-source library |
From: Eric E. <eri...@us...> - 2006-09-15 10:07:15
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7361/gensrc/config Modified Files: config.xml Log Message: implement template for functions which loop on input parameter Index: config.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/config/config.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** config.xml 1 Sep 2006 10:45:38 -0000 1.4 --- config.xml 15 Sep 2006 10:07:11 -0000 1.5 *************** *** 2,6 **** <excelRootDirectory>ohxl</excelRootDirectory> ! <namespace1>ObjHandler</namespace1> <categoryNames> --- 2,6 ---- <excelRootDirectory>ohxl</excelRootDirectory> ! <namespaceObjects>ObjHandler</namespaceObjects> <categoryNames> |
From: Eric E. <eri...@us...> - 2006-09-13 09:03:04
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24076/gensrc/scripts Modified Files: gensrc.py Log Message: circular dependencies - replace quick fix with permanent fix Index: gensrc.py =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/scripts/gensrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gensrc.py 6 Jun 2006 09:08:27 -0000 1.1 --- gensrc.py 13 Sep 2006 09:02:59 -0000 1.2 *************** *** 16,22 **** """ import addinexcel import utilities - import config config.Config.getInstance().initialize() --- 16,22 ---- """ + import config import addinexcel import utilities config.Config.getInstance().initialize() |
From: Eric E. <eri...@us...> - 2006-09-11 19:50:28
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31810/ohxl Modified Files: conversions.hpp Log Message: consolidate conversion code (precursor to loop template changes) Index: conversions.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/conversions.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** conversions.hpp 13 Jul 2006 10:35:39 -0000 1.10 --- conversions.hpp 11 Sep 2006 19:50:23 -0000 1.11 *************** *** 43,48 **** const bool &expandVectors = true); ! template < class T > ! void vectorToXloper(XLOPER &xVector, const std::vector < T > &v) { if (v.empty()) { //xVector.xltype = xltypeNum; --- 43,48 ---- const bool &expandVectors = true); ! template <class T> ! void vectorToXloper(XLOPER &xVector, const std::vector<T> &v) { if (v.empty()) { //xVector.xltype = xltypeNum; *************** *** 68,101 **** } ! template < class T > ! void vectorToXloper(XLOPER &xVector, const std::vector < T > &v, const XLOPER *xInput) { ! // set xVector with contents of v and dimensions of xInput ! ! if (v.empty()) { ! //xVector.xltype = xltypeNum; ! //xVector.val.num = 0; ! xVector.xltype = xltypeErr; ! xVector.val.err = xlerrNA; ! return; ! } ! if (!xInput || xInput->xltype != xltypeMulti) ! throw Exception("vectorToXloper: input parameter is not an array"); ! ! xVector.val.array.columns = xInput->val.array.columns; ! xVector.val.array.rows = xInput->val.array.rows; ! int inputSize = xVector.val.array.columns * xVector.val.array.rows; ! if (inputSize != v.size()) ! throw Exception("vectorToXloper: input array dimensions incompatible with data"); ! xVector.val.array.lparray = new XLOPER[inputSize]; ! if (!xVector.val.array.lparray) ! throw Exception("vectorToXloper: error on call to new"); ! xVector.xltype = xltypeMulti | xlbitDLLFree; ! ! for (unsigned int i=0; i<v.size(); i++) ! scalarToXloper(xVector.val.array.lparray[i], v[i]); ! } ! ! template < class T > ! void matrixToXloper(XLOPER &xMatrix, const std::vector < std::vector < T > > &vv) { if (vv.empty() || vv[0].empty()) { //xMatrix.xltype = xltypeNum; --- 68,73 ---- } ! template <class T> ! void matrixToXloper(XLOPER &xMatrix, const std::vector<std::vector<T> > &vv) { if (vv.empty() || vv[0].empty()) { //xMatrix.xltype = xltypeNum; *************** *** 112,116 **** xMatrix.xltype = xltypeMulti | xlbitDLLFree; for (unsigned int i=0; i<vv.size(); i++) { ! std::vector < T > v = vv[i]; for (unsigned int j=0; j<v.size(); j++) scalarToXloper(xMatrix.val.array.lparray[i * v.size() + j], v[j]); --- 84,88 ---- xMatrix.xltype = xltypeMulti | xlbitDLLFree; for (unsigned int i=0; i<vv.size(); i++) { ! std::vector<T> v = vv[i]; for (unsigned int j=0; j<v.size(); j++) scalarToXloper(xMatrix.val.array.lparray[i * v.size() + j], v[j]); *************** *** 121,132 **** DLL_API void operToScalar(long &ret, const OPER &xScalar, const long &defaultValue = 0); ! DLL_API void operToScalar(double &ret, const OPER &xScalar, const double &defaultValue = 0); DLL_API void operToScalar(bool &ret, const OPER &xScalar, const bool &defaultValue = false); DLL_API void operToScalar(std::string &ret, const OPER &xScalar, const std::string &defaultValue = ""); DLL_API void operToScalar(boost::any &ret, const OPER &xScalar); ! template < class T > ! std::vector < T > fpToVector(const FP &fpVector) { ! std::vector < T > ret; for (int i=0; i<fpVector.rows * fpVector.columns; i++) ret.push_back(fpVector.array[i]); --- 93,104 ---- DLL_API void operToScalar(long &ret, const OPER &xScalar, const long &defaultValue = 0); ! DLL_API void operToScalar(double &ret, const OPER &xScalar, const double &defaultValue = 0.); DLL_API void operToScalar(bool &ret, const OPER &xScalar, const bool &defaultValue = false); DLL_API void operToScalar(std::string &ret, const OPER &xScalar, const std::string &defaultValue = ""); DLL_API void operToScalar(boost::any &ret, const OPER &xScalar); ! template <class T> ! std::vector<T> fpToVector(const FP &fpVector) { ! std::vector<T> ret; for (int i=0; i<fpVector.rows * fpVector.columns; i++) ret.push_back(fpVector.array[i]); *************** *** 134,143 **** } ! template < class T > ! std::vector < T > operToVector(const OPER &xVector) { OPER xTemp; bool needToFree = false; try { ! std::vector < T > ret; if (xVector.xltype & xltypeErr) throw Exception("input value is #NULL (xltypeErr)"); --- 106,115 ---- } ! template <class T> ! std::vector<T> operToVector(const OPER &xVector) { OPER xTemp; bool needToFree = false; try { ! std::vector<T> ret; if (xVector.xltype & xltypeErr) throw Exception("input value is #NULL (xltypeErr)"); *************** *** 174,182 **** } ! template < class T > ! std::vector < std::vector < T > > fpToMatrix(const FP &fpMatrix) { ! std::vector < std::vector < T > > ret; for (int i=0; i<fpMatrix.rows; i++) { ! std::vector < T > row; for (int j=0; j<fpMatrix.columns; j++) row.push_back(fpMatrix.array[i * fpMatrix.columns + j]); --- 146,154 ---- } ! template <class T> ! std::vector<std::vector<T> > fpToMatrix(const FP &fpMatrix) { ! std::vector<std::vector<T> > ret; for (int i=0; i<fpMatrix.rows; i++) { ! std::vector<T> row; for (int j=0; j<fpMatrix.columns; j++) row.push_back(fpMatrix.array[i * fpMatrix.columns + j]); *************** *** 186,195 **** } ! template < class T > ! std::vector < std::vector < T > > operToMatrix(const OPER &xMatrix) { OPER xTemp; bool needToFree = false; try { ! std::vector < std::vector < T > > ret; if (xMatrix.xltype & xltypeErr) throw Exception("input value is #NULL (xltypeErr)"); --- 158,167 ---- } ! template <class T> ! std::vector<std::vector<T> > operToMatrix(const OPER &xMatrix) { OPER xTemp; bool needToFree = false; try { ! std::vector<std::vector<T> > ret; if (xMatrix.xltype & xltypeErr) throw Exception("input value is #NULL (xltypeErr)"); *************** *** 208,212 **** for (int i=0; i<xMulti->val.array.rows; i++) { ! std::vector < T > row; for (int j=0; j<xMulti->val.array.columns; j++) { T value; --- 180,184 ---- for (int i=0; i<xMulti->val.array.rows; i++) { ! std::vector<T> row; for (int j=0; j<xMulti->val.array.columns; j++) { T value; *************** *** 230,346 **** } - // convert excel datatypes to datatypes of underlying library - - template < typename T > - T operToScalarLibrary(const long &arg) { - if (arg) - return T(arg); - else - return T(); - } - - template < typename T > - T operToScalarLibrary(const std::string &arg) { - return T(arg); - } - - template < class T > - T operToScalarLibrary(const OPER &xArg, const long &defaultValue=0) { - long arg; - operToScalar(arg, xArg, defaultValue); - return operToScalarLibrary<T>(arg); - } - - template < class T > - std::vector < T > operToVectorLibrary(const OPER &xVector) { - OPER xTemp; - bool needToFree = false; - try { - std::vector < T > ret; - if (xVector.xltype & xltypeErr) - throw Exception("input value is #NULL (xltypeErr)"); - if (xVector.xltype & (xltypeMissing | xltypeNil)) - return ret; - - const OPER *xMulti; - - if (xVector.xltype == xltypeMulti) - xMulti = &xVector; - else { - Excel(xlCoerce, &xTemp, 2, &xVector, TempInt(xltypeMulti)); - xMulti = &xTemp; - needToFree = true; - } - - for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; i++) - ret.push_back(operToScalarLibrary<T>(xMulti->val.array.lparray[i])); - - if (needToFree) - Excel(xlFree, 0, 1, &xTemp); - - return ret; - } catch (const std::exception &e) { - if (needToFree) - Excel(xlFree, 0, 1, &xTemp); - std::ostringstream msg; - msg << "operToVectorLibrary: " << e.what(); - throw Exception(msg.str()); - } - } - - template < class T > - std::vector < T > operToVectorLibrary(const FP &fpVector) { - std::vector < T > ret; - for (int i=0; i<fpVector.rows * fpVector.columns; i++) - ret.push_back(operToScalarLibrary<T>(fpVector.array[i])); - return ret; - } - - // convert excel types to enumerations - - template < typename T, typename EnumRegistry > - T operToScalarEnum(const OPER &xScalar, const std::string &defaultValue="") { - std::string id; - operToScalar(id, xScalar, defaultValue); - return EnumRegistry()(id); - } - - template < typename T, typename EnumRegistry > - std::vector < T > operToVectorEnum(const OPER &xVector) { - std::vector < T > ret; - OPER xTemp; - bool needToFree = false; - try { - if (xVector.xltype & xltypeErr) - throw Exception("input value is #NULL (xltypeErr)"); - if (xVector.xltype & (xltypeMissing | xltypeNil)) - return ret; - - const OPER *xMulti; - - if (xVector.xltype == xltypeMulti) - xMulti = &xVector; - else { - Excel(xlCoerce, &xTemp, 2, &xVector, TempInt(xltypeMulti)); - xMulti = &xTemp; - needToFree = true; - } - - for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; i++) - ret.push_back(operToScalarEnum<T, EnumRegistry>(xMulti->val.array.lparray[i])); - - if (needToFree) - Excel(xlFree, 0, 1, &xTemp); - - return ret; - } catch (const std::exception &e) { - if (needToFree) - Excel(xlFree, 0, 1, &xTemp); - std::ostringstream msg; - msg << "operToVector: " << e.what(); - throw Exception(msg.str()); - } - } - } --- 202,205 ---- |
From: Eric E. <eri...@us...> - 2006-09-04 19:20:38
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14570/gensrc/metadata Modified Files: functions.xml Log Message: enhanced support for Member functions which loop on input parameter Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** functions.xml 31 Aug 2006 11:00:45 -0000 1.14 --- functions.xml 4 Sep 2006 19:20:35 -0000 1.15 *************** *** 57,61 **** </Procedure> ! <Member name='ohPropertyNames' objectClass='Object'> <description>retrieve the property names of a given object</description> <libraryFunction>propertyNames</libraryFunction> --- 57,61 ---- </Procedure> ! <Member name='ohPropertyNames' objectClass='Object' loopParameter='None'> <description>retrieve the property names of a given object</description> <libraryFunction>propertyNames</libraryFunction> *************** *** 72,76 **** </Member> ! <Member name='ohPropertyValue' objectClass='Object' dependencyTrigger='true'> <description>retrieve the value of a named property</description> <libraryFunction>propertyValue</libraryFunction> --- 72,76 ---- </Member> ! <Member name='ohPropertyValue' objectClass='Object' dependencyTrigger='true' loopParameter='None'> <description>retrieve the value of a named property</description> <libraryFunction>propertyValue</libraryFunction> |
From: Eric E. <eri...@us...> - 2006-09-01 21:28:12
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17359/ohxl Modified Files: conversions.cpp Log Message: remove data conversions no longer required by QuantLibAddin Index: conversions.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/conversions.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** conversions.cpp 14 Jul 2006 07:25:26 -0000 1.9 --- conversions.cpp 1 Sep 2006 21:28:10 -0000 1.10 *************** *** 104,116 **** std::string s = boost::any_cast<std::string>(value); scalarToXloper(xAny, s); - } else if (value.type() == typeid(AnyError)) { - AnyError err = boost::any_cast<AnyError>(value); - xAny.xltype = xltypeErr; - if (err == InvalidInput) - xAny.val.err = xlerrValue; - else if (err == CaughtException) - xAny.val.err = xlerrNum; - else - xAny.val.err = xlerrNull; } else if (value.type() == typeid(std::vector<long>)) { if (expandVectors) { --- 104,107 ---- |
From: Eric E. <eri...@us...> - 2006-09-01 21:28:12
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17359/oh Modified Files: utilities.hpp Log Message: remove data conversions no longer required by QuantLibAddin Index: utilities.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** utilities.hpp 17 Jul 2006 10:11:39 -0000 1.10 --- utilities.hpp 1 Sep 2006 21:28:10 -0000 1.11 *************** *** 30,35 **** namespace ObjHandler { - enum AnyError { InvalidInput, CaughtException }; - //! Retrieve ObjectHandler version string std::string version(); --- 30,33 ---- |
From: Eric E. <eri...@us...> - 2006-09-01 10:45:42
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10874/gensrc/config Modified Files: config.xml Log Message: make application directories fully configurable Index: config.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/config/config.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config.xml 19 Jul 2006 18:32:02 -0000 1.3 --- config.xml 1 Sep 2006 10:45:38 -0000 1.4 *************** *** 1,5 **** <Config> ! <excelRootDirectory>../ohxl/</excelRootDirectory> <namespace1>ObjHandler</namespace1> --- 1,5 ---- <Config> ! <excelRootDirectory>ohxl</excelRootDirectory> <namespace1>ObjHandler</namespace1> |
From: Eric E. <eri...@us...> - 2006-08-31 11:00:51
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23368/ohxl Modified Files: callingrange.cpp callingrange.hpp objecthandlerxl.cpp objecthandlerxl.hpp Log Message: support for right-clicking in cell to see error message Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** objecthandlerxl.cpp 29 Aug 2006 13:47:14 -0000 1.14 --- objecthandlerxl.cpp 31 Aug 2006 11:00:47 -0000 1.15 *************** *** 17,20 **** --- 17,21 ---- #include <oh/exception.hpp> + #include <oh/utilities.hpp> #include <ohxl/objecthandlerxl.hpp> #include <ohxl/callingrange.hpp> *************** *** 40,43 **** --- 41,45 ---- // so instead we use a static variable std::map<std::string, boost::shared_ptr<CallingRange> > callingRanges_; + typedef std::map<std::string, boost::shared_ptr<CallingRange> >::const_iterator rangeMapIter; ObjectHandlerXL &ObjectHandlerXL::instance() { *************** *** 49,58 **** } ! boost::shared_ptr<CallingRange> ObjectHandlerXL::getCallingRange() { ! // XLOPERs which might need freeing in the event of an exception XLOPER xOldName; - XLOPER xValue; try { --- 51,59 ---- } ! boost::shared_ptr<CallingRange> ObjectHandlerXL::getCallingRange(bool createIfNone) { ! // XLOPER which might need freeing in the event of an exception XLOPER xOldName; try { *************** *** 69,74 **** operToScalar(oldKey, xOldName); Excel(xlFree, 0, 1, &xOldName); ! std::map<std::string, boost::shared_ptr<CallingRange> >::const_iterator i; ! i = callingRanges_.find(oldKey); if (i == callingRanges_.end()) { std::ostringstream msg; --- 70,74 ---- operToScalar(oldKey, xOldName); Excel(xlFree, 0, 1, &xOldName); ! rangeMapIter i = callingRanges_.find(oldKey); if (i == callingRanges_.end()) { std::ostringstream msg; *************** *** 77,81 **** } else { callingRange = i->second; ! //callingRange->update(); } } --- 77,85 ---- } else { callingRange = i->second; ! } ! } else { ! if (createIfNone) { ! callingRange = boost::shared_ptr<CallingRange>(new CallingRange); ! callingRanges_[callingRange->getKey()] = callingRange; } } *************** *** 87,91 **** // free any memory that may have been allocated ! Excel(xlFree, 0, 2, &xOldName, &xValue); // propagate the exception --- 91,95 ---- // free any memory that may have been allocated ! Excel(xlFree, 0, 1, &xOldName); // propagate the exception *************** *** 101,111 **** if (FunctionCall::instance().getCallerType() != Cell) return; ! boost::shared_ptr<CallingRange> callingRange = getCallingRange(); ! if (!callingRange && createIfNone) { ! callingRange = boost::shared_ptr<CallingRange>(new CallingRange); ! callingRanges_[callingRange->getKey()] = callingRange; ! } ! if (callingRange) ! callingRange->update(); } --- 105,110 ---- if (FunctionCall::instance().getCallerType() != Cell) return; ! boost::shared_ptr<CallingRange> callingRange = getCallingRange(createIfNone); ! if (callingRange) callingRange->update(); } *************** *** 170,174 **** void ObjectHandlerXL::collectGarbage(const bool &deletePermanent) { ! std::map<std::string, boost::shared_ptr<CallingRange> >::const_iterator iter_current, iter_previous; iter_current = callingRanges_.begin(); while (iter_current != callingRanges_.end()) { --- 169,173 ---- void ObjectHandlerXL::collectGarbage(const bool &deletePermanent) { ! rangeMapIter iter_current, iter_previous; iter_current = callingRanges_.begin(); while (iter_current != callingRanges_.end()) { *************** *** 206,211 **** } else { out << std::endl << std::endl; ! std::map < std::string, boost::shared_ptr<CallingRange> >::const_iterator i; ! for (i = callingRanges_.begin(); i != callingRanges_.end(); i++) { boost::shared_ptr<CallingRange> callingRange = i->second; out << *callingRange.get(); --- 205,209 ---- } else { out << std::endl << std::endl; ! for (rangeMapIter i = callingRanges_.begin(); i != callingRanges_.end(); i++) { boost::shared_ptr<CallingRange> callingRange = i->second; out << *callingRange.get(); *************** *** 214,216 **** --- 212,231 ---- } + void ObjectHandlerXL::logError(const std::string& message) { + logMessage(message, 2); + if (FunctionCall::instance().getCallerType() == Cell) { + boost::shared_ptr<CallingRange> callingRange = getCallingRange(true); + callingRange->setErrorMessage(message); + } + } + + std::string ObjectHandlerXL::retrieveError(const std::string& address) { + for (rangeMapIter i = callingRanges_.begin(); i != callingRanges_.end(); i++) { + boost::shared_ptr<CallingRange> callingRange = i->second; + if (callingRange->getAddressString() == address) + return callingRange->errorMessage(); + } + return ""; + } + } Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** objecthandlerxl.hpp 17 Jul 2006 10:11:40 -0000 1.11 --- objecthandlerxl.hpp 31 Aug 2006 11:00:47 -0000 1.12 *************** *** 55,60 **** */ virtual std::string storeObject(std::string objectID, ! const boost::shared_ptr < Object > &object); ! virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &objectID) const; virtual void collectGarbage(const bool &deletePermanent = false); virtual void deleteAllObjects(const bool &deletePermanent = false); --- 55,60 ---- */ virtual std::string storeObject(std::string objectID, ! const boost::shared_ptr<Object> &object); ! virtual boost::shared_ptr<Object> retrieveObjectImpl(const std::string &objectID) const; virtual void collectGarbage(const bool &deletePermanent = false); virtual void deleteAllObjects(const bool &deletePermanent = false); *************** *** 68,75 **** virtual void dump(std::ostream&); private: ! boost::shared_ptr < CallingRange > getCallingRange(); virtual std::string generateObjectID(); ! void clearCallingRange(boost::shared_ptr < CallingRange > callingRange); static unsigned long objectIDCount_; }; --- 68,78 ---- virtual void dump(std::ostream&); + + void logError(const std::string&); + std::string retrieveError(const std::string&); private: ! boost::shared_ptr<CallingRange> getCallingRange(bool createIfNone = false); virtual std::string generateObjectID(); ! void clearCallingRange(boost::shared_ptr<CallingRange> callingRange); static unsigned long objectIDCount_; }; Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** callingrange.cpp 17 Jul 2006 10:11:40 -0000 1.7 --- callingrange.cpp 31 Aug 2006 11:00:47 -0000 1.8 *************** *** 33,37 **** int CallingRange::keyCount_ = 0; ! CallingRange::CallingRange() : busy_(false), updateCount_(0) { // name the calling range --- 33,37 ---- int CallingRange::keyCount_ = 0; ! CallingRange::CallingRange() : busy_(false), updateCount_(0), invocationCount_(0) { // name the calling range *************** *** 211,217 **** static const int COL_WIDTH = 20; out << std::setw(COL_WIDTH) << "name: " ! << callingRange.key_ << std::endl; out << std::setw(COL_WIDTH) << "reference: " << callingRange.getAddressString() << std::endl; out << std::setw(COL_WIDTH) << "valid: " << std::setiosflags(std::ios_base::boolalpha) --- 211,219 ---- static const int COL_WIDTH = 20; out << std::setw(COL_WIDTH) << "name: " ! << callingRange.getKey() << std::endl; out << std::setw(COL_WIDTH) << "reference: " << callingRange.getAddressString() << std::endl; + out << std::setw(COL_WIDTH) << "error: " + << callingRange.errorMessage() << std::endl; out << std::setw(COL_WIDTH) << "valid: " << std::setiosflags(std::ios_base::boolalpha) Index: callingrange.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** callingrange.hpp 17 Jul 2006 10:11:40 -0000 1.6 --- callingrange.hpp 31 Aug 2006 11:00:47 -0000 1.7 *************** *** 33,37 **** ~CallingRange(); bool isValid() const; ! const std::string &getKey() { return key_; } --- 33,37 ---- ~CallingRange(); bool isValid() const; ! const std::string &getKey() const { return key_; } *************** *** 48,58 **** return (residentObjects_.size() == 0); } private: static int keyCount_; static std::string getKeyCount(); std::string key_; bool busy_; int updateCount_; - std::string getAddressString() const; void setInvocationCount(); int invocationCount_; --- 48,65 ---- return (residentObjects_.size() == 0); } + void setErrorMessage(const std::string &errorMessage) { + errorMessage_ = errorMessage; + } + const std::string errorMessage() const { + return errorMessage_; + } + std::string getAddressString() const; private: static int keyCount_; static std::string getKeyCount(); std::string key_; + std::string errorMessage_; bool busy_; int updateCount_; void setInvocationCount(); int invocationCount_; |
From: Eric E. <eri...@us...> - 2006-08-31 11:00:50
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23368/oh Modified Files: logger.cpp objecthandler.hpp utilities.cpp Log Message: support for right-clicking in cell to see error message Index: utilities.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** utilities.cpp 17 Jul 2006 10:11:39 -0000 1.13 --- utilities.cpp 31 Aug 2006 11:00:46 -0000 1.14 *************** *** 43,53 **** const std::string &message, const int &level) { ! // addins call this function from within their catch() ! // so this function must not throw ! try { ! if (level == 2) // loglevel 2 = error message ! ObjectHandler::instance().setLastErrorMessage(message); ! Logger::instance().logMessage(message, level); ! } catch (...) {} } --- 43,47 ---- const std::string &message, const int &level) { ! Logger::instance().logMessage(message, level); } Index: objecthandler.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** objecthandler.hpp 27 Jul 2006 09:37:35 -0000 1.11 --- objecthandler.hpp 31 Aug 2006 11:00:46 -0000 1.12 *************** *** 98,113 **** virtual const std::vector < std::string > listObjectIDs( const std::string regex = ""); - - void setLastErrorMessage(const std::string &message) { - lastErrorMessage_ = message; - } - const std::string &lastErrorMessage() { - return lastErrorMessage_; - } //@} protected: static ObjectHandler *instance_; void checkName(const std::string &objectID); - std::string lastErrorMessage_; }; --- 98,105 ---- Index: logger.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/logger.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** logger.cpp 31 May 2006 09:44:14 -0000 1.8 --- logger.cpp 31 Aug 2006 11:00:46 -0000 1.9 *************** *** 1,5 **** /* ! Copyright (C) 2005 Eric Ehlers This file is part of QuantLib, a free-software/open-source library --- 1,5 ---- /* ! Copyright (C) 2005, 2006 Eric Ehlers This file is part of QuantLib, a free-software/open-source library *************** *** 112,115 **** --- 112,117 ---- const std::string &message, const int &level) { + // client applications call this function from within their + // catch() clauses so this function must not throw. try { switch (level) { *************** *** 129,140 **** LOG4CXX_DEBUG(_logger, message); break; - default: - ostringstream err; - err << "Logger::logMessage: invalid level: " << level; - throw Exception(err.str()); } ! } catch (helpers::Exception &e) { ! throw Exception("Logger::logMessage: error writing to log file: " + e.getMessage()); ! } } --- 131,136 ---- LOG4CXX_DEBUG(_logger, message); break; } ! } catch (...) {} } |
From: Eric E. <eri...@us...> - 2006-08-31 11:00:50
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23368/gensrc/metadata Modified Files: functions.xml Log Message: support for right-clicking in cell to see error message Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** functions.xml 29 Jul 2006 15:15:28 -0000 1.13 --- functions.xml 31 Aug 2006 11:00:45 -0000 1.14 *************** *** 393,404 **** </Procedure> ! <Procedure name='ohLastErrorMessage'> ! <description>return last error message</description> ! <alias>ObjHandler::ObjectHandler::instance().lastErrorMessage</alias> <supportedPlatforms> <supportedPlatform>excel</supportedPlatform> </supportedPlatforms> <ParameterList> ! <Parameters/> </ParameterList> <ReturnValue> --- 393,410 ---- </Procedure> ! <Procedure name='ohRetrieveError'> ! <description>retrieve error message associated with a given cell</description> ! <alias>ObjHandler::ObjectHandlerXL::instance().retrieveError</alias> <supportedPlatforms> <supportedPlatform>excel</supportedPlatform> </supportedPlatforms> <ParameterList> ! <Parameters> ! <Parameter name='address'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>cell address in format [BOOK.XLS]SHEET!$A$9</description> ! </Parameter> ! </Parameters> </ParameterList> <ReturnValue> |
From: Ferdinando A. <na...@us...> - 2006-08-31 09:12:20
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/ohxll In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12732/ohxl/ohxll Modified Files: ohxll.vcproj Log Message: version number up Index: ohxll.vcproj =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/ohxll/ohxll.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ohxll.vcproj 31 Aug 2006 08:41:37 -0000 1.4 --- ohxll.vcproj 31 Aug 2006 09:12:15 -0000 1.5 *************** *** 42,46 **** Name="VCLinkerTool" AdditionalDependencies="odbc32.lib odbccp32.lib Ws2_32.lib" ! OutputFile="..\..\xll\ObjectHandler-xll--vc71-mt-gd-0_1_5.xll" LinkIncremental="2" SuppressStartupBanner="TRUE" --- 42,46 ---- Name="VCLinkerTool" AdditionalDependencies="odbc32.lib odbccp32.lib Ws2_32.lib" ! OutputFile="..\..\xll\ObjectHandler-xll-vc71-mt-gd-0_1_5.xll" LinkIncremental="2" SuppressStartupBanner="TRUE" |