objecthandler-cvs Mailing List for ObjectHandler (Page 2)
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: Ferdinando A. <na...@us...> - 2007-01-04 11:18:40
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/ohxllib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29381/ohxl/ohxllib Modified Files: ohxllib_vc8.vcproj Log Message: 1) thisToThat functions' signature changed into thisToThat(const This&, That&) 2) using iterator based vectorToOper for vectorToOper(const std::vector<T> &, OPER &) Index: ohxllib_vc8.vcproj =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/ohxllib/ohxllib_vc8.vcproj,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ohxllib_vc8.vcproj 2 Jan 2007 11:01:05 -0000 1.20 --- ohxllib_vc8.vcproj 4 Jan 2007 11:18:36 -0000 1.21 *************** *** 433,464 **** </File> <File - RelativePath="..\Conversions\matrixtooper.hpp" - > - </File> - <File - RelativePath="..\Conversions\opertomatrix.hpp" - > - </File> - <File - RelativePath="..\Conversions\opertoscalar.cpp" - > - </File> - <File - RelativePath="..\Conversions\opertoscalar.hpp" - > - </File> - <File - RelativePath="..\Conversions\opertovector.hpp" - > - </File> - <File - RelativePath="..\Conversions\scalartooper.cpp" - > - </File> - <File - RelativePath="..\Conversions\scalartooper.hpp" - > - </File> - <File RelativePath="..\Conversions\validations.cpp" > --- 433,436 ---- *************** *** 468,475 **** > </File> ! <File ! RelativePath="..\Conversions\vectortooper.hpp" > ! </File> </Filter> <Filter --- 440,483 ---- > </File> ! <Filter ! Name="ToOper" > ! <File ! RelativePath="..\Conversions\matrixtooper.hpp" ! > ! </File> ! <File ! RelativePath="..\Conversions\scalartooper.cpp" ! > ! </File> ! <File ! RelativePath="..\Conversions\scalartooper.hpp" ! > ! </File> ! <File ! RelativePath="..\Conversions\vectortooper.hpp" ! > ! </File> ! </Filter> ! <Filter ! Name="FromOper" ! > ! <File ! RelativePath="..\Conversions\opertomatrix.hpp" ! > ! </File> ! <File ! RelativePath="..\Conversions\opertoscalar.cpp" ! > ! </File> ! <File ! RelativePath="..\Conversions\opertoscalar.hpp" ! > ! </File> ! <File ! RelativePath="..\Conversions\opertovector.hpp" ! > ! </File> ! </Filter> </Filter> <Filter |
From: Ferdinando A. <na...@us...> - 2007-01-04 11:18:40
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29381/ohxl/Conversions Modified Files: matrixtooper.hpp opertomatrix.hpp opertoscalar.cpp opertoscalar.hpp opertovector.hpp scalartooper.cpp scalartooper.hpp validations.cpp validations.hpp vectortooper.hpp Log Message: 1) thisToThat functions' signature changed into thisToThat(const This&, That&) 2) using iterator based vectorToOper for vectorToOper(const std::vector<T> &, OPER &) Index: scalartooper.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/scalartooper.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scalartooper.hpp 19 Nov 2006 13:08:27 -0000 1.2 --- scalartooper.hpp 4 Jan 2007 11:18:36 -0000 1.3 *************** *** 26,34 **** namespace ObjHandler { ! DLL_API void scalarToOper(OPER &xLong, const long &value); ! DLL_API void scalarToOper(OPER &xDouble, const double &value); ! DLL_API void scalarToOper(OPER &xBoolean, const bool &value); ! DLL_API void scalarToOper(OPER &xString, const std::string &value); ! DLL_API void scalarToOper(OPER &xAny, const boost::any &value); } --- 26,34 ---- namespace ObjHandler { ! DLL_API void scalarToOper(const long &value, OPER &xLong); ! DLL_API void scalarToOper(const double &value, OPER &xDouble); ! DLL_API void scalarToOper(const bool &value, OPER &xBoolean); ! DLL_API void scalarToOper(const std::string &value, OPER &xString); ! DLL_API void scalarToOper(const boost::any &value, OPER &xAny); } Index: opertomatrix.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertomatrix.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** opertomatrix.hpp 3 Jan 2007 17:42:02 -0000 1.6 --- opertomatrix.hpp 4 Jan 2007 11:18:36 -0000 1.7 *************** *** 51,55 **** for (int j=0; j<xMulti->val.array.columns; ++j) { T value; ! operToScalar(value, xMulti->val.array.lparray[i * xMulti->val.array.columns + j]); row.push_back(value); } --- 51,55 ---- for (int j=0; j<xMulti->val.array.columns; ++j) { T value; ! operToScalar(xMulti->val.array.lparray[i * xMulti->val.array.columns + j], value); row.push_back(value); } Index: opertoscalar.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertoscalar.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opertoscalar.cpp 20 Nov 2006 18:32:50 -0000 1.3 --- opertoscalar.cpp 4 Jan 2007 11:18:36 -0000 1.4 *************** *** 21,25 **** namespace ObjHandler { ! DLL_API void operToScalar(long &ret, const OPER &xScalar) { if (xScalar.xltype == xltypeNum) ret = xScalar.val.num; --- 21,25 ---- namespace ObjHandler { ! DLL_API void operToScalar(const OPER &xScalar, long &ret) { if (xScalar.xltype == xltypeNum) ret = xScalar.val.num; *************** *** 31,35 **** } ! DLL_API void operToScalar(double &ret, const OPER &xScalar) { if (xScalar.xltype == xltypeNum) ret = xScalar.val.num; --- 31,35 ---- } ! DLL_API void operToScalar(const OPER &xScalar, double &ret) { if (xScalar.xltype == xltypeNum) ret = xScalar.val.num; *************** *** 41,45 **** } ! DLL_API void operToScalar(bool &ret, const OPER &xScalar) { if (xScalar.xltype == xltypeBool) ret = xScalar.val.boolean != 0; --- 41,45 ---- } ! DLL_API void operToScalar(const OPER &xScalar, bool &ret) { if (xScalar.xltype == xltypeBool) ret = xScalar.val.boolean != 0; *************** *** 51,55 **** } ! DLL_API void operToScalar(std::string &ret, const OPER &xScalar) { OPER xTemp; bool needToFree = false; --- 51,55 ---- } ! DLL_API void operToScalar(const OPER &xScalar, std::string &ret) { OPER xTemp; bool needToFree = false; Index: matrixtooper.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/matrixtooper.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** matrixtooper.hpp 3 Jan 2007 14:24:30 -0000 1.3 --- matrixtooper.hpp 4 Jan 2007 11:18:36 -0000 1.4 *************** *** 25,29 **** template <class T> ! void matrixToOper(OPER &xMatrix, const std::vector<std::vector<T> > &vv) { if (vv.empty() || vv[0].empty()) { xMatrix.xltype = xltypeErr; --- 25,29 ---- template <class T> ! void matrixToOper(const std::vector<std::vector<T> > &vv, OPER &xMatrix) { if (vv.empty() || vv[0].empty()) { xMatrix.xltype = xltypeErr; *************** *** 40,44 **** std::vector<T> v = vv[i]; for (unsigned int j=0; j<v.size(); ++j) ! scalarToOper(xMatrix.val.array.lparray[i * v.size() + j], v[j]); } } --- 40,44 ---- std::vector<T> v = vv[i]; for (unsigned int j=0; j<v.size(); ++j) ! scalarToOper(v[j], xMatrix.val.array.lparray[i * v.size() + j]); } } Index: opertoscalar.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertoscalar.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** opertoscalar.hpp 3 Jan 2007 20:44:16 -0000 1.5 --- opertoscalar.hpp 4 Jan 2007 11:18:36 -0000 1.6 *************** *** 25,38 **** namespace ObjHandler { ! //NANDO why are these returning void? ! ! // If they were to return the "ret" value then they would be ! // overloaded functions differing only by return type and ! // would not compile. ! ! DLL_API void operToScalar(long &ret, const OPER &xScalar); ! DLL_API void operToScalar(double &ret, const OPER &xScalar); ! DLL_API void operToScalar(bool &ret, const OPER &xScalar); ! DLL_API void operToScalar(std::string &ret, const OPER &xScalar); template <class T> --- 25,32 ---- namespace ObjHandler { ! DLL_API void operToScalar(const OPER &xScalar, long &ret); ! DLL_API void operToScalar(const OPER &xScalar, double &ret); ! DLL_API void operToScalar(const OPER &xScalar, bool &ret); ! DLL_API void operToScalar(const OPER &xScalar, std::string &ret); template <class T> *************** *** 47,51 **** throw Exception("input value has type=error"); T returnValue; ! operToScalar(returnValue, xScalar); return returnValue; } catch(const std::exception &e) { --- 41,45 ---- throw Exception("input value has type=error"); T returnValue; ! operToScalar(xScalar, returnValue); return returnValue; } catch(const std::exception &e) { Index: vectortooper.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/vectortooper.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vectortooper.hpp 3 Jan 2007 14:24:30 -0000 1.3 --- vectortooper.hpp 4 Jan 2007 11:18:36 -0000 1.4 *************** *** 1,4 **** --- 1,5 ---- /* + Copyright (C) 2007 Ferdinando Ametrano Copyright (C) 2005, 2006 Eric Ehlers *************** *** 26,31 **** template <class T> ! void vectorToOper(OPER &xVector, const std::vector<T> &v) { ! if (v.empty()) { xVector.xltype = xltypeErr; xVector.val.err = xlerrNA; --- 27,38 ---- template <class T> ! void vectorToOper(const std::vector<T> &v, OPER &xVector) { ! vectorToOper(v.begin(), v.end(), xVector); ! } ! ! template <class T> ! inline void vectorToOper(T begin, T end, OPER &xVector) { ! std::size_t size = end-begin; ! if (size==0) { xVector.xltype = xltypeErr; xVector.val.err = xlerrNA; *************** *** 34,51 **** if (FunctionCall::instance().getCallerDimensions() == Row) { ! xVector.val.array.columns = v.size(); xVector.val.array.rows = 1; } else { ! xVector.val.array.rows = v.size(); xVector.val.array.columns = 1; } ! xVector.val.array.lparray = new OPER[v.size()]; if (!xVector.val.array.lparray) throw Exception("vectorToOper: error on call to new"); xVector.xltype = xltypeMulti | xlbitDLLFree; ! for (unsigned int i=0; i<v.size(); ++i) ! scalarToOper(xVector.val.array.lparray[i], v[i]); } } --- 41,59 ---- if (FunctionCall::instance().getCallerDimensions() == Row) { ! xVector.val.array.columns = size; xVector.val.array.rows = 1; } else { ! xVector.val.array.rows = size; xVector.val.array.columns = 1; } ! xVector.val.array.lparray = new OPER[size]; if (!xVector.val.array.lparray) throw Exception("vectorToOper: error on call to new"); xVector.xltype = xltypeMulti | xlbitDLLFree; ! for (unsigned int i=0; i<size; ++i, ++begin) ! scalarToOper(*begin, xVector.val.array.lparray[i]); } + } Index: scalartooper.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/scalartooper.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scalartooper.cpp 3 Jan 2007 17:42:52 -0000 1.3 --- scalartooper.cpp 4 Jan 2007 11:18:36 -0000 1.4 *************** *** 26,45 **** namespace ObjHandler { ! DLL_API void scalarToOper(OPER &xLong, const long &value) { xLong.xltype = xltypeNum; xLong.val.num = value; } ! DLL_API void scalarToOper(OPER &xDouble, const double &value) { xDouble.xltype = xltypeNum; xDouble.val.num = value; } ! DLL_API void scalarToOper(OPER &xBoolean, const bool &value) { xBoolean.xltype = xltypeBool; xBoolean.val.boolean = value; } ! DLL_API void scalarToOper(OPER &xString, const std::string &value) { int len = __min(XL_MAX_STR_LEN, value.length()); xString.val.str = new char[ len + 1 ]; --- 26,45 ---- namespace ObjHandler { ! DLL_API void scalarToOper(const long &value, OPER &xLong) { xLong.xltype = xltypeNum; xLong.val.num = value; } ! DLL_API void scalarToOper(const double &value, OPER &xDouble) { xDouble.xltype = xltypeNum; xDouble.val.num = value; } ! DLL_API void scalarToOper(const bool &value, OPER &xBoolean) { xBoolean.xltype = xltypeBool; xBoolean.val.boolean = value; } ! DLL_API void scalarToOper(const std::string &value, OPER &xString) { int len = __min(XL_MAX_STR_LEN, value.length()); xString.val.str = new char[ len + 1 ]; *************** *** 52,56 **** } ! DLL_API void scalarToOper(OPER &xAny, const boost::any &value) { if (value.type() == typeid(OPER)) { OPER xTemp = boost::any_cast<OPER>(value); --- 52,56 ---- } ! DLL_API void scalarToOper(const boost::any &value, OPER &xAny) { if (value.type() == typeid(OPER)) { OPER xTemp = boost::any_cast<OPER>(value); *************** *** 73,98 **** } else if (value.type() == typeid(std::string)) { std::string s = boost::any_cast<std::string>(value); ! scalarToOper(xAny, s); } else if (value.type() == typeid(std::vector<long>)) { std::vector<long> v = boost::any_cast<std::vector<long> >(value); ! vectorToOper(xAny, v); } else if (value.type() == typeid(std::vector<double>)) { std::vector<double> v = boost::any_cast<std::vector<double> >(value); ! vectorToOper(xAny, v); } else if (value.type() == typeid(std::vector<bool>)) { std::vector<bool> v = boost::any_cast<std::vector<bool> >(value); ! vectorToOper(xAny, v); } else if (value.type() == typeid(std::vector<std::string>)) { std::vector<std::string> v = boost::any_cast<std::vector<std::string> >(value); ! vectorToOper(xAny, v); } else if (value.type() == typeid(std::vector<boost::any>)) { std::vector<boost::any> v = boost::any_cast<std::vector<boost::any> >(value); ! vectorToOper(xAny, v); } else if (value.type() == typeid(std::vector<std::vector<long> >)) { std::vector<std::vector<long> > vv = boost::any_cast<std::vector<std::vector<long> > >(value); ! vectorToOper(xAny, vv); } else if (value.type() == typeid(std::vector<std::vector<double> >)) { std::vector<std::vector<double> > vv = boost::any_cast<std::vector<std::vector<double> > >(value); ! matrixToOper(xAny, vv); //} else if (value.type() == typeid(std::vector<std::vector<bool> >)) { // std::vector<std::vector<bool> > vv = boost::any_cast<std::vector<std::vector<bool > > >(value); --- 73,98 ---- } else if (value.type() == typeid(std::string)) { std::string s = boost::any_cast<std::string>(value); ! scalarToOper(s, xAny); } else if (value.type() == typeid(std::vector<long>)) { std::vector<long> v = boost::any_cast<std::vector<long> >(value); ! vectorToOper(v, xAny); } else if (value.type() == typeid(std::vector<double>)) { std::vector<double> v = boost::any_cast<std::vector<double> >(value); ! vectorToOper(v, xAny); } else if (value.type() == typeid(std::vector<bool>)) { std::vector<bool> v = boost::any_cast<std::vector<bool> >(value); ! vectorToOper(v, xAny); } else if (value.type() == typeid(std::vector<std::string>)) { std::vector<std::string> v = boost::any_cast<std::vector<std::string> >(value); ! vectorToOper(v, xAny); } else if (value.type() == typeid(std::vector<boost::any>)) { std::vector<boost::any> v = boost::any_cast<std::vector<boost::any> >(value); ! vectorToOper(v, xAny); } else if (value.type() == typeid(std::vector<std::vector<long> >)) { std::vector<std::vector<long> > vv = boost::any_cast<std::vector<std::vector<long> > >(value); ! vectorToOper(vv, xAny); } else if (value.type() == typeid(std::vector<std::vector<double> >)) { std::vector<std::vector<double> > vv = boost::any_cast<std::vector<std::vector<double> > >(value); ! matrixToOper(vv, xAny); //} else if (value.type() == typeid(std::vector<std::vector<bool> >)) { // std::vector<std::vector<bool> > vv = boost::any_cast<std::vector<std::vector<bool > > >(value); *************** *** 102,109 **** } else if (value.type() == typeid(std::vector<std::vector<std::string> >)) { std::vector<std::vector<std::string> > vv = boost::any_cast<std::vector<std::vector<std::string> > >(value); ! matrixToOper(xAny, vv); } else if (value.type() == typeid(std::vector<std::vector<boost::any> >)) { std::vector<std::vector<boost::any> > vv = boost::any_cast<std::vector<std::vector<boost::any> > >(value); ! matrixToOper(xAny, vv); } else { xAny.xltype = xltypeErr; --- 102,109 ---- } else if (value.type() == typeid(std::vector<std::vector<std::string> >)) { std::vector<std::vector<std::string> > vv = boost::any_cast<std::vector<std::vector<std::string> > >(value); ! matrixToOper(vv, xAny); } else if (value.type() == typeid(std::vector<std::vector<boost::any> >)) { std::vector<std::vector<boost::any> > vv = boost::any_cast<std::vector<std::vector<boost::any> > >(value); ! matrixToOper(vv, xAny); } else { xAny.xltype = xltypeErr; Index: opertovector.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertovector.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** opertovector.hpp 3 Jan 2007 20:41:33 -0000 1.5 --- opertovector.hpp 4 Jan 2007 11:18:36 -0000 1.6 *************** *** 48,52 **** for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; ++i) { T value; ! operToScalar(value, xMulti->val.array.lparray[i]); ret.push_back(value); } --- 48,52 ---- for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; ++i) { T value; ! operToScalar(xMulti->val.array.lparray[i], value); ret.push_back(value); } *************** *** 65,73 **** } - //NANDO what are FP? - - // FP stands for floating point and is a structure - // defined in the Excel API. - template <class T> std::vector<T> fpToVector(const FP &fpVector) { --- 65,68 ---- Index: validations.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/validations.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** validations.hpp 8 Dec 2006 14:46:12 -0000 1.3 --- validations.hpp 4 Jan 2007 11:18:36 -0000 1.4 *************** *** 26,30 **** DLL_API void validateRange(const OPER *xRange, const std::string &name); ! DLL_API void stringToChar(char *c, const std::string &s); } --- 26,30 ---- DLL_API void validateRange(const OPER *xRange, const std::string &name); ! DLL_API void stringToChar(const std::string &s, char *c); } Index: validations.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/validations.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** validations.cpp 3 Jan 2007 14:24:30 -0000 1.4 --- validations.cpp 4 Jan 2007 11:18:36 -0000 1.5 *************** *** 44,48 **** } ! DLL_API void stringToChar(char *c, const std::string &value) { int len = __min(XL_MAX_STR_LEN - 1, value.length()); strncpy(c, value.c_str(), len); --- 44,48 ---- } ! DLL_API void stringToChar(const std::string &value, char *c) { int len = __min(XL_MAX_STR_LEN - 1, value.length()); strncpy(c, value.c_str(), len); |
From: Ferdinando A. <na...@us...> - 2007-01-04 11:18:40
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29381/ohxl Modified Files: callingrange.cpp functioncall.cpp objecthandlerxl.cpp Log Message: 1) thisToThat functions' signature changed into thisToThat(const This&, That&) 2) using iterator based vectorToOper for vectorToOper(const std::vector<T> &, OPER &) Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** objecthandlerxl.cpp 2 Jan 2007 16:36:19 -0000 1.23 --- objecthandlerxl.cpp 4 Jan 2007 11:18:36 -0000 1.24 *************** *** 71,75 **** if (xOldName.xltype == xltypeStr) { string oldKey; ! operToScalar(oldKey, xOldName); Excel(xlFree, 0, 1, &xOldName); rangeMap::const_iterator i = callingRanges_.find(oldKey); --- 71,75 ---- if (xOldName.xltype == xltypeStr) { string oldKey; ! operToScalar(xOldName, oldKey); Excel(xlFree, 0, 1, &xOldName); rangeMap::const_iterator i = callingRanges_.find(oldKey); *************** *** 243,247 **** Excel(xlfReftext, &xRangeText, 1, xRangeRef); string rangeStr; ! operToScalar(rangeStr, xRangeText); Excel(xlFree, 0, 1, &xRangeText); RangeReference selectionReference(rangeStr); --- 243,247 ---- Excel(xlfReftext, &xRangeText, 1, xRangeRef); string rangeStr; ! operToScalar(xRangeText, rangeStr); Excel(xlFree, 0, 1, &xRangeText); RangeReference selectionReference(rangeStr); Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** callingrange.cpp 3 Jan 2007 17:40:25 -0000 1.14 --- callingrange.cpp 4 Jan 2007 11:18:36 -0000 1.15 *************** *** 116,120 **** string address; ! operToScalar(address, xDef); Excel(xlfTextref, &xRef, 1, TempStrStl(address.substr(1))); --- 116,120 ---- string address; ! operToScalar(xDef, address); Excel(xlfTextref, &xRef, 1, TempStrStl(address.substr(1))); *************** *** 150,154 **** string address; ! operToScalar(address, xDef); Excel(xlFree, 0, 1, &xDef); return address; --- 150,154 ---- string address; ! operToScalar(xDef, address); Excel(xlFree, 0, 1, &xDef); return address; Index: functioncall.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** functioncall.cpp 16 Nov 2006 12:38:40 -0000 1.12 --- functioncall.cpp 4 Jan 2007 11:18:36 -0000 1.13 *************** *** 79,83 **** try { Excel(xlfGetCell, &xAddress, 2, TempNum(1), getCallerReference()); ! operToScalar(address_, xAddress); Excel(xlFree, 0, 1, &xAddress); } catch (...) { --- 79,83 ---- try { Excel(xlfGetCell, &xAddress, 2, TempNum(1), getCallerReference()); ! operToScalar(xAddress, address_); Excel(xlFree, 0, 1, &xAddress); } catch (...) { *************** *** 99,103 **** try { Excel(xlfGetFormula, &xFormula, 1, getCallerReference()); ! operToScalar(formula_, xFormula); Excel(xlFree, 0, 1, &xFormula); } catch (const std::exception &e) { --- 99,103 ---- try { Excel(xlfGetFormula, &xFormula, 1, getCallerReference()); ! operToScalar(xFormula, formula_); Excel(xlFree, 0, 1, &xFormula); } catch (const std::exception &e) { |
From: Eric E. <eri...@us...> - 2007-01-03 20:44:18
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28705/ohxl/Conversions Modified Files: opertoscalar.hpp Log Message: Index: opertoscalar.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertoscalar.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** opertoscalar.hpp 3 Jan 2007 17:42:02 -0000 1.4 --- opertoscalar.hpp 3 Jan 2007 20:44:16 -0000 1.5 *************** *** 26,29 **** --- 26,34 ---- //NANDO why are these returning void? + + // If they were to return the "ret" value then they would be + // overloaded functions differing only by return type and + // would not compile. + DLL_API void operToScalar(long &ret, const OPER &xScalar); DLL_API void operToScalar(double &ret, const OPER &xScalar); |
From: Eric E. <eri...@us...> - 2007-01-03 20:41:36
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27535/ohxl/Conversions Modified Files: opertovector.hpp Log Message: Index: opertovector.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertovector.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** opertovector.hpp 3 Jan 2007 17:43:14 -0000 1.4 --- opertovector.hpp 3 Jan 2007 20:41:33 -0000 1.5 *************** *** 66,69 **** --- 66,73 ---- //NANDO what are FP? + + // FP stands for floating point and is a structure + // defined in the Excel API. + template <class T> std::vector<T> fpToVector(const FP &fpVector) { |
From: Ferdinando A. <na...@us...> - 2007-01-03 17:43:17
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19440/ohxl/Conversions Modified Files: opertovector.hpp Log Message: Index: opertovector.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertovector.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opertovector.hpp 2 Jan 2007 14:47:50 -0000 1.3 --- opertovector.hpp 3 Jan 2007 17:43:14 -0000 1.4 *************** *** 29,37 **** bool needToFree = false; try { - std::vector<T> ret; if (xVector.xltype & xltypeErr) throw Exception("input value has type=error"); if (xVector.xltype & (xltypeMissing | xltypeNil)) ! return ret; const OPER *xMulti; --- 29,36 ---- bool needToFree = false; try { if (xVector.xltype & xltypeErr) throw Exception("input value has type=error"); if (xVector.xltype & (xltypeMissing | xltypeNil)) ! return std::vector<T>(); const OPER *xMulti; *************** *** 45,50 **** } ret.reserve(xMulti->val.array.rows * xMulti->val.array.columns); ! for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; i++) { T value; operToScalar(value, xMulti->val.array.lparray[i]); --- 44,50 ---- } + std::vector<T> ret; ret.reserve(xMulti->val.array.rows * xMulti->val.array.columns); ! for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; ++i) { T value; operToScalar(value, xMulti->val.array.lparray[i]); *************** *** 65,68 **** --- 65,69 ---- } + //NANDO what are FP? template <class T> std::vector<T> fpToVector(const FP &fpVector) { |
From: Ferdinando A. <na...@us...> - 2007-01-03 17:42:56
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19037/ohxl/Conversions Modified Files: scalartooper.cpp Log Message: unhandled case fully commented out Index: scalartooper.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/scalartooper.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scalartooper.cpp 19 Nov 2006 13:08:27 -0000 1.2 --- scalartooper.cpp 3 Jan 2007 17:42:52 -0000 1.3 *************** *** 95,103 **** std::vector<std::vector<double> > vv = boost::any_cast<std::vector<std::vector<double> > >(value); matrixToOper(xAny, vv); ! } else if (value.type() == typeid(std::vector<std::vector<bool> >)) { ! std::vector<std::vector<bool> > vv = boost::any_cast<std::vector<std::vector<bool > > >(value); ! // FIXME VC8 compilation fails on this line ! // support for matrix of bools not presently required ! //matrixToOper(xAny, vv); } else if (value.type() == typeid(std::vector<std::vector<std::string> >)) { std::vector<std::vector<std::string> > vv = boost::any_cast<std::vector<std::vector<std::string> > >(value); --- 95,103 ---- std::vector<std::vector<double> > vv = boost::any_cast<std::vector<std::vector<double> > >(value); matrixToOper(xAny, vv); ! //} else if (value.type() == typeid(std::vector<std::vector<bool> >)) { ! // std::vector<std::vector<bool> > vv = boost::any_cast<std::vector<std::vector<bool > > >(value); ! // FIXME VC8 compilation fails on this line ! // support for matrix of bools not presently required ! // matrixToOper(xAny, vv); } else if (value.type() == typeid(std::vector<std::vector<std::string> >)) { std::vector<std::vector<std::string> > vv = boost::any_cast<std::vector<std::vector<std::string> > >(value); |
From: Ferdinando A. <na...@us...> - 2007-01-03 17:42:04
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18628/ohxl/Conversions Modified Files: opertomatrix.hpp opertoscalar.hpp Log Message: Index: opertoscalar.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertoscalar.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opertoscalar.hpp 20 Nov 2006 17:41:57 -0000 1.3 --- opertoscalar.hpp 3 Jan 2007 17:42:02 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- namespace ObjHandler { + //NANDO why are these returning void? DLL_API void operToScalar(long &ret, const OPER &xScalar); DLL_API void operToScalar(double &ret, const OPER &xScalar); *************** *** 32,37 **** template <class T> T operToScalar(const OPER &xScalar, ! const T &defaultValue, ! const std::string paramName) { if ((xScalar.xltype & xltypeMissing) || ((xScalar.xltype & xltypeErr) && (xScalar.val.err == xlerrNA))) --- 33,38 ---- template <class T> T operToScalar(const OPER &xScalar, ! const T &defaultValue, ! const std::string paramName) { if ((xScalar.xltype & xltypeMissing) || ((xScalar.xltype & xltypeErr) && (xScalar.val.err == xlerrNA))) Index: opertomatrix.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertomatrix.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** opertomatrix.hpp 3 Jan 2007 14:24:30 -0000 1.5 --- opertomatrix.hpp 3 Jan 2007 17:42:02 -0000 1.6 *************** *** 29,37 **** bool needToFree = false; try { - std::vector<std::vector<T> > ret; if (xMatrix.xltype & xltypeErr) throw Exception("input value has type=error"); if (xMatrix.xltype & (xltypeMissing | xltypeNil)) ! return ret; const OPER *xMulti; --- 29,36 ---- bool needToFree = false; try { if (xMatrix.xltype & xltypeErr) throw Exception("input value has type=error"); if (xMatrix.xltype & (xltypeMissing | xltypeNil)) ! return std::vector<std::vector<T> >(); const OPER *xMulti; *************** *** 45,48 **** --- 44,48 ---- } + std::vector<std::vector<T> > ret; ret.reserve(xMulti->val.array.rows); for (int i=0; i<xMulti->val.array.rows; ++i) { |
From: Ferdinando A. <na...@us...> - 2007-01-03 17:40:28
|
Update of /cvsroot/objecthandler/ObjectHandler/oh/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18124/oh/Conversions Modified Files: coerce.hpp Log Message: using preincrement where appropriate Index: coerce.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/Conversions/coerce.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** coerce.hpp 22 Nov 2006 21:37:10 -0000 1.2 --- coerce.hpp 3 Jan 2007 17:40:25 -0000 1.3 *************** *** 34,38 **** if ((*conversion)(in, out)) return out; ! conversion++; } OH_FAIL("Unable to coerce value to type " --- 34,38 ---- if ((*conversion)(in, out)) return out; ! ++conversion; } OH_FAIL("Unable to coerce value to type " |
From: Ferdinando A. <na...@us...> - 2007-01-03 17:40:27
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18124/ohxl Modified Files: callingrange.cpp Log Message: using preincrement where appropriate Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** callingrange.cpp 2 Jan 2007 16:36:19 -0000 1.13 --- callingrange.cpp 3 Jan 2007 17:40:25 -0000 1.14 *************** *** 196,201 **** return; } else { ! invocationCount_++; ! index++; } } --- 196,201 ---- return; } else { ! ++invocationCount_; ! ++index; } } |
From: Ferdinando A. <na...@us...> - 2007-01-03 16:25:09
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Functions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18940/ohxl/Functions Modified Files: manual.cpp Log Message: Index: manual.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Functions/manual.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** manual.cpp 3 Jan 2007 14:24:30 -0000 1.15 --- manual.cpp 3 Jan 2007 16:25:02 -0000 1.16 *************** *** 106,110 **** static std::map<std::string, long> iterators; static long returnValue; - // what is ++ used for? returnValue = iterators[ObjHandler::FunctionCall::instance().getAddressString()]++; return &returnValue; --- 106,109 ---- |
From: Ferdinando A. <na...@us...> - 2007-01-03 14:24:36
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv709/ohxl/Conversions Modified Files: matrixtooper.hpp opertomatrix.hpp validations.cpp vectortooper.hpp Log Message: use pre-increment where appropriate Index: vectortooper.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/vectortooper.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vectortooper.hpp 19 Nov 2006 13:08:27 -0000 1.2 --- vectortooper.hpp 3 Jan 2007 14:24:30 -0000 1.3 *************** *** 44,48 **** throw Exception("vectorToOper: error on call to new"); xVector.xltype = xltypeMulti | xlbitDLLFree; ! for (unsigned int i=0; i<v.size(); i++) scalarToOper(xVector.val.array.lparray[i], v[i]); } --- 44,48 ---- throw Exception("vectorToOper: error on call to new"); xVector.xltype = xltypeMulti | xlbitDLLFree; ! for (unsigned int i=0; i<v.size(); ++i) scalarToOper(xVector.val.array.lparray[i], v[i]); } Index: opertomatrix.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertomatrix.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** opertomatrix.hpp 2 Jan 2007 15:11:53 -0000 1.4 --- opertomatrix.hpp 3 Jan 2007 14:24:30 -0000 1.5 *************** *** 46,53 **** ret.reserve(xMulti->val.array.rows); ! for (int i=0; i<xMulti->val.array.rows; i++) { std::vector<T> row; row.reserve(xMulti->val.array.columns); ! for (int j=0; j<xMulti->val.array.columns; j++) { T value; operToScalar(value, xMulti->val.array.lparray[i * xMulti->val.array.columns + j]); --- 46,53 ---- ret.reserve(xMulti->val.array.rows); ! for (int i=0; i<xMulti->val.array.rows; ++i) { std::vector<T> row; row.reserve(xMulti->val.array.columns); ! for (int j=0; j<xMulti->val.array.columns; ++j) { T value; operToScalar(value, xMulti->val.array.lparray[i * xMulti->val.array.columns + j]); *************** *** 74,81 **** std::vector<std::vector<T> > ret; ret.reserve(fpMatrix.rows); ! for (int i=0; i<fpMatrix.rows; i++) { std::vector<T> row; row.reserve(fpMatrix.columns); ! for (int j=0; j<fpMatrix.columns; j++) row.push_back(fpMatrix.array[i * fpMatrix.columns + j]); ret.push_back(row); --- 74,81 ---- std::vector<std::vector<T> > ret; ret.reserve(fpMatrix.rows); ! for (int i=0; i<fpMatrix.rows; ++i) { std::vector<T> row; row.reserve(fpMatrix.columns); ! for (int j=0; j<fpMatrix.columns; ++j) row.push_back(fpMatrix.array[i * fpMatrix.columns + j]); ret.push_back(row); Index: validations.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/validations.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** validations.cpp 8 Dec 2006 14:46:12 -0000 1.3 --- validations.cpp 3 Jan 2007 14:24:30 -0000 1.4 *************** *** 24,28 **** bool validateMulti(const OPER *xMulti) { ! for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; i++) if (xMulti->val.array.lparray[i].xltype == xltypeErr) return false; --- 24,28 ---- bool validateMulti(const OPER *xMulti) { ! for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; ++i) if (xMulti->val.array.lparray[i].xltype == xltypeErr) return false; Index: matrixtooper.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/matrixtooper.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrixtooper.hpp 19 Nov 2006 13:08:27 -0000 1.2 --- matrixtooper.hpp 3 Jan 2007 14:24:30 -0000 1.3 *************** *** 37,43 **** throw Exception("matrixToOper: error on call to new"); 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++) scalarToOper(xMatrix.val.array.lparray[i * v.size() + j], v[j]); } --- 37,43 ---- throw Exception("matrixToOper: error on call to new"); 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) scalarToOper(xMatrix.val.array.lparray[i * v.size() + j], v[j]); } |
From: Ferdinando A. <na...@us...> - 2007-01-03 14:24:33
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv709/oh Modified Files: object.cpp object.hpp Log Message: use pre-increment where appropriate Index: object.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** object.hpp 2 Jan 2007 02:19:16 -0000 1.18 --- object.hpp 3 Jan 2007 14:24:30 -0000 1.19 *************** *** 129,133 **** std::ostream& operator<<(std::ostream& out, std::vector < T > &v) { out << std::endl; ! for (typename std::vector< T >::const_iterator i = v.begin(); i != v.end(); i++) out << *i << std::endl; return out; --- 129,133 ---- std::ostream& operator<<(std::ostream& out, std::vector < T > &v) { out << std::endl; ! for (typename std::vector< T >::const_iterator i = v.begin(); i != v.end(); ++i) out << *i << std::endl; return out; Index: object.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** object.cpp 18 Jun 2006 13:41:51 -0000 1.2 --- object.cpp 3 Jan 2007 14:24:30 -0000 1.3 *************** *** 109,113 **** const std::vector < std::string > propertyNames = object.propertyNames(); std::vector < std::string >::const_iterator it; ! for (it = propertyNames.begin(); it != propertyNames.end(); it++) { std::string propertyName = *it; const boost::any propertyValue = object.propertyValue(propertyName); --- 109,113 ---- const std::vector < std::string > propertyNames = object.propertyNames(); std::vector < std::string >::const_iterator it; ! for (it = propertyNames.begin(); it != propertyNames.end(); ++it) { std::string propertyName = *it; const boost::any propertyValue = object.propertyValue(propertyName); |
From: Ferdinando A. <na...@us...> - 2007-01-03 14:24:33
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Functions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv709/ohxl/Functions Modified Files: manual.cpp Log Message: use pre-increment where appropriate Index: manual.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Functions/manual.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** manual.cpp 2 Jan 2007 11:08:16 -0000 1.14 --- manual.cpp 3 Jan 2007 14:24:30 -0000 1.15 *************** *** 106,109 **** --- 106,110 ---- static std::map<std::string, long> iterators; static long returnValue; + // what is ++ used for? returnValue = iterators[ObjHandler::FunctionCall::instance().getAddressString()]++; return &returnValue; *************** *** 121,126 **** int countValidRows(const OPER &xMulti) { ! for (int numValidRows=xMulti.val.array.rows; numValidRows; numValidRows--) { ! for (int i=0; i<xMulti.val.array.columns; i++) { int index = (numValidRows - 1) * xMulti.val.array.columns + i; if (!(xMulti.val.array.lparray[index].xltype & (xltypeErr | xltypeNil))) --- 122,127 ---- int countValidRows(const OPER &xMulti) { ! for (int numValidRows=xMulti.val.array.rows; numValidRows; --numValidRows) { ! for (int i=0; i<xMulti.val.array.columns; ++i) { int index = (numValidRows - 1) * xMulti.val.array.columns + i; if (!(xMulti.val.array.lparray[index].xltype & (xltypeErr | xltypeNil))) *************** *** 132,137 **** int countValidCols(const OPER &xMulti) { ! for (int numValidCols=xMulti.val.array.columns; numValidCols; numValidCols--) { ! for (int i=0; i<xMulti.val.array.rows; i++) { int index = (numValidCols - 1) + i * xMulti.val.array.columns; if (!(xMulti.val.array.lparray[index].xltype & (xltypeErr | xltypeNil))) --- 133,138 ---- int countValidCols(const OPER &xMulti) { ! for (int numValidCols=xMulti.val.array.columns; numValidCols; --numValidCols) { ! for (int i=0; i<xMulti.val.array.rows; ++i) { int index = (numValidCols - 1) + i * xMulti.val.array.columns; if (!(xMulti.val.array.lparray[index].xltype & (xltypeErr | xltypeNil))) *************** *** 165,170 **** xRet.xltype = xltypeMulti | xlbitDLLFree; ! for (int i=0; i<numValidRows; i++) { ! for (int j=0; j<numValidCols; j++) { int indexSource = i * xMulti.val.array.columns + j; int indexTarget = i * numValidCols + j; --- 166,171 ---- xRet.xltype = xltypeMulti | xlbitDLLFree; ! for (int i=0; i<numValidRows; ++i) { ! for (int j=0; j<numValidCols; ++j) { int indexSource = i * xMulti.val.array.columns + j; int indexTarget = i * numValidCols + j; *************** *** 183,187 **** if (xRet.xltype & xltypeMulti && xRet.val.array.lparray) { ! for (int i=0; i<xRet.val.array.columns * xRet.val.array.rows; i++) { if (xRet.val.array.lparray[i].xltype & xltypeStr && xRet.val.array.lparray[i].val.str) delete [] xRet.val.array.lparray[i].val.str; --- 184,188 ---- if (xRet.xltype & xltypeMulti && xRet.val.array.lparray) { ! for (int i=0; i<xRet.val.array.columns * xRet.val.array.rows; ++i) { if (xRet.val.array.lparray[i].xltype & xltypeStr && xRet.val.array.lparray[i].val.str) delete [] xRet.val.array.lparray[i].val.str; |
From: Ferdinando A. <na...@us...> - 2007-01-03 09:03:49
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30222/oh Modified Files: objecthandler.cpp Log Message: Index: objecthandler.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** objecthandler.cpp 2 Jan 2007 16:36:19 -0000 1.8 --- objecthandler.cpp 3 Jan 2007 09:03:47 -0000 1.9 *************** *** 145,150 **** msg << "ObjectHandler error: cannot create object with ID '" << objectID << "' because an object with the equivalent name '" << ! result->first << ! "' already exists"; throw Exception(msg.str()); } --- 145,149 ---- msg << "ObjectHandler error: cannot create object with ID '" << objectID << "' because an object with the equivalent name '" << ! result->first << "' already exists"; throw Exception(msg.str()); } |
From: Ferdinando A. <na...@us...> - 2007-01-02 16:36:22
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22074/oh Modified Files: objecthandler.cpp objecthandler.hpp Log Message: 1) case-preserving ObjectID behaviour implemented with just one map using the case insensitive comparison functor iless 2) use iterator post-increment to deal with erase invalidation effect 3) clearPermanent() and clearAll() merged into clearResidentObjects(bool deletePermanent) Index: objecthandler.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** objecthandler.hpp 26 Oct 2006 10:14:41 -0000 1.16 --- objecthandler.hpp 2 Jan 2007 16:36:19 -0000 1.17 *************** *** 25,29 **** #include <oh/object.hpp> #include <oh/objhandlerdefines.hpp> - #include <map> //! ObjHandler --- 25,28 ---- *************** *** 56,60 **** template <class T> ! void retrieveObject(boost::shared_ptr<T> &ret, const std::string &id) { boost::shared_ptr<Object> object = retrieveObjectImpl(id); ret = boost::dynamic_pointer_cast<T> (object); --- 55,60 ---- template <class T> ! void retrieveObject(boost::shared_ptr<T> &ret, ! const std::string &id) { boost::shared_ptr<Object> object = retrieveObjectImpl(id); ret = boost::dynamic_pointer_cast<T> (object); *************** *** 65,71 **** } ! void retrieveObject( ! boost::shared_ptr<Object> &ret, ! const std::string &id) { ret = retrieveObjectImpl(id); } --- 65,70 ---- } ! void retrieveObject(boost::shared_ptr<Object> &ret, ! const std::string &id) { ret = retrieveObjectImpl(id); } *************** *** 106,122 **** } ! // convert a vector of strings to a vector of objects ! template <class ObjectClass> ! std::vector<boost::shared_ptr<ObjectClass> > getObjectVector( ! const std::vector<std::string> &objectIDs) { ! std::vector<boost::shared_ptr<ObjectClass> > ret; ! for (std::vector<std::string>::const_iterator i = objectIDs.begin(); ! i != objectIDs.end(); i++) { ! OH_GET_OBJECT(objectPointer, *i, ObjectClass); ! ret.push_back(objectPointer); ! } ! return ret; ! } #endif - --- 105,123 ---- } ! // TODO move into the ObjHandler namespace ! // convert a vector of strings to a vector of objects ! template <class ObjectClass> ! std::vector<boost::shared_ptr<ObjectClass> > getObjectVector( ! const std::vector<std::string> &objectIDs) { ! std::vector<boost::shared_ptr<ObjectClass> > ret; ! ret.reserve(objectIDs.size()); ! for (std::vector<std::string>::const_iterator i = objectIDs.begin(); ! i != objectIDs.end(); ! ++i) { ! OH_GET_OBJECT(objectPointer, *i, ObjectClass); ! ret.push_back(objectPointer); ! } ! return ret; ! } #endif Index: objecthandler.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** objecthandler.cpp 2 Jan 2007 11:15:26 -0000 1.7 --- objecthandler.cpp 2 Jan 2007 16:36:19 -0000 1.8 *************** *** 1,5 **** /* ! Copyright (C) 2005 Ferdinando Ametrano Copyright (C) 2004, 2005, 2006 Eric Ehlers --- 1,5 ---- /* ! Copyright (C) 2005, 2006, 2007 Ferdinando Ametrano Copyright (C) 2004, 2005, 2006 Eric Ehlers *************** *** 23,32 **** #include <oh/objecthandler.hpp> #include <oh/exception.hpp> ! #include <oh/utilities.hpp> #include <ostream> #include <sstream> - #include <boost/algorithm/string/case_conv.hpp> - #include <boost/regex.hpp> #include <algorithm> namespace ObjHandler { --- 23,34 ---- #include <oh/objecthandler.hpp> #include <oh/exception.hpp> ! #include <oh/iless.hpp> ! #include <boost/regex.hpp> #include <ostream> #include <sstream> #include <algorithm> + #include <map> + + using std::string; namespace ObjHandler { *************** *** 38,50 **** // Map object ID to object reference ! std::map<std::string, boost::shared_ptr<Object> > repository_; ! ! // Map uppercase object ID to the ID in original case, ! // e.g. convertCase_["MYOBJECT"] = "MyObject" ! // This allows "case-preserving" behavior: // storeObject("MyObject") // store "MyObject" // retrieveObject("MyObJeCt") // retrieve "MyObject" // storeObject("MYOBJECT") // overwrite "MyObject" ! std::map<std::string, std::string> convertCase_; ObjectHandler::ObjectHandler() { --- 40,49 ---- // Map object ID to object reference ! // the iless comparison functor class allows "case-preserving" behavior: // storeObject("MyObject") // store "MyObject" // retrieveObject("MyObJeCt") // retrieve "MyObject" // storeObject("MYOBJECT") // overwrite "MyObject" ! typedef std::map<string, boost::shared_ptr<Object>, my_iless> OhRepository; ! OhRepository repository_; ObjectHandler::ObjectHandler() { *************** *** 62,70 **** throw Exception("Attempt to reference uninitialized ObjectHandler object"); } ! ! std::string ObjectHandler::storeObject( ! const std::string &objectID, ! const boost::shared_ptr<Object> &object) { ! convertCase_[boost::algorithm::to_upper_copy(objectID)] = objectID; repository_[objectID] = object; return objectID; --- 61,69 ---- throw Exception("Attempt to reference uninitialized ObjectHandler object"); } ! ! // TODO: implement Scott Meyers' "Effective STL" item 24 ! string ObjectHandler::storeObject( ! const string &objectID, ! const boost::shared_ptr<Object> &object) { repository_[objectID] = object; return objectID; *************** *** 72,108 **** boost::shared_ptr<Object> ObjectHandler::retrieveObjectImpl( ! const std::string &objectID) const { ! std::map<std::string, std::string>::const_iterator result ! = convertCase_.find(boost::algorithm::to_upper_copy(objectID)); ! if (result == convertCase_.end()) { std::ostringstream msg; ! msg << "ObjectHandler error: attempt to retrieve object " ! << "with unknown ID '" << objectID << "'"; throw Exception(msg.str()); ! } else ! return repository_[result->second]; } ! void ObjectHandler::deleteObject(const std::string &objectID) { ! repository_.erase(convertCase_[boost::algorithm::to_upper_copy(objectID)]); ! convertCase_.erase(boost::algorithm::to_upper_copy(objectID)); } void ObjectHandler::deleteAllObjects(const bool &deletePermanent) { ! if (deletePermanent) { repository_.clear(); ! convertCase_.clear(); ! } else { ! std::map<std::string, boost::shared_ptr<Object> >::const_iterator iter_current, iter_previous; ! iter_current = repository_.begin(); ! while (iter_current != repository_.end()) { ! iter_previous = iter_current; ! iter_current++; ! std::string key = iter_previous->first; ! boost::shared_ptr<Object> object = iter_previous->second; ! if (!object->permanent()) { ! repository_.erase(key); ! convertCase_.erase(boost::algorithm::to_upper_copy(key)); ! } } } --- 71,101 ---- boost::shared_ptr<Object> ObjectHandler::retrieveObjectImpl( ! const string &objectID) const { ! OhRepository::const_iterator result = repository_.find(objectID); ! if (result != repository_.end()) ! return result->second; ! else { std::ostringstream msg; ! msg << "ObjectHandler error: attempt to retrieve object with " ! "unknown ID '" << objectID << "'"; throw Exception(msg.str()); ! } } ! void ObjectHandler::deleteObject(const string &objectID) { ! repository_.erase(objectID); } void ObjectHandler::deleteAllObjects(const bool &deletePermanent) { ! if (deletePermanent) repository_.clear(); ! else { ! OhRepository::iterator i = repository_.begin(); ! while (i != repository_.end()) { ! if (!i->second->permanent()) ! // post-increment the iterator!! ! repository_.erase(i++); ! else ! ++i; } } *************** *** 110,118 **** void ObjectHandler::dump(std::ostream& out) { ! out << "dump of all objects in ObjectHandler:" << std::endl << std::endl; ! for (std::map<std::string, boost::shared_ptr<Object> >::const_iterator i=repository_.begin(); ! i!=repository_.end(); i++) { boost::shared_ptr<Object> object = i->second; ! out << "Object with ID = " << i->first << ":" << std::endl << *object.get(); } } --- 103,113 ---- void ObjectHandler::dump(std::ostream& out) { ! out << "dump of all objects in ObjectHandler:" << ! std::endl << std::endl; ! for (OhRepository::const_iterator i=repository_.begin(); ! i!=repository_.end(); ++i) { boost::shared_ptr<Object> object = i->second; ! out << "Object with ID = " << i->first << ":" << ! std::endl << *object.get(); } } *************** *** 122,150 **** } ! const std::vector<std::string> ObjectHandler::listObjectIDs( ! const std::string ®ex) { ! std::vector<std::string> objectIDs; if (regex.empty()) { ! for (std::map<std::string, boost::shared_ptr<Object> >::const_iterator i=repository_.begin(); i!=repository_.end(); i++) objectIDs.push_back(i->first); } else { boost::regex r(regex); ! for (std::map<std::string, boost::shared_ptr<Object> >::const_iterator i=repository_.begin(); i!=repository_.end(); i++) { ! std::string objectID = i->first; if (regex_match(objectID, r)) objectIDs.push_back(objectID); } } - std::sort(objectIDs.begin(), objectIDs.end()); return objectIDs; } ! void ObjectHandler::checkName(const std::string &objectID) { ! std::map<std::string, std::string>::const_iterator result = ! convertCase_.find(boost::algorithm::to_upper_copy(objectID)); ! if (result != convertCase_.end()) { std::ostringstream msg; ! msg << "ObjectHandler error: cannot create object " ! "with ID '" << objectID << ! "' because an object with that name already exists"; throw Exception(msg.str()); } --- 117,150 ---- } ! const std::vector<string> ObjectHandler::listObjectIDs( ! const string ®ex) { ! std::vector<string> objectIDs; if (regex.empty()) { ! objectIDs.reserve(repository_.size()); ! for (OhRepository::const_iterator i=repository_.begin(); ! i!=repository_.end(); ! ++i) objectIDs.push_back(i->first); } else { boost::regex r(regex); ! for (OhRepository::const_iterator i=repository_.begin(); ! i!=repository_.end(); ! ++i) { ! string objectID = i->first; ! // FIXME: it should be case insensitive if (regex_match(objectID, r)) objectIDs.push_back(objectID); } } return objectIDs; } ! void ObjectHandler::checkName(const string &objectID) { ! OhRepository::const_iterator result = repository_.find(objectID); ! if (result != repository_.end()) { std::ostringstream msg; ! msg << "ObjectHandler error: cannot create object with ID '" << ! objectID << "' because an object with the equivalent name '" << ! result->first << ! "' already exists"; throw Exception(msg.str()); } *************** *** 152,154 **** } - --- 152,153 ---- |
From: Ferdinando A. <na...@us...> - 2007-01-02 16:36:21
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22074/ohxl Modified Files: callingrange.cpp callingrange.hpp objecthandlerxl.cpp objecthandlerxl.hpp Log Message: 1) case-preserving ObjectID behaviour implemented with just one map using the case insensitive comparison functor iless 2) use iterator post-increment to deal with erase invalidation effect 3) clearPermanent() and clearAll() merged into clearResidentObjects(bool deletePermanent) Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** objecthandlerxl.cpp 16 Nov 2006 12:38:40 -0000 1.22 --- objecthandlerxl.cpp 2 Jan 2007 16:36:19 -0000 1.23 *************** *** 1,4 **** --- 1,5 ---- /* + Copyright (C) 2007 Ferdinando Ametrano Copyright (C) 2005, 2006 Eric Ehlers *************** *** 34,37 **** --- 35,40 ---- #include <limits.h> + using std::string; + namespace ObjHandler { *************** *** 40,45 **** // std::map cannot be exported across DLL boundaries // 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() { --- 43,48 ---- // std::map cannot be exported across DLL boundaries // so instead we use a static variable ! typedef std::map<string, boost::shared_ptr<CallingRange> > rangeMap; ! rangeMap callingRanges_; ObjectHandlerXL &ObjectHandlerXL::instance() { *************** *** 67,74 **** if (xOldName.xltype == xltypeStr) { ! std::string oldKey; operToScalar(oldKey, xOldName); Excel(xlFree, 0, 1, &xOldName); ! rangeMapIter i = callingRanges_.find(oldKey); if (i == callingRanges_.end()) { std::ostringstream msg; --- 70,77 ---- if (xOldName.xltype == xltypeStr) { ! string oldKey; operToScalar(oldKey, xOldName); Excel(xlFree, 0, 1, &xOldName); ! rangeMap::const_iterator i = callingRanges_.find(oldKey); if (i == callingRanges_.end()) { std::ostringstream msg; *************** *** 109,117 **** } ! std::string ObjectHandlerXL::storeObject( ! const std::string &objectIDOrig, const boost::shared_ptr<Object> &object) { ! std::string objectID; if (objectIDOrig.empty()) { objectID = generateObjectID(); --- 112,120 ---- } ! string ObjectHandlerXL::storeObject( ! const string &objectIDOrig, const boost::shared_ptr<Object> &object) { ! string objectID; if (objectIDOrig.empty()) { objectID = generateObjectID(); *************** *** 128,132 **** callingRange->registerObject(objectID, object); ! std::string objectIDCounter = ObjectHandler::storeObject(objectID, object); return objectIDCounter + "#" + --- 131,135 ---- callingRange->registerObject(objectID, object); ! string objectIDCounter = ObjectHandler::storeObject(objectID, object); return objectIDCounter + "#" + *************** *** 137,141 **** } } ! std::string ObjectHandlerXL::getStub(const std::string &objectID) const { int counterOffset = objectID.length() - 5; if (counterOffset >= 0 && objectID[counterOffset] == '#') --- 140,144 ---- } } ! string ObjectHandlerXL::getStub(const string &objectID) const { int counterOffset = objectID.length() - 5; if (counterOffset >= 0 && objectID[counterOffset] == '#') *************** *** 145,153 **** } ! boost::shared_ptr<Object> ObjectHandlerXL::retrieveObjectImpl(const std::string &objectID) const { ! return ObjectHandler::retrieveObjectImpl(getStub(objectID)); ! } ! ! std::string ObjectHandlerXL::generateObjectID() { /* The user has provided a null string as the object ID so generate a name automatically. --- 148,152 ---- } ! string ObjectHandlerXL::generateObjectID() { /* The user has provided a null string as the object ID so generate a name automatically. *************** *** 173,197 **** void ObjectHandlerXL::collectGarbage(const bool &deletePermanent) { ! rangeMapIter iter_current, iter_previous; ! iter_current = callingRanges_.begin(); ! while (iter_current != callingRanges_.end()) { ! iter_previous = iter_current; ! iter_current++; ! std::string key = iter_previous->first; ! boost::shared_ptr<CallingRange> callingRange = iter_previous->second; ! if (!callingRange->isValid()) { ! if (deletePermanent) { ! callingRange->clearAll(); ! callingRanges_.erase(key); ! } else { ! callingRange->clearNonPermanent(); ! if (callingRange->empty()) ! callingRanges_.erase(key); ! } } } } ! void ObjectHandlerXL::deleteObject(const std::string &objectID) { ObjectHandler::deleteObject(getStub(objectID)); } --- 172,192 ---- void ObjectHandlerXL::collectGarbage(const bool &deletePermanent) { ! rangeMap::iterator i = callingRanges_.begin(); ! while (i != callingRanges_.end()) { ! boost::shared_ptr<CallingRange> callingRange = i->second; ! if (callingRange->isValid()) ! ++i; ! else { ! callingRange->clearResidentObjects(deletePermanent); ! if (callingRange->empty()) ! // post-increment the iterator!! ! callingRanges_.erase(i++); ! else ! ++i; } } } ! void ObjectHandlerXL::deleteObject(const string &objectID) { ObjectHandler::deleteObject(getStub(objectID)); } *************** *** 213,217 **** } 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(); --- 208,214 ---- } else { out << std::endl << std::endl; ! for (rangeMap::const_iterator i = callingRanges_.begin(); ! i != callingRanges_.end(); ! ++i) { boost::shared_ptr<CallingRange> callingRange = i->second; out << *callingRange.get(); *************** *** 220,224 **** } ! void ObjectHandlerXL::logError(const std::string& message, const bool &append) { std::ostringstream msgLog; if (FunctionCall::instance().getCallerType() == Cell) { --- 217,221 ---- } ! void ObjectHandlerXL::logError(const string& message, const bool &append) { std::ostringstream msgLog; if (FunctionCall::instance().getCallerType() == Cell) { *************** *** 234,238 **** } ! std::string ObjectHandlerXL::retrieveError(const XLOPER *xRangeRef) { // XLOPER which might need freeing in the event of an exception --- 231,235 ---- } ! string ObjectHandlerXL::retrieveError(const XLOPER *xRangeRef) { // XLOPER which might need freeing in the event of an exception *************** *** 245,254 **** } Excel(xlfReftext, &xRangeText, 1, xRangeRef); ! std::string rangeStr; operToScalar(rangeStr, xRangeText); Excel(xlFree, 0, 1, &xRangeText); RangeReference selectionReference(rangeStr); ! for (rangeMapIter i = callingRanges_.begin(); i != callingRanges_.end(); i++) { boost::shared_ptr<CallingRange> callingRange = i->second; if (callingRange->contains(selectionReference)) --- 242,253 ---- } Excel(xlfReftext, &xRangeText, 1, xRangeRef); ! string rangeStr; operToScalar(rangeStr, xRangeText); Excel(xlFree, 0, 1, &xRangeText); RangeReference selectionReference(rangeStr); ! for (rangeMap::const_iterator i = callingRanges_.begin(); ! i != callingRanges_.end(); ! ++i) { boost::shared_ptr<CallingRange> callingRange = i->second; if (callingRange->contains(selectionReference)) Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** objecthandlerxl.hpp 29 Oct 2006 16:13:44 -0000 1.18 --- objecthandlerxl.hpp 2 Jan 2007 16:36:19 -0000 1.19 *************** *** 57,61 **** virtual std::string storeObject(const 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 deleteObject(const std::string &objectID); --- 57,64 ---- virtual std::string storeObject(const std::string &objectID, const boost::shared_ptr<Object> &object); ! virtual boost::shared_ptr<Object> retrieveObjectImpl( ! const std::string &objectID) const { ! return ObjectHandler::retrieveObjectImpl(getStub(objectID)); ! } virtual void collectGarbage(const bool &deletePermanent = false); virtual void deleteObject(const std::string &objectID); Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** callingrange.cpp 16 Nov 2006 12:38:40 -0000 1.12 --- callingrange.cpp 2 Jan 2007 16:36:19 -0000 1.13 *************** *** 1,4 **** --- 1,5 ---- /* + Copyright (C) 2007 Ferdinando Ametrano Copyright (C) 2006 Eric Ehlers *************** *** 26,33 **** #include <cmath> namespace ObjHandler { // FIXME this value needs to be configured at runtime ! const std::string libFunctionSignature = "ql"; int CallingRange::keyCount_ = 0; --- 27,36 ---- #include <cmath> + using std::string; + namespace ObjHandler { // FIXME this value needs to be configured at runtime ! const string libFunctionSignature = "ql"; int CallingRange::keyCount_ = 0; *************** *** 52,56 **** } ! std::string CallingRange::getKeyCount() { static const int KEY_WIDTH = 5; static const int KEY_BASE = 16; --- 55,59 ---- } ! string CallingRange::getKeyCount() { static const int KEY_WIDTH = 5; static const int KEY_BASE = 16; *************** *** 64,101 **** } ! void CallingRange::clearNonPermanent() { ! std::map<std::string, boost::shared_ptr<Object> >::const_iterator iter_current, iter_previous; ! iter_current = residentObjects_.begin(); ! while (iter_current != residentObjects_.end()) { ! iter_previous = iter_current; ! iter_current++; ! if (!iter_previous->second->permanent()) { ! ObjectHandler::instance().deleteObject(iter_previous->first); ! residentObjects_.erase(iter_previous->first); } } } ! void CallingRange::clearAll() { ! std::map<std::string, boost::shared_ptr<Object> >::const_iterator i; ! for (i = residentObjects_.begin(); i != residentObjects_.end(); i++) ! ObjectHandler::instance().deleteObject(i->first); ! residentObjects_.clear(); ! } ! ! void CallingRange::deleteObject( ! const std::string &objectID, ! boost::shared_ptr<Object> object) { ! std::map<std::string, boost::shared_ptr<Object> >::const_iterator i; ! i = residentObjects_.find(objectID); if (i != residentObjects_.end()) { ObjectHandler::instance().deleteObject(i->first); ! residentObjects_.erase(i->first); } } ! void CallingRange::registerObject( ! const std::string &objectID, ! boost::shared_ptr<Object> object) { residentObjects_[objectID] = object; } --- 67,104 ---- } ! typedef std::map<string, boost::shared_ptr<Object>, my_iless> OhRepository; ! ! void CallingRange::clearResidentObjects(bool deletePermanent) { ! if (deletePermanent) { ! for (OhRepository::iterator i = residentObjects_.begin(); ! i != residentObjects_.end(); ! ++i) ! ObjectHandler::instance().deleteObject(i->first); ! residentObjects_.clear(); ! } else { ! OhRepository::iterator i = residentObjects_.begin(); ! while (i != residentObjects_.end()) { ! if (i->second->permanent()) ! ++i; ! else { ! ObjectHandler::instance().deleteObject(i->first); ! // post-increment the iterator!! ! residentObjects_.erase(i++); ! } } } } ! void CallingRange::deleteObject(const string &objectID, ! boost::shared_ptr<Object> object) { ! OhRepository::iterator i = residentObjects_.find(objectID); if (i != residentObjects_.end()) { ObjectHandler::instance().deleteObject(i->first); ! residentObjects_.erase(i); } } ! void CallingRange::registerObject(const string &objectID, ! boost::shared_ptr<Object> object) { residentObjects_[objectID] = object; } *************** *** 112,116 **** Excel(xlfGetName, &xDef, 1, TempStrStl(key_)); ! std::string address; operToScalar(address, xDef); Excel(xlfTextref, &xRef, 1, TempStrStl(address.substr(1))); --- 115,119 ---- Excel(xlfGetName, &xDef, 1, TempStrStl(key_)); ! string address; operToScalar(address, xDef); Excel(xlfTextref, &xRef, 1, TempStrStl(address.substr(1))); *************** *** 136,140 **** // FIXME cache this value ! std::string CallingRange::getAddressString() const { // XLOPER which might need freeing in the event of an exception --- 139,143 ---- // FIXME cache this value ! string CallingRange::getAddressString() const { // XLOPER which might need freeing in the event of an exception *************** *** 146,150 **** Excel(xlfGetName, &xDef, 1, TempStrStl(key_)); ! std::string address; operToScalar(address, xDef); Excel(xlFree, 0, 1, &xDef); --- 149,153 ---- Excel(xlfGetName, &xDef, 1, TempStrStl(key_)); ! string address; operToScalar(address, xDef); Excel(xlFree, 0, 1, &xDef); *************** *** 173,177 **** } ! void CallingRange::setErrorMessage(const std::string &errorMessage, const bool &append) { if (append) { std::ostringstream err; --- 176,180 ---- } ! void CallingRange::setErrorMessage(const string &errorMessage, const bool &append) { if (append) { std::ostringstream err; *************** *** 185,194 **** // FIXME use boost::regex here void CallingRange::setInvocationCount() { ! std::string formula = FunctionCall::instance().getFormula(); invocationCount_ = -1; unsigned int index = 0; while (index < formula.length()) { index = formula.find(libFunctionSignature, index); ! if (index == std::string::npos) { return; } else { --- 188,197 ---- // FIXME use boost::regex here void CallingRange::setInvocationCount() { ! string formula = FunctionCall::instance().getFormula(); invocationCount_ = -1; unsigned int index = 0; while (index < formula.length()) { index = formula.find(libFunctionSignature, index); ! if (index == string::npos) { return; } else { *************** *** 215,223 **** if (invocationCount_) busy_ = true; ! clearNonPermanent(); } } ! std::string CallingRange::updateCount() { if (updateCount_ > 9999) updateCount_ = 0; std::ostringstream s; --- 218,226 ---- if (invocationCount_) busy_ = true; ! clearResidentObjects(false); } } ! string CallingRange::updateCount() { if (updateCount_ > 9999) updateCount_ = 0; std::ostringstream s; *************** *** 246,252 **** out << std::setw(COL_WIDTH) << "resident objects: " << callingRange.residentObjects_.size() << std::endl; ! std::map<std::string, boost::shared_ptr<Object> >::const_iterator i; for (i = callingRange.residentObjects_.begin(); ! i != callingRange.residentObjects_.end(); i++) out << std::setw(COL_WIDTH) << " object ID: " << i->first << std::endl; --- 249,256 ---- out << std::setw(COL_WIDTH) << "resident objects: " << callingRange.residentObjects_.size() << std::endl; ! OhRepository::const_iterator i; for (i = callingRange.residentObjects_.begin(); ! i != callingRange.residentObjects_.end(); ! ++i) out << std::setw(COL_WIDTH) << " object ID: " << i->first << std::endl; Index: callingrange.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** callingrange.hpp 20 Sep 2006 20:17:07 -0000 1.9 --- callingrange.hpp 2 Jan 2007 16:36:19 -0000 1.10 *************** *** 24,27 **** --- 24,28 ---- #include <oh/object.hpp> + #include <oh/iless.hpp> #include <ohxl/rangereference.hpp> #include <map> *************** *** 38,46 **** } void deleteObject(const std::string &objectID, ! boost::shared_ptr<Object> object); void registerObject(const std::string &objectID, ! boost::shared_ptr<Object> object); ! void clearNonPermanent(); ! void clearAll(); void update(); std::string updateCount(); --- 39,46 ---- } void deleteObject(const std::string &objectID, ! boost::shared_ptr<Object> object); void registerObject(const std::string &objectID, ! boost::shared_ptr<Object> object); ! void clearResidentObjects(bool deletePermanent); void update(); std::string updateCount(); *************** *** 67,71 **** void setInvocationCount(); int invocationCount_; ! std::map<std::string, boost::shared_ptr<Object> > residentObjects_; boost::shared_ptr<RangeReference> rangeReference_; }; --- 67,71 ---- void setInvocationCount(); int invocationCount_; ! std::map<std::string, boost::shared_ptr<Object>, my_iless > residentObjects_; boost::shared_ptr<RangeReference> rangeReference_; }; |
From: Ferdinando A. <na...@us...> - 2007-01-02 15:11:54
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18673/ohxl/Conversions Modified Files: opertomatrix.hpp Log Message: ...oops... Index: opertomatrix.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertomatrix.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opertomatrix.hpp 2 Jan 2007 14:47:50 -0000 1.3 --- opertomatrix.hpp 2 Jan 2007 15:11:53 -0000 1.4 *************** *** 48,52 **** for (int i=0; i<xMulti->val.array.rows; i++) { std::vector<T> row; ! row.reserve(val.array.columns); for (int j=0; j<xMulti->val.array.columns; j++) { T value; --- 48,52 ---- for (int i=0; i<xMulti->val.array.rows; i++) { std::vector<T> row; ! row.reserve(xMulti->val.array.columns); for (int j=0; j<xMulti->val.array.columns; j++) { T value; |
From: Ferdinando A. <na...@us...> - 2007-01-02 14:47:51
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8402/ohxl/Conversions Modified Files: opertomatrix.hpp opertovector.hpp Log Message: "Use reserve to avoid unnecessary reallocations" -- Scott Mayers "Effective STL", item 14 Index: opertovector.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertovector.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** opertovector.hpp 19 Nov 2006 13:08:27 -0000 1.2 --- opertovector.hpp 2 Jan 2007 14:47:50 -0000 1.3 *************** *** 45,48 **** --- 45,49 ---- } + ret.reserve(xMulti->val.array.rows * xMulti->val.array.columns); for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; i++) { T value; *************** *** 67,71 **** 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]); return ret; --- 68,73 ---- std::vector<T> fpToVector(const FP &fpVector) { std::vector<T> ret; ! ret.reserve(fpVector.rows * fpVector.columns); ! for (int i=0; i<fpVector.rows * fpVector.columns; ++i) ret.push_back(fpVector.array[i]); return ret; Index: opertomatrix.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertomatrix.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** opertomatrix.hpp 19 Nov 2006 13:08:27 -0000 1.2 --- opertomatrix.hpp 2 Jan 2007 14:47:50 -0000 1.3 *************** *** 45,50 **** --- 45,52 ---- } + ret.reserve(xMulti->val.array.rows); for (int i=0; i<xMulti->val.array.rows; i++) { std::vector<T> row; + row.reserve(val.array.columns); for (int j=0; j<xMulti->val.array.columns; j++) { T value; *************** *** 71,76 **** --- 73,80 ---- std::vector<std::vector<T> > fpToMatrix(const FP &fpMatrix) { std::vector<std::vector<T> > ret; + ret.reserve(fpMatrix.rows); for (int i=0; i<fpMatrix.rows; i++) { std::vector<T> row; + row.reserve(fpMatrix.columns); for (int j=0; j<fpMatrix.columns; j++) row.push_back(fpMatrix.array[i * fpMatrix.columns + j]); |
From: Eric E. <eri...@us...> - 2007-01-02 14:30:44
|
Update of /cvsroot/objecthandler/ObjectHandler/Docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1400/Docs Modified Files: Makefile.am oh_headeronline.html Log Message: update docs Index: Makefile.am =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Docs/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 14 Dec 2006 12:27:35 -0000 1.5 --- Makefile.am 2 Jan 2007 14:30:42 -0000 1.6 *************** *** 47,52 **** docs-html-dist: docs-html ln -s html ObjectHandler-docs-$(VERSION)-html ! tar chof - ObjectHandler-docs-$(VERSION)-html \ ! | GZIP=--best gzip -c > ObjectHandler-docs-$(VERSION)-html.tar.gz rm ObjectHandler-docs-$(VERSION)-html --- 47,51 ---- docs-html-dist: docs-html ln -s html ObjectHandler-docs-$(VERSION)-html ! tar czfvh ObjectHandler-docs-$(VERSION)-html.tar.gz ObjectHandler-docs-$(VERSION)-html rm ObjectHandler-docs-$(VERSION)-html Index: oh_headeronline.html =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Docs/oh_headeronline.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** oh_headeronline.html 14 Dec 2006 12:27:35 -0000 1.5 --- oh_headeronline.html 2 Jan 2007 14:30:42 -0000 1.6 *************** *** 69,73 **** <table class="layout" cellpadding=0 cellspacing=0 width=100%> ! <tr><td align=center><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=12740" width="88" height="31" border="0" alt="SourceForge Logo"></a></td></tr> </table> --- 69,73 ---- <table class="layout" cellpadding=0 cellspacing=0 width=100%> ! <tr><td align=center><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=12470&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a></td></tr> </table> |
From: Eric E. <eri...@us...> - 2007-01-02 14:30:44
|
Update of /cvsroot/objecthandler/ObjectHandler/Docs/pages In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1400/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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** history.docs 14 Dec 2006 12:27:35 -0000 1.4 --- history.docs 2 Jan 2007 14:30:42 -0000 1.5 *************** *** 24,28 **** /*! \page history Version History ! <strong>Release 0.1.5 - October 2006</strong> EXCEL --- 24,28 ---- /*! \page history Version History ! <strong>Release 0.1.5 - December 2006</strong> EXCEL |
From: Eric E. <eri...@us...> - 2007-01-02 14:30:43
|
Update of /cvsroot/objecthandler/ObjectHandler In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1400 Modified Files: README.txt Log Message: update docs Index: README.txt =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 22 May 2006 13:43:33 -0000 1.2 --- README.txt 2 Jan 2007 14:30:42 -0000 1.3 *************** *** 1,12 **** - ObjectHandler ! <http://quantlib.org/objecthandler> - ObjectHandler is a subproject of the QuantLib open source C++ analytics library. ObjectHandler implements an object repository allowing objects to be stored, shared, updated, interrogated, and destroyed. ObjectHandler facilitates integration of QuantLib functionality to end user environments such as spreadsheets. QuantLib is Non-Copylefted Free Software. QuantLib is OSI Certified Open Source Software. --- 1,11 ---- ObjectHandler ! <http://www.objecthandler.org> ObjectHandler implements an object repository allowing objects to be stored, shared, updated, interrogated, and destroyed. ObjectHandler facilitates integration of QuantLib functionality to end user environments such as spreadsheets. + ObjectHandler is a subproject of the QuantLib open source C++ analytics library. QuantLib is Non-Copylefted Free Software. QuantLib is OSI Certified Open Source Software. *************** *** 29,35 **** Installation instructions are available at ! <http://quantlib.org/objecthandler/installation.html>. A list of changes since the previous release is available in NEWS.txt (included in this distribution) while a list of past changes can be ! browsed at <http://quantlib.org/objecthandler/history.html>. --- 28,35 ---- Installation instructions are available at ! <http://www.objecthandler.org/installation.html>. A list of changes since the previous release is available in NEWS.txt (included in this distribution) while a list of past changes can be ! browsed at <http://www.objecthandler.org/history.html>. ! |
From: Eric E. <eri...@us...> - 2007-01-02 14:17:38
|
Update of /cvsroot/objecthandler/ObjectHandler In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28362 Modified Files: Tag: R000105f0-branch README.txt Log Message: update docs Index: README.txt =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/README.txt,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** README.txt 22 May 2006 13:43:33 -0000 1.2 --- README.txt 2 Jan 2007 14:17:33 -0000 1.2.4.1 *************** *** 1,12 **** - ObjectHandler ! <http://quantlib.org/objecthandler> - ObjectHandler is a subproject of the QuantLib open source C++ analytics library. ObjectHandler implements an object repository allowing objects to be stored, shared, updated, interrogated, and destroyed. ObjectHandler facilitates integration of QuantLib functionality to end user environments such as spreadsheets. QuantLib is Non-Copylefted Free Software. QuantLib is OSI Certified Open Source Software. --- 1,11 ---- ObjectHandler ! <http://www.objecthandler.org> ObjectHandler implements an object repository allowing objects to be stored, shared, updated, interrogated, and destroyed. ObjectHandler facilitates integration of QuantLib functionality to end user environments such as spreadsheets. + ObjectHandler is a subproject of the QuantLib open source C++ analytics library. QuantLib is Non-Copylefted Free Software. QuantLib is OSI Certified Open Source Software. *************** *** 29,35 **** Installation instructions are available at ! <http://quantlib.org/objecthandler/installation.html>. A list of changes since the previous release is available in NEWS.txt (included in this distribution) while a list of past changes can be ! browsed at <http://quantlib.org/objecthandler/history.html>. --- 28,35 ---- Installation instructions are available at ! <http://www.objecthandler.org/installation.html>. A list of changes since the previous release is available in NEWS.txt (included in this distribution) while a list of past changes can be ! browsed at <http://www.objecthandler.org/history.html>. ! |
From: Eric E. <eri...@us...> - 2007-01-02 14:17:35
|
Update of /cvsroot/objecthandler/ObjectHandler/Docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28362/Docs Modified Files: Tag: R000105f0-branch Makefile.am oh_headeronline.html Log Message: update docs Index: Makefile.am =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Docs/Makefile.am,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** Makefile.am 13 Dec 2006 17:56:32 -0000 1.4.2.1 --- Makefile.am 2 Jan 2007 14:17:34 -0000 1.4.2.2 *************** *** 47,52 **** docs-html-dist: docs-html ln -s html ObjectHandler-docs-$(VERSION)-html ! tar chof - ObjectHandler-docs-$(VERSION)-html \ ! | GZIP=--best gzip -c > ObjectHandler-docs-$(VERSION)-html.tar.gz rm ObjectHandler-docs-$(VERSION)-html --- 47,51 ---- docs-html-dist: docs-html ln -s html ObjectHandler-docs-$(VERSION)-html ! tar czfvh ObjectHandler-docs-$(VERSION)-html.tar.gz ObjectHandler-docs-$(VERSION)-html rm ObjectHandler-docs-$(VERSION)-html Index: oh_headeronline.html =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Docs/oh_headeronline.html,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** oh_headeronline.html 11 Oct 2006 13:28:25 -0000 1.4 --- oh_headeronline.html 2 Jan 2007 14:17:34 -0000 1.4.2.1 *************** *** 69,73 **** <table class="layout" cellpadding=0 cellspacing=0 width=100%> ! <tr><td align=center><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=12740" width="88" height="31" border="0" alt="SourceForge Logo"></a></td></tr> </table> --- 69,73 ---- <table class="layout" cellpadding=0 cellspacing=0 width=100%> ! <tr><td align=center><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=12470&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a></td></tr> </table> |
From: Eric E. <eri...@us...> - 2007-01-02 14:17:35
|
Update of /cvsroot/objecthandler/ObjectHandler/Docs/pages In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28362/Docs/pages Modified Files: Tag: R000105f0-branch history.docs Log Message: update docs Index: history.docs =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Docs/pages/history.docs,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** history.docs 19 Oct 2006 16:26:04 -0000 1.3.2.1 --- history.docs 2 Jan 2007 14:17:34 -0000 1.3.2.2 *************** *** 24,28 **** /*! \page history Version History ! <strong>Release 0.1.5 - October 2006</strong> EXCEL --- 24,28 ---- /*! \page history Version History ! <strong>Release 0.1.5 - December 2006</strong> EXCEL |