objecthandler-cvs Mailing List for ObjectHandler (Page 16)
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-07-11 13:30:42
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13781/gensrc/config Modified Files: config.xml excel.xml Log Message: categorize functions in the Excel Function Wizard Index: config.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/config/config.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.xml 6 Jun 2006 09:08:27 -0000 1.1 --- config.xml 11 Jul 2006 13:30:39 -0000 1.2 *************** *** 1,10 **** <Config> ! <excelRootDirectory>../ohxl/</excelRootDirectory> ! <namespace>ObjHandler</namespace> ! <categoryNames> ! <categoryName>functions</categoryName> ! </categoryNames> </Config> --- 1,10 ---- <Config> ! <excelRootDirectory>../ohxl/</excelRootDirectory> ! <namespace>ObjHandler</namespace> ! <categoryNames> ! <categoryName>functions</categoryName> ! </categoryNames> </Config> Index: excel.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/config/excel.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** excel.xml 6 Jun 2006 09:08:27 -0000 1.1 --- excel.xml 11 Jul 2006 13:30:39 -0000 1.2 *************** *** 1,18 **** <root> ! <AddinFiles> ! <AddinFile name='register.cpp'> ! <Buffer name='stub' fileName='stub.excel.register' local='true'/> ! </AddinFile> ! <AddinFile name='unregister.cpp'> ! <Buffer name='stub' fileName='stub.excel.unregister' local='true'/> ! </AddinFile> ! </AddinFiles> ! <exportSymbols>true</exportSymbols> ! <Buffer name='exportStub' fileName='stub.excel.exports' local='true'/> ! <implicitConversions/> </root> - --- 1,17 ---- <root> ! <AddinFiles> ! <AddinFile name='register.cpp'> ! <Buffer name='stub' fileName='stub.excel.register' local='true'/> ! </AddinFile> ! <AddinFile name='unregister.cpp'> ! <Buffer name='stub' fileName='stub.excel.unregister' local='true'/> ! </AddinFile> ! </AddinFiles> ! <exportSymbols>true</exportSymbols> ! <Buffer name='exportStub' fileName='stub.excel.exports' local='true'/> ! <implicitConversions/> </root> |
From: Eric E. <eri...@us...> - 2006-07-11 12:33:29
|
Update of /cvsroot/objecthandler/ObjectHandler/xlsdk In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4226/xlsdk Modified Files: framewrk.cpp Log Message: modify GetTempMemory() to throw rather than return 0 on error Index: framewrk.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/xlsdk/framewrk.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** framewrk.cpp 2 Jun 2006 13:58:09 -0000 1.3 --- framewrk.cpp 11 Jul 2006 12:33:26 -0000 1.4 *************** *** 57,61 **** if (vOffsetMemBlock + cBytes > MEMORYSIZE) { ! return 0; } else --- 57,62 ---- if (vOffsetMemBlock + cBytes > MEMORYSIZE) { ! //return 0; ! throw std::exception("buffer overflow"); } else *************** *** 145,152 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } lpx->xltype = xltypeNum; --- 146,153 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} lpx->xltype = xltypeNum; *************** *** 226,233 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } lpx->xltype = xltypeStr; --- 227,234 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} lpx->xltype = xltypeStr; *************** *** 242,253 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } int len = __min(255, s.length()); lpx->xltype = xltypeStr; lpx->val.str = GetTempMemory(len + 1); ! if (!lpx->val.str) return 0; strncpy(lpx->val.str + 1, s.c_str(), len); lpx->val.str[0] = (BYTE) len; --- 243,254 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} int len = __min(255, s.length()); lpx->xltype = xltypeStr; lpx->val.str = GetTempMemory(len + 1); ! //if (!lpx->val.str) return 0; strncpy(lpx->val.str + 1, s.c_str(), len); lpx->val.str[0] = (BYTE) len; *************** *** 281,288 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } lpx->xltype = xltypeBool; --- 282,289 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} lpx->xltype = xltypeBool; *************** *** 318,325 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } lpx->xltype = xltypeInt; --- 319,326 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} lpx->xltype = xltypeInt; *************** *** 358,365 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } lpx->xltype = xltypeErr; --- 359,366 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} lpx->xltype = xltypeErr; *************** *** 541,548 **** lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! if (!lpx) ! { ! return 0; ! } lpx->xltype = xltypeMissing; --- 542,549 ---- lpx = (LPXLOPER) GetTempMemory(sizeof(XLOPER)); ! //if (!lpx) ! //{ ! // return 0; ! //} lpx->xltype = xltypeMissing; |
From: Eric E. <eri...@us...> - 2006-07-03 08:19:30
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4318/oh Modified Files: utilities.cpp utilities.hpp Log Message: revised processing for ohParseFields() Index: utilities.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** utilities.cpp 30 Jun 2006 09:33:39 -0000 1.10 --- utilities.cpp 3 Jul 2006 08:19:26 -0000 1.11 *************** *** 26,30 **** #include <sstream> #include <boost/regex.hpp> - #include <boost/lexical_cast.hpp> namespace ObjHandler { --- 26,29 ---- *************** *** 84,88 **** // parse a whitespace-delimited list of symbols // into a vector of strings ! std::vector<std::string> split(const std::string &line) { std::vector<std::string> ret; std::string::const_iterator start = line.begin(); --- 83,89 ---- // parse a whitespace-delimited list of symbols // into a vector of strings ! std::vector<std::string> split( ! const std::string &line, ! unsigned int maxRequired) { std::vector<std::string> ret; std::string::const_iterator start = line.begin(); *************** *** 90,94 **** boost::match_results<std::string::const_iterator> m; static const boost::regex r("[^[:space:]]+"); ! while (boost::regex_search(start, end, m, r)) { ret.push_back(std::string(m[0].first, m[0].second)); start = m[0].second; --- 91,95 ---- boost::match_results<std::string::const_iterator> m; static const boost::regex r("[^[:space:]]+"); ! while (maxRequired-- && boost::regex_search(start, end, m, r)) { ret.push_back(std::string(m[0].first, m[0].second)); start = m[0].second; *************** *** 97,129 **** } ! double parseField(const std::string &line, ! const long &index /* index - 1-base for user, 0-base internally */ ) { ! if (index<1) { ! std::stringstream msg; ! msg << "the index of the requested field - " << index ! << " - is invalid - minimum value is 1."; ! throw Exception(msg.str()); ! } ! unsigned int i = static_cast<unsigned int>(index); ! std::vector<std::string> fields = split(line); ! if (i>fields.size()) { ! std::stringstream msg; ! msg << "Error parsing string -" << std::endl ! << line << std::endl << "- requested field index " << i ! << " exceeds #fields (" << fields.size() << ") found in string"; ! throw Exception(msg.str()); ! } ! double ret; ! try { ! ret = boost::lexical_cast<double>(fields[i-1]); ! } catch (boost::bad_lexical_cast &) { ! std::stringstream msg; ! msg << "Error parsing string -" << std::endl ! << line << std::endl << "- requested field #" << i ! << " comprising text '" << fields[i-1] ! << "' could not be converted to a number"; ! throw Exception(msg.str()); ! } ! return ret; } --- 98,106 ---- } ! std::string uppercase(const std::string& s) { ! std::string output = s; ! for (std::string::iterator i=output.begin(); i!=output.end(); i++) ! *i = std::toupper(*i); ! return output; } Index: utilities.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** utilities.hpp 30 Jun 2006 09:33:39 -0000 1.7 --- utilities.hpp 3 Jul 2006 08:19:26 -0000 1.8 *************** *** 26,29 **** --- 26,30 ---- #include <oh/objhandlerdefines.hpp> #include <string> + #include <vector> namespace ObjHandler { *************** *** 80,87 **** void logAllObjects(); ! //! Extract the ith number from a whitespace-delimited list of fields. ! /*! Used to parse data returned from Reuters function RtGet(). ! */ ! double parseField(const std::string &line, const long &i); //@} --- 81,89 ---- void logAllObjects(); ! // some basic utilities ! std::vector<std::string> split( ! const std::string &line, ! unsigned int maxRequired); ! std::string uppercase(const std::string& s); //@} |
From: Eric E. <eri...@us...> - 2006-07-03 08:19:30
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/stubs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4318/gensrc/stubs Modified Files: stub.excel.exports stub.excel.includes stub.excel.register stub.excel.unregister Log Message: revised processing for ohParseFields() Index: stub.excel.exports =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.exports,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stub.excel.exports 14 Jun 2006 13:15:25 -0000 1.2 --- stub.excel.exports 3 Jul 2006 08:19:26 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- #pragma comment (linker, "/export:_ohPack") + #pragma comment (linker, "/export:_ohParseField") %s Index: stub.excel.register =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.register,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stub.excel.register 16 Jun 2006 16:15:31 -0000 1.3 --- stub.excel.register 3 Jul 2006 08:19:26 -0000 1.4 *************** *** 17,20 **** --- 17,34 ---- TempStrNoSize("\x1D""range of cells to be packed ")); // description of parameter 1 + Excel(xlfRegister, 0, 13, &xDll, + TempStrNoSize("\x0C""ohParseField"), // function code name + TempStrNoSize("\x05""RCNC#"), // parameter codes + TempStrNoSize("\x0C""ohParseField"), // function display name + TempStrNoSize("\x0F""line,index,type"), // comma-delimited list of parameter names + TempStrNoSize("\x01""1"), // function type (1 = worksheet function) + TempStrNoSize("\x0D""ObjectHandler"), // function category + TempStrNoSize("\x00"""), // shortcut text (command macros only) + TempStrNoSize("\x00"""), // path to help file + TempStrNoSize("\x41""Extract the ith number from a whitespace-delimited list of fields"), // function description + TempStrNoSize("\x11""text to be parsed"), // description of parameter 1 + TempStrNoSize("\x20""index (1-based) of desired field"), // description of parameter 2 + TempStrNoSize("\x23""required datatype (string/number) ")); // description of parameter 3 + } Index: stub.excel.unregister =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.unregister,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stub.excel.unregister 16 Jun 2006 16:15:31 -0000 1.3 --- stub.excel.unregister 3 Jul 2006 08:19:26 -0000 1.4 *************** *** 9,14 **** XLOPER xlRegID; - %(xlunregister)s - Excel(xlfRegister, 0, 11, &xDll, TempStrNoSize("\x06""ohPack"), // function code name --- 9,12 ---- *************** *** 26,29 **** --- 24,50 ---- TempStrNoSize("\x06""ohPack")); // function code name + Excel4(xlfUnregister, 0, 1, &xlRegID); + + Excel(xlfRegister, 0, 13, &xDll, + TempStrNoSize("\x0C""ohParseField"), // function code name + TempStrNoSize("\x05""RCNC#"), // parameter codes + TempStrNoSize("\x0C""ohParseField"), // function display name + TempStrNoSize("\x0F""line,index,type"), // comma-delimited list of parameter names + TempStrNoSize("\x01""0"), // function type (0 = hidden function) + TempStrNoSize("\x0D""ObjectHandler"), // function category + TempStrNoSize("\x00"""), // shortcut text (command macros only) + TempStrNoSize("\x00"""), // path to help file + TempStrNoSize("\x41""Extract the ith number from a whitespace-delimited list of fields"), // function description + TempStrNoSize("\x11""text to be parsed"), // description of parameter 1 + TempStrNoSize("\x20""index (1-based) of desired field"), // description of parameter 2 + TempStrNoSize("\x23""required datatype (string/number) ")); // description of parameter 3 + + Excel4(xlfRegisterId, &xlRegID, 2, &xDll, + TempStrNoSize("\x0C""ohParseField")); // function code name + + Excel4(xlfUnregister, 0, 1, &xlRegID); + + %(xlunregister)s + } Index: stub.excel.includes =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.includes,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stub.excel.includes 14 Jun 2006 13:15:25 -0000 1.3 --- stub.excel.includes 3 Jul 2006 08:19:26 -0000 1.4 *************** *** 6,9 **** --- 6,10 ---- #include <sstream> #include <map> + #include <boost/lexical_cast.hpp> #define XLL_DEC extern "C" *************** *** 11,16 **** // FIXME some temporary workarounds for shortcomings in gensrc - #define SET_SESSION_ID - namespace ObjHandler { --- 12,15 ---- *************** *** 22,25 **** --- 21,26 ---- } + #define SET_SESSION_ID + int countValidRows(const XLOPER &xMulti) { for (int numValidRows=xMulti.val.array.rows; numValidRows; numValidRows--) { *************** *** 103,104 **** --- 104,174 ---- } + XLL_DEC XLOPER *ohParseField( + char *line, + long *index, + char *type) { + boost::shared_ptr < ObjHandler::FunctionCall > functionCall; + try { + functionCall = boost::shared_ptr < ObjHandler::FunctionCall > + ( new ObjHandler::FunctionCall("ohParseField") ); + + SET_SESSION_ID + + // reset the calling cell + + ObjHandler::ObjectHandlerXL::instance().resetCaller(); + + // invoke the utility function + + if (*index<1) { + std::stringstream msg; + msg << "the index of the requested field - " << *index + << " - is invalid - minimum value is 1."; + throw ObjHandler::Exception(msg.str()); + } + unsigned int i = static_cast<unsigned int>(*index); + std::vector<std::string> fields = ObjHandler::split(line, i); + if (i>fields.size()) { + std::stringstream msg; + msg << "Error parsing string -" << std::endl + << line << std::endl << "- requested field index " << i + << " exceeds #fields (" << fields.size() << ") found in string"; + throw ObjHandler::Exception(msg.str()); + } + + static XLOPER xRet; + std::string typeStr(type); + if (typeStr.empty() || ObjHandler::uppercase(typeStr) == "NUMBER") { + double ret; + try { + ret = boost::lexical_cast<double>(fields[i-1]); + } catch (boost::bad_lexical_cast &) { + std::stringstream msg; + msg << "Error parsing string -" << std::endl + << line << std::endl << "- the requested field #" << i + << " comprising text '" << fields[i-1] + << "' could not be converted to a number"; + throw ObjHandler::Exception(msg.str()); + } + ObjHandler::scalarToXloper(xRet, ret); + } else if (ObjHandler::uppercase(typeStr) == "STRING") { + ObjHandler::scalarToXloper(xRet, fields[i-1]); + } else { + std::stringstream msg; + msg << "invalid type specified -" + << " expected 'NUMBER' or 'STRING' -" + << " detected '" << type << "'"; + throw ObjHandler::Exception(msg.str()); + } + + return &xRet; + + } catch (const std::exception &e) { + std::ostringstream err; + err << "ohParseField - "; + if (functionCall) err << functionCall->getAddressString() << " - "; + err << e.what(); + ObjHandler::logMessage(err.str(), 2); + return 0; + } + } |
From: Eric E. <eri...@us...> - 2006-07-03 08:19:30
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4318/gensrc/metadata Modified Files: functions.xml Log Message: revised processing for ohParseFields() Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** functions.xml 30 Jun 2006 09:33:39 -0000 1.9 --- functions.xml 3 Jul 2006 08:19:25 -0000 1.10 *************** *** 427,431 **** </Procedure--> ! <Procedure name='ohParseField'> <description>Extract the ith number from a whitespace-delimited list of fields</description> <functionCategory>ObjectHandler</functionCategory> --- 427,431 ---- </Procedure--> ! <!--Procedure name='ohParseField'> <description>Extract the ith number from a whitespace-delimited list of fields</description> <functionCategory>ObjectHandler</functionCategory> *************** *** 450,454 **** <description>requested text field converted to double</description> </ReturnValue> ! </Procedure> </Functions> --- 450,454 ---- <description>requested text field converted to double</description> </ReturnValue> ! </Procedure--> </Functions> |
From: Eric E. <eri...@us...> - 2006-06-30 09:33:43
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11495/gensrc/metadata Modified Files: functions.xml Log Message: add function ohParseField() Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** functions.xml 23 Jun 2006 17:01:24 -0000 1.8 --- functions.xml 30 Jun 2006 09:33:39 -0000 1.9 *************** *** 427,430 **** --- 427,455 ---- </Procedure--> + <Procedure name='ohParseField'> + <description>Extract the ith number from a whitespace-delimited list of fields</description> + <functionCategory>ObjectHandler</functionCategory> + <alias>ObjHandler::parseField</alias> + <ParameterList> + <Parameters> + <Parameter name='line'> + <type>string</type> + <tensorRank>scalar</tensorRank> + <description>text to be parsed</description> + </Parameter> + <Parameter name='index'> + <type>long</type> + <tensorRank>scalar</tensorRank> + <description>index (1-based) of desired field</description> + </Parameter> + </Parameters> + </ParameterList> + <ReturnValue> + <type>double</type> + <tensorRank>scalar</tensorRank> + <description>requested text field converted to double</description> + </ReturnValue> + </Procedure> + </Functions> </Category> |
From: Eric E. <eri...@us...> - 2006-06-30 09:33:43
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11495/oh Modified Files: utilities.cpp utilities.hpp Log Message: add function ohParseField() Index: utilities.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** utilities.cpp 19 Jun 2006 12:58:14 -0000 1.9 --- utilities.cpp 30 Jun 2006 09:33:39 -0000 1.10 *************** *** 25,28 **** --- 25,30 ---- #include <oh/exception.hpp> #include <sstream> + #include <boost/regex.hpp> + #include <boost/lexical_cast.hpp> namespace ObjHandler { *************** *** 80,83 **** } ! } --- 82,130 ---- } ! // parse a whitespace-delimited list of symbols ! // into a vector of strings ! std::vector<std::string> split(const std::string &line) { ! std::vector<std::string> ret; ! std::string::const_iterator start = line.begin(); ! std::string::const_iterator end = line.end(); ! boost::match_results<std::string::const_iterator> m; ! static const boost::regex r("[^[:space:]]+"); ! while (boost::regex_search(start, end, m, r)) { ! ret.push_back(std::string(m[0].first, m[0].second)); ! start = m[0].second; ! } ! return ret; ! } + double parseField(const std::string &line, + const long &index /* index - 1-base for user, 0-base internally */ ) { + if (index<1) { + std::stringstream msg; + msg << "the index of the requested field - " << index + << " - is invalid - minimum value is 1."; + throw Exception(msg.str()); + } + unsigned int i = static_cast<unsigned int>(index); + std::vector<std::string> fields = split(line); + if (i>fields.size()) { + std::stringstream msg; + msg << "Error parsing string -" << std::endl + << line << std::endl << "- requested field index " << i + << " exceeds #fields (" << fields.size() << ") found in string"; + throw Exception(msg.str()); + } + double ret; + try { + ret = boost::lexical_cast<double>(fields[i-1]); + } catch (boost::bad_lexical_cast &) { + std::stringstream msg; + msg << "Error parsing string -" << std::endl + << line << std::endl << "- requested field #" << i + << " comprising text '" << fields[i-1] + << "' could not be converted to a number"; + throw Exception(msg.str()); + } + return ret; + } + + } Index: utilities.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** utilities.hpp 9 Jun 2006 18:58:27 -0000 1.6 --- utilities.hpp 30 Jun 2006 09:33:39 -0000 1.7 *************** *** 80,83 **** --- 80,88 ---- void logAllObjects(); + //! Extract the ith number from a whitespace-delimited list of fields. + /*! Used to parse data returned from Reuters function RtGet(). + */ + double parseField(const std::string &line, const long &i); + //@} } |
From: Eric E. <eri...@us...> - 2006-06-28 14:28:35
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4466/ohxl Modified Files: objecthandlerxl.cpp objecthandlerxl.hpp Log Message: increase to 4 billion the max value of autogenerated object IDs Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** objecthandlerxl.cpp 18 Jun 2006 13:41:51 -0000 1.8 --- objecthandlerxl.cpp 28 Jun 2006 14:28:32 -0000 1.9 *************** *** 31,39 **** #include <iomanip> #include <sstream> ! #include <cmath> namespace ObjHandler { ! int ObjectHandlerXL::instanceNameCount_ = 0; // std::map cannot be exported across DLL boundaries --- 31,39 ---- #include <iomanip> #include <sstream> ! #include <limits.h> namespace ObjHandler { ! unsigned long ObjectHandlerXL::instanceNameCount_ = 0; // std::map cannot be exported across DLL boundaries *************** *** 44,53 **** if (instance_) { ObjectHandlerXL *ret = dynamic_cast<ObjectHandlerXL*>(instance_); ! if (ret) ! return *ret; ! else ! throw Exception("Attempt to reference uninitialized ObjectHandlerXL object"); ! } else ! throw Exception("Attempt to reference uninitialized ObjectHandlerXL object"); } --- 44,50 ---- if (instance_) { ObjectHandlerXL *ret = dynamic_cast<ObjectHandlerXL*>(instance_); ! if (ret) return *ret; ! } ! throw Exception("Attempt to reference uninitialized ObjectHandlerXL object"); } *************** *** 142,151 **** std::string ObjectHandlerXL::generateInstanceName() { static const int COUNT_WIDTH = 5; static const int COUNT_BASE = 16; - static const double COUNT_MAX = pow((double)COUNT_BASE, COUNT_WIDTH); ! if (instanceNameCount_ > COUNT_MAX) ! throw Exception("ObjectHandlerXL::generateInstanceName: max count value exceeded"); std::ostringstream s; s << "obj_" << std::setw(COUNT_WIDTH) << std::setfill('0') << std::setbase(COUNT_BASE) << instanceNameCount_++; --- 139,159 ---- std::string ObjectHandlerXL::generateInstanceName() { + /* + The user has provided a null string as the object ID so generate a name automatically. + The name is in the format obj_XXXXX where XXXXX is a hexidecimal value which is COUNT_WIDTH + digits long until the value exceeds COUNT_BASE^COUNT_WIDTH at which point the length grows + as necessary until ULONG_MAX is hit and an exception is thrown. + */ static const int COUNT_WIDTH = 5; static const int COUNT_BASE = 16; ! if (instanceNameCount_ == 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()); ! } std::ostringstream s; s << "obj_" << std::setw(COUNT_WIDTH) << std::setfill('0') << std::setbase(COUNT_BASE) << instanceNameCount_++; *************** *** 175,180 **** void ObjectHandlerXL::deleteAllObjects(const bool &deletePermanent) { ! if (deletePermanent) callingRanges_.clear(); ObjectHandler::deleteAllObjects(deletePermanent); } --- 183,190 ---- void ObjectHandlerXL::deleteAllObjects(const bool &deletePermanent) { ! if (deletePermanent) { callingRanges_.clear(); + instanceNameCount_ = 0; + } ObjectHandler::deleteAllObjects(deletePermanent); } Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** objecthandlerxl.hpp 18 Jun 2006 13:41:51 -0000 1.8 --- objecthandlerxl.hpp 28 Jun 2006 14:28:32 -0000 1.9 *************** *** 72,76 **** virtual std::string generateInstanceName(); void clearCallingRange(boost::shared_ptr < CallingRange > callingRange); ! static int instanceNameCount_; }; --- 72,76 ---- virtual std::string generateInstanceName(); void clearCallingRange(boost::shared_ptr < CallingRange > callingRange); ! static unsigned long instanceNameCount_; }; |
From: Ferdinando A. <na...@us...> - 2006-06-23 17:01:28
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26660/gensrc/metadata Modified Files: functions.xml Log Message: formatting Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** functions.xml 19 Jun 2006 11:02:38 -0000 1.7 --- functions.xml 23 Jun 2006 17:01:24 -0000 1.8 *************** *** 1,318 **** <Category name='functions'> ! <description>ObjectHandler functions</description> ! <displayName>ObjectHandler</displayName> ! ! <Functions> ! ! <Procedure name='ohVersion'> ! <description>returns the version number of ObjectHandler</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::version</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>ObjectHandler version number</description> ! </ReturnValue> ! </Procedure> ! ! <Procedure name='ohObjectCount'> ! <description>#/objects in repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().objectCount</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>long</type> ! <tensorRank>scalar</tensorRank> ! <description>object count</description> ! </ReturnValue> ! </Procedure> ! ! <Procedure name='ohListInstanceNames'> ! <description>list instance names of objects in repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().listInstanceNames</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='regex'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>optional matching pattern in UNIX format (wildcard is .*)</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>vector</tensorRank> ! <description>list of instance names matching regex</description> ! </ReturnValue> ! </Procedure> ! <Member name='ohPropertyNames' objectClass='Object'> ! <description>retrieve the property names of a given object</description> ! <!--platforms>CGO</platforms--> ! <libraryFunction>propertyNames</libraryFunction> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>vector</tensorRank> ! <description>list of property names for queried object</description> ! </ReturnValue> ! </Member> ! <Member name='ohPropertyValue' objectClass='Object'> ! <description>retrieve the value of a named property</description> ! <!--platforms>CGO</platforms--> ! <libraryFunction>propertyValue</libraryFunction> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='fieldName'> <type>string</type> <tensorRank>scalar</tensorRank> ! <description>name of property</description> ! </Parameter> ! <Parameter name='trigger' ignore='true'> ! <type>any</type> <tensorRank>scalar</tensorRank> ! <description>dependency tracking trigger</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>value of named field</description> ! </ReturnValue> ! </Member> ! <Procedure name='ohDeleteObject'> ! <description>delete object from repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().deleteObject</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='instanceName'> <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>instance name of object to be deleted</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohDeleteAllObjects'> ! <description>delete all objects from repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().deleteAllObjects</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='deletePermanent' default='false'> ! <type>bool</type> ! <tensorRank>scalar</tensorRank> ! <description>also delete permanent objects</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohDependsOn'> ! <description>force a dependency between two functions</description> ! <!--platforms>D</platforms--> ! <functionCategory>ObjectHandler</functionCategory> ! <alias>ObjHandler::dependsOn</alias> ! <ParameterList> ! <Parameters> ! <Parameter name='dummy0' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy1' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy2' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy3' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy4' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy5' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy6' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy7' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy8' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy9' ignore='true'> <type>any</type> <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>long</type> ! <tensorRank>scalar</tensorRank> ! <description>update count</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohSetLogFile'> ! <description>begin logging to named file</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::setLogFile</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='logFileName'> ! <type>string</type> <tensorRank>scalar</tensorRank> ! <description>path and name of log file</description> ! </Parameter> ! <Parameter name='logLevel' default='4'> ! <type>long</type> <tensorRank>scalar</tensorRank> ! <description>threshold for log messages</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>name of logfile</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohSetLogLevel'> ! <description>set threshold for log messages</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::setLogLevel</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='logLevel'> <type>long</type> <tensorRank>scalar</tensorRank> ! <description>threshold for log messages</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>returns new logging threshold</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLogMessage'> ! <description>log a message</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::logMessage</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='logMessage'> <type>string</type> <tensorRank>scalar</tensorRank> ! <description>message to be logged</description> ! </Parameter> ! <Parameter name='logLevel' default='4'> ! <type>long</type> <tensorRank>scalar</tensorRank> ! <description>threshold for log messages</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>message logged</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLogObject'> ! <description>write object description to log file</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::logObject</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='instanceName'> ! <type>string</type> <tensorRank>scalar</tensorRank> ! <description>instance name of object to be logged</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLogAllObjects'> ! <description>write all object descriptions to log file</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::logAllObjects</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <!--Procedure name='ohSetConsole'> <description>fork output to stdout</description> <platforms>CG</platforms> --- 1,318 ---- <Category name='functions'> ! <description>ObjectHandler functions</description> ! <displayName>ObjectHandler</displayName> ! <Functions> ! <Procedure name='ohVersion'> ! <description>returns the version number of ObjectHandler</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::version</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> <type>string</type> <tensorRank>scalar</tensorRank> ! <description>ObjectHandler version number</description> ! </ReturnValue> ! </Procedure> ! ! <Procedure name='ohObjectCount'> ! <description>#/objects in repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().objectCount</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>long</type> <tensorRank>scalar</tensorRank> ! <description>object count</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohListInstanceNames'> ! <description>list instance names of objects in repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().listInstanceNames</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='regex'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>optional matching pattern in UNIX format (wildcard is .*)</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> <type>string</type> ! <tensorRank>vector</tensorRank> ! <description>list of instance names matching regex</description> ! </ReturnValue> ! </Procedure> ! <Member name='ohPropertyNames' objectClass='Object'> ! <description>retrieve the property names of a given object</description> ! <!--platforms>CGO</platforms--> ! <libraryFunction>propertyNames</libraryFunction> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>vector</tensorRank> ! <description>list of property names for queried object</description> ! </ReturnValue> ! </Member> ! <Member name='ohPropertyValue' objectClass='Object'> ! <description>retrieve the value of a named property</description> ! <!--platforms>CGO</platforms--> ! <libraryFunction>propertyValue</libraryFunction> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='fieldName'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>name of property</description> ! </Parameter> ! <Parameter name='trigger' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dependency tracking trigger</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> <type>any</type> <tensorRank>scalar</tensorRank> ! <description>value of named field</description> ! </ReturnValue> ! </Member> ! <Procedure name='ohDeleteObject'> ! <description>delete object from repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().deleteObject</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='instanceName'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>instance name of object to be deleted</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! ! <Procedure name='ohDeleteAllObjects'> ! <description>delete all objects from repository</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::ObjectHandlerXL::instance().deleteAllObjects</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='deletePermanent' default='false'> ! <type>bool</type> ! <tensorRank>scalar</tensorRank> ! <description>also delete permanent objects</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohDependsOn'> ! <description>force a dependency between two functions</description> ! <!--platforms>D</platforms--> ! <functionCategory>ObjectHandler</functionCategory> ! <alias>ObjHandler::dependsOn</alias> ! <ParameterList> ! <Parameters> ! <Parameter name='dummy0' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy1' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy2' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy3' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy4' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy5' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy6' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy7' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy8' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! <Parameter name='dummy9' ignore='true'> ! <type>any</type> ! <tensorRank>scalar</tensorRank> ! <description>dummy parameter (ignored)</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> <type>long</type> <tensorRank>scalar</tensorRank> ! <description>update count</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohSetLogFile'> ! <description>begin logging to named file</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::setLogFile</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='logFileName'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>path and name of log file</description> ! </Parameter> ! <Parameter name='logLevel' default='4'> ! <type>long</type> ! <tensorRank>scalar</tensorRank> ! <description>threshold for log messages</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> <type>string</type> <tensorRank>scalar</tensorRank> ! <description>name of logfile</description> ! </ReturnValue> ! </Procedure> ! ! <Procedure name='ohSetLogLevel'> ! <description>set threshold for log messages</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::setLogLevel</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='logLevel'> ! <type>long</type> ! <tensorRank>scalar</tensorRank> ! <description>threshold for log messages</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> <tensorRank>scalar</tensorRank> ! <description>returns new logging threshold</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLogMessage'> ! <description>log a message</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::logMessage</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='logMessage'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>message to be logged</description> ! </Parameter> ! <Parameter name='logLevel' default='4'> ! <type>long</type> ! <tensorRank>scalar</tensorRank> ! <description>threshold for log messages</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> <tensorRank>scalar</tensorRank> ! <description>message logged</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLogObject'> ! <description>write object description to log file</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::logObject</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='instanceName'> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>instance name of object to be logged</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLogAllObjects'> ! <description>write all object descriptions to log file</description> ! <!--platforms>CGO</platforms--> ! <alias>ObjHandler::logAllObjects</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! ! <!--Procedure name='ohSetConsole'> <description>fork output to stdout</description> <platforms>CG</platforms> *************** *** 340,344 **** </Procedure--> ! <!--Procedure name='ohGetGcEnabled'> <description>get value of ObjectHandler garbage collection flag</description> <platforms>D</platforms> --- 340,344 ---- </Procedure--> ! <!--Procedure name='ohGetGcEnabled'> <description>get value of ObjectHandler garbage collection flag</description> <platforms>D</platforms> *************** *** 372,431 **** </Procedure--> ! <Procedure name='ohCallGC'> ! <description>delete orphaned objects from repository</description> ! <!--platforms>D</platforms--> ! <functionCategory>ObjectHandler</functionCategory> ! <alias>ObjHandler::ObjectHandlerXL::instance().collectGarbage</alias> ! <ParameterList> ! <Parameters> ! <Parameter name='deletePermanent' default='false'> ! <type>bool</type> <tensorRank>scalar</tensorRank> ! <description>also delete permanent objects</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> ! <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLastErrorMessage'> ! <description>return last logged message</description> ! <alias>ObjHandler::ObjectHandler::instance().lastErrorMessage</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>last logged message</description> ! </ReturnValue> ! </Procedure> ! <!--Procedure name='ohPack'> ! <description>trim error values from bottom/right of matrix/vector</description> ! <alias>ObjHandler::ObjectHandlerXL::instance().packMatrix</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='inputRange'> <type>any</type> <tensorRank>matrix</tensorRank> ! <description>scalar/vector/matrix of values to be packed</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>any</type> ! <tensorRank>matrix</tensorRank> ! <description>input range with error values removed from bottom/right cells</description> ! </ReturnValue> ! </Procedure--> ! </Functions> </Category> --- 372,431 ---- </Procedure--> ! <Procedure name='ohCallGC'> ! <description>delete orphaned objects from repository</description> ! <!--platforms>D</platforms--> ! <functionCategory>ObjectHandler</functionCategory> ! <alias>ObjHandler::ObjectHandlerXL::instance().collectGarbage</alias> ! <ParameterList> ! <Parameters> ! <Parameter name='deletePermanent' default='false'> ! <type>bool</type> ! <tensorRank>scalar</tensorRank> ! <description>also delete permanent objects</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> ! <type>void</type> <tensorRank>scalar</tensorRank> ! <description>success/failure</description> ! </ReturnValue> ! </Procedure> ! <Procedure name='ohLastErrorMessage'> ! <description>return last logged message</description> ! <alias>ObjHandler::ObjectHandler::instance().lastErrorMessage</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters/> ! </ParameterList> ! <ReturnValue> ! <type>string</type> ! <tensorRank>scalar</tensorRank> ! <description>last logged message</description> ! </ReturnValue> ! </Procedure> ! <!--Procedure name='ohPack'> ! <description>trim error values from bottom/right of matrix/vector</description> ! <alias>ObjHandler::ObjectHandlerXL::instance().packMatrix</alias> ! <functionCategory>ObjectHandler</functionCategory> ! <ParameterList> ! <Parameters> ! <Parameter name='inputRange'> ! <type>any</type> ! <tensorRank>matrix</tensorRank> ! <description>scalar/vector/matrix of values to be packed</description> ! </Parameter> ! </Parameters> ! </ParameterList> ! <ReturnValue> <type>any</type> <tensorRank>matrix</tensorRank> ! <description>input range with error values removed from bottom/right cells</description> ! </ReturnValue> ! </Procedure--> ! </Functions> </Category> |
From: Ferdinando A. <na...@us...> - 2006-06-20 18:26:44
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8866/ohxl Modified Files: conversions.cpp Log Message: more explit error message Index: conversions.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/conversions.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** conversions.cpp 14 Jun 2006 13:15:25 -0000 1.5 --- conversions.cpp 20 Jun 2006 18:26:41 -0000 1.6 *************** *** 184,188 **** } catch (const std::exception &e) { std::ostringstream msg; ! msg << "operToScalar: " << e.what(); throw Exception(msg.str()); } --- 184,188 ---- } catch (const std::exception &e) { std::ostringstream msg; ! msg << "operToScalar cannot coerce to long: " << e.what(); throw Exception(msg.str()); } *************** *** 205,209 **** } catch (const std::exception &e) { std::ostringstream msg; ! msg << "operToScalar: " << e.what(); throw Exception(msg.str()); } --- 205,209 ---- } catch (const std::exception &e) { std::ostringstream msg; ! msg << "operToScalar cannot coerce to double: " << e.what(); throw Exception(msg.str()); } *************** *** 226,230 **** } catch (const std::exception &e) { std::ostringstream msg; ! msg << "operToScalar: " << e.what(); throw Exception(msg.str()); } --- 226,230 ---- } catch (const std::exception &e) { std::ostringstream msg; ! msg << "operToScalar cannot coerce to bool: " << e.what(); throw Exception(msg.str()); } *************** *** 270,274 **** Excel(xlFree, 0, 1, &xTemp); std::ostringstream msg; ! msg << "operToScalar: " << e.what(); throw Exception(msg.str()); } --- 270,274 ---- Excel(xlFree, 0, 1, &xTemp); std::ostringstream msg; ! msg << "operToScalar cannot coerce to string: " << e.what(); throw Exception(msg.str()); } *************** *** 292,296 **** ret = value; } else ! throw Exception("operToScalar: unexpected datatype"); } --- 292,296 ---- ret = value; } else ! throw Exception("operToScalar cannot coerce to boost::any: unexpected datatype"); } |
From: Eric E. <eri...@us...> - 2006-06-19 12:58:17
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16441/oh Modified Files: utilities.cpp Log Message: Index: utilities.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** utilities.cpp 19 Jun 2006 11:02:38 -0000 1.8 --- utilities.cpp 19 Jun 2006 12:58:14 -0000 1.9 *************** *** 45,49 **** // so this function must not throw try { ! ObjectHandler::instance().setLastErrorMessage(message); Logger::instance().logMessage(message, level); } catch (...) {} --- 45,50 ---- // so this function must not throw try { ! if (level == 2) // loglevel 2 = error message ! ObjectHandler::instance().setLastErrorMessage(message); Logger::instance().logMessage(message, level); } catch (...) {} |
From: Eric E. <eri...@us...> - 2006-06-19 11:02:48
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29232/gensrc/metadata Modified Files: functions.xml Log Message: cache last error message not last log message Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functions.xml 16 Jun 2006 16:15:23 -0000 1.6 --- functions.xml 19 Jun 2006 11:02:38 -0000 1.7 *************** *** 393,399 **** </Procedure> ! <Procedure name='ohLastLogMessage'> <description>return last logged message</description> ! <alias>ObjHandler::ObjectHandler::instance().lastLogMessage</alias> <functionCategory>ObjectHandler</functionCategory> <ParameterList> --- 393,399 ---- </Procedure> ! <Procedure name='ohLastErrorMessage'> <description>return last logged message</description> ! <alias>ObjHandler::ObjectHandler::instance().lastErrorMessage</alias> <functionCategory>ObjectHandler</functionCategory> <ParameterList> |
From: Eric E. <eri...@us...> - 2006-06-19 11:02:47
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29232/oh Modified Files: objecthandler.hpp utilities.cpp Log Message: cache last error message not last log message Index: utilities.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** utilities.cpp 16 Jun 2006 16:15:36 -0000 1.7 --- utilities.cpp 19 Jun 2006 11:02:38 -0000 1.8 *************** *** 45,49 **** // so this function must not throw try { ! ObjectHandler::instance().setLastLogMessage(message); Logger::instance().logMessage(message, level); } catch (...) {} --- 45,49 ---- // so this function must not throw try { ! ObjectHandler::instance().setLastErrorMessage(message); Logger::instance().logMessage(message, level); } catch (...) {} Index: objecthandler.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** objecthandler.hpp 18 Jun 2006 13:41:51 -0000 1.7 --- objecthandler.hpp 19 Jun 2006 11:02:38 -0000 1.8 *************** *** 101,109 **** const std::string regex = ""); ! void setLastLogMessage(const std::string &message) { ! lastLogMessage_ = message; } ! const std::string &lastLogMessage() { ! return lastLogMessage_; } //@} --- 101,109 ---- const std::string regex = ""); ! void setLastErrorMessage(const std::string &message) { ! lastErrorMessage_ = message; } ! const std::string &lastErrorMessage() { ! return lastErrorMessage_; } //@} *************** *** 111,115 **** static ObjectHandler *instance_; void checkName(const std::string &instanceName); ! std::string lastLogMessage_; }; --- 111,115 ---- static ObjectHandler *instance_; void checkName(const std::string &instanceName); ! std::string lastErrorMessage_; }; |
From: Silvia F. <s_f...@us...> - 2006-06-19 08:24:24
|
Update of /cvsroot/objecthandler/ObjectHandler/Examples/xl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22783/Examples/xl Modified Files: addinstatic.cpp Log Message: fix example Index: addinstatic.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/Examples/xl/addinstatic.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** addinstatic.cpp 11 Jun 2006 12:38:21 -0000 1.8 --- addinstatic.cpp 19 Jun 2006 08:24:20 -0000 1.9 *************** *** 98,102 **** boost::shared_ptr<ObjHandler::ValueObject>( new AccountValueObject(instanceName, *accountNumber, accountType))); ! objectPointer->setPermanent(permanentCpp); const std::string returnValue = --- 98,102 ---- boost::shared_ptr<ObjHandler::ValueObject>( new AccountValueObject(instanceName, *accountNumber, accountType))); ! objectPointer->setPermanent(); const std::string returnValue = |
From: Eric E. <eri...@us...> - 2006-06-18 13:41:55
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17973/ohxl Modified Files: callingrange.cpp callingrange.hpp objecthandlerxl.cpp objecthandlerxl.hpp Log Message: cleaner processing for - permanent objects - autogeneration of source for loop functions Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** objecthandlerxl.cpp 15 Jun 2006 08:18:36 -0000 1.7 --- objecthandlerxl.cpp 18 Jun 2006 13:41:51 -0000 1.8 *************** *** 108,112 **** std::string ObjectHandlerXL::storeObject( ! const std::string &instanceName, const boost::shared_ptr<Object> &object) { boost::shared_ptr<CallingRange> callingRange = getCallingRange(); --- 108,112 ---- std::string ObjectHandlerXL::storeObject( ! std::string instanceName, const boost::shared_ptr<Object> &object) { boost::shared_ptr<CallingRange> callingRange = getCallingRange(); *************** *** 118,133 **** callingRange->update(); - std::string instanceNameDerived; if (instanceName.empty()) { ! instanceNameDerived = generateInstanceName(); ! object->setAnonymous(true); ! } else { ! instanceNameDerived = instanceName; } ! callingRange->registerObject(instanceNameDerived, object); ! checkName(instanceNameDerived); ! std::string instanceNameCounter = ObjectHandler::storeObject(instanceNameDerived, object); return instanceNameCounter + "#" + callingRange->updateCount(); } --- 118,131 ---- callingRange->update(); if (instanceName.empty()) { ! instanceName = generateInstanceName(); ! object->setAnonymous(); } ! callingRange->deleteObject(instanceName, object); ! checkName(instanceName); ! callingRange->registerObject(instanceName, object); ! std::string instanceNameCounter = ObjectHandler::storeObject(instanceName, object); return instanceNameCounter + "#" + callingRange->updateCount(); } Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** objecthandlerxl.hpp 15 Jun 2006 08:18:36 -0000 1.7 --- objecthandlerxl.hpp 18 Jun 2006 13:41:51 -0000 1.8 *************** *** 54,58 **** Performance in such special cases is sub-optimal. */ ! virtual std::string storeObject(const std::string &instanceName, const boost::shared_ptr < Object > &object); virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &instanceName) const; --- 54,58 ---- Performance in such special cases is sub-optimal. */ ! virtual std::string storeObject(std::string instanceName, const boost::shared_ptr < Object > &object); virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &instanceName) const; Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** callingrange.cpp 15 Jun 2006 08:18:36 -0000 1.4 --- callingrange.cpp 18 Jun 2006 13:41:51 -0000 1.5 *************** *** 84,88 **** } ! void CallingRange::registerObject( const std::string &instanceName, boost::shared_ptr<Object> object) { --- 84,88 ---- } ! void CallingRange::deleteObject( const std::string &instanceName, boost::shared_ptr<Object> object) { *************** *** 93,96 **** --- 93,101 ---- residentObjects_.erase(i->first); } + } + + void CallingRange::registerObject( + const std::string &instanceName, + boost::shared_ptr<Object> object) { residentObjects_[instanceName] = object; } *************** *** 204,217 **** std::ostream& operator<<(std::ostream& out, const CallingRange &callingRange) { ! out << "name: " << callingRange.key_ << std::endl; ! out << "reference: " << callingRange.getAddressString() << std::endl; ! out << "valid: " << (callingRange.isValid() ? "TRUE" : "FALSE") << std::endl; ! out << "busy: " << (callingRange.busy_ ? "TRUE" : "FALSE") << std::endl; ! out << "update count: " << callingRange.updateCount_ << std::endl; ! out << "invocation count: " << callingRange.invocationCount_ << std::endl; ! out << "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 << " instance name: " << i->first << std::endl; out << std::endl; return out; --- 209,234 ---- std::ostream& operator<<(std::ostream& out, const CallingRange &callingRange) { ! 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) ! << callingRange.isValid() << std::endl; ! out << std::setw(COL_WIDTH) << "busy: " ! << std::setiosflags(std::ios_base::boolalpha) ! << callingRange.busy_ << std::endl; ! out << std::setw(COL_WIDTH) << "update count: " ! << callingRange.updateCount_ << std::endl; ! out << std::setw(COL_WIDTH) << "invocation count: " ! << callingRange.invocationCount_ << std::endl; ! 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) << " instance name: " ! << i->first << std::endl; out << std::endl; return out; Index: callingrange.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** callingrange.hpp 15 Jun 2006 08:18:36 -0000 1.4 --- callingrange.hpp 18 Jun 2006 13:41:51 -0000 1.5 *************** *** 36,39 **** --- 36,41 ---- return key_; } + void deleteObject(const std::string &instanceName, + boost::shared_ptr<Object> object); void registerObject(const std::string &instanceName, boost::shared_ptr<Object> object); |
From: Eric E. <eri...@us...> - 2006-06-18 13:41:55
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17973/oh Modified Files: object.cpp object.hpp objecthandler.cpp objecthandler.hpp Log Message: cleaner processing for - permanent objects - autogeneration of source for loop functions Index: object.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** object.hpp 17 Jun 2006 10:50:50 -0000 1.8 --- object.hpp 18 Jun 2006 13:41:51 -0000 1.9 *************** *** 66,70 **** ObjectHandler::instance().storeObject(instanceName, object); */ ! Object() : anonymous_(false) {}; //! Default destructor. --- 66,70 ---- ObjectHandler::instance().storeObject(instanceName, object); */ ! Object() : anonymous_(false), permanent_(false) {}; //! Default destructor. *************** *** 93,108 **** } ! const bool &anonymous() { return anonymous_; } ! void setAnonymous(const bool &anonymous) { ! anonymous_ = anonymous; } ! const bool &permanent() { return permanent_; } ! void setPermanent(const bool &permanent) { ! permanent_ = permanent; } private: --- 93,108 ---- } ! const bool &anonymous() const { return anonymous_; } ! void setAnonymous() { ! anonymous_ = true; } ! const bool &permanent() const { return permanent_; } ! void setPermanent() { ! permanent_ = true; } private: *************** *** 122,125 **** --- 122,134 ---- } + /* + Helper template Object subclass implementing behavior required by + the majority of classes derived from Object for managing + the reference to the contained library object. + + Object subclasses requiring customized processing of the reference to + the contained library object should bypass LibraryObject and inherit + directly from Object. + */ template <class LibraryClass> class LibraryObject : public Object { *************** *** 131,136 **** if (ret) return ret; ! else ! throw Exception("unsuccessful attempt to recast pointer"); } template <> --- 140,151 ---- if (ret) return ret; ! else { ! std::ostringstream msg; ! msg << "Error retrieving library object - unable to convert reference" ! " from type " << std::endl << " " << typeid(LibraryClass).name() << ! " to type " << std::endl << " " << typeid(LibraryDerivedClass).name(); ! throw Exception(msg.str()); ! } ! } template <> Index: object.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** object.cpp 19 May 2006 15:12:41 -0000 1.1 --- object.cpp 18 Jun 2006 13:41:51 -0000 1.2 *************** *** 98,101 **** --- 98,109 ---- std::ostream& operator<<(std::ostream& out, const Object &object) { + static const int COL_WIDTH = 20; + out << std::endl; + out << std::left << "anonymous = " << std::setw(COL_WIDTH) + << std::setiosflags(std::ios_base::boolalpha) + << object.anonymous() << std::endl; + out << std::left << "permanent = " << std::setw(COL_WIDTH) + << std::setiosflags(std::ios_base::boolalpha) + << object.permanent() << std::endl; out << std::endl; const std::vector < std::string > propertyNames = object.propertyNames(); *************** *** 104,109 **** std::string propertyName = *it; const boost::any propertyValue = object.propertyValue(propertyName); ! out << std::left << "property = " << std::setw(10) << propertyName << ! " value = " << propertyValue << std::endl; } out << std::endl; --- 112,117 ---- std::string propertyName = *it; const boost::any propertyValue = object.propertyValue(propertyName); ! out << std::left << "property = " << std::setw(COL_WIDTH) << propertyName ! << " value = " << propertyValue << std::endl; } out << std::endl; Index: objecthandler.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** objecthandler.hpp 16 Jun 2006 16:15:36 -0000 1.6 --- objecthandler.hpp 18 Jun 2006 13:41:51 -0000 1.7 *************** *** 47,51 **** /*! Any existing Object with that instance name is deleted. */ ! virtual std::string storeObject(const std::string &instanceName, const boost::shared_ptr < Object > &object); --- 47,51 ---- /*! Any existing Object with that instance name is deleted. */ ! virtual std::string storeObject(std::string instanceName, const boost::shared_ptr < Object > &object); *************** *** 61,66 **** boost::dynamic_pointer_cast < T > (object); if (!ret) ! throw Exception("Error retrieving object with id '" + id + ! "' - unsuccessful attempt to recast pointer"); return ret; } --- 61,67 ---- boost::dynamic_pointer_cast < T > (object); if (!ret) ! throw Exception("Error retrieving object with id '" ! + id + "' - unable to convert reference to type '" ! + typeid(T).name() + "'"); return ret; } Index: objecthandler.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** objecthandler.cpp 11 Jun 2006 12:38:22 -0000 1.1 --- objecthandler.cpp 18 Jun 2006 13:41:51 -0000 1.2 *************** *** 51,55 **** } ! std::string ObjectHandler::storeObject(const std::string &instanceName, const boost::shared_ptr<Object> &object) { repository_[instanceName] = object; --- 51,55 ---- } ! std::string ObjectHandler::storeObject(std::string instanceName, const boost::shared_ptr<Object> &object) { repository_[instanceName] = object; |
From: Eric E. <eri...@us...> - 2006-06-17 10:50:53
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6170/oh Modified Files: object.hpp Log Message: fix for VC7 - avoid confusiong between templates and >> operator Index: object.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** object.hpp 16 Jun 2006 10:14:10 -0000 1.7 --- object.hpp 17 Jun 2006 10:50:50 -0000 1.8 *************** *** 34,39 **** // get a boost shared pointer to a class derived from Object #define OH_GET_OBJECT( NAME, ID, OBJECT_CLASS ) \ ! boost::shared_ptr<OBJECT_CLASS> NAME = \ ! ObjHandler::ObjectHandler::instance().retrieveObject<OBJECT_CLASS>(ID); // get a boost shared pointer to the client library object referenced by an ObjHandler::Object --- 34,39 ---- // get a boost shared pointer to a class derived from Object #define OH_GET_OBJECT( NAME, ID, OBJECT_CLASS ) \ ! boost::shared_ptr<OBJECT_CLASS > NAME = \ ! ObjHandler::ObjectHandler::instance().retrieveObject<OBJECT_CLASS >(ID); // get a boost shared pointer to the client library object referenced by an ObjHandler::Object |
From: Eric E. <eri...@us...> - 2006-06-16 19:29:23
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27540/gensrc Modified Files: Makefile.vc Log Message: initial support for Doxygen with Visual Studio makefiles Index: Makefile.vc =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/Makefile.vc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.vc 13 Jun 2006 15:46:16 -0000 1.2 --- Makefile.vc 16 Jun 2006 19:29:19 -0000 1.3 *************** *** 26,30 **** $(BUILDFLAG) : $(SCRIPT) $(INPUTS) $(BUILD_DIR) ! set PYTHONPATH=$(GENSRC_DIR)\import $(SCRIPT) echo flagged > $@ --- 26,30 ---- $(BUILDFLAG) : $(SCRIPT) $(INPUTS) $(BUILD_DIR) ! set PYTHONPATH=$(PYTHONPATH);$(GENSRC_DIR)\import $(SCRIPT) echo flagged > $@ |
From: Eric E. <eri...@us...> - 2006-06-16 16:56:30
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/stubs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10484/gensrc/stubs Modified Files: stub.excel.register stub.excel.unregister Log Message: cache the last error message Index: stub.excel.register =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.register,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stub.excel.register 14 Jun 2006 13:15:25 -0000 1.2 --- stub.excel.register 16 Jun 2006 16:15:31 -0000 1.3 *************** *** 3,6 **** --- 3,8 ---- void ohRegisterFunctions(const XLOPER &xDll) { + %(xlregister)s + Excel(xlfRegister, 0, 11, &xDll, TempStrNoSize("\x06""ohPack"), // function code name *************** *** 15,20 **** TempStrNoSize("\x1D""range of cells to be packed ")); // description of parameter 1 - %(xlregister)s - } --- 17,20 ---- Index: stub.excel.unregister =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.unregister,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stub.excel.unregister 14 Jun 2006 13:15:25 -0000 1.2 --- stub.excel.unregister 16 Jun 2006 16:15:31 -0000 1.3 *************** *** 9,12 **** --- 9,14 ---- XLOPER xlRegID; + %(xlunregister)s + Excel(xlfRegister, 0, 11, &xDll, TempStrNoSize("\x06""ohPack"), // function code name *************** *** 14,18 **** TempStrNoSize("\x06""ohPack"), // function display name TempStrNoSize("\x10""inputRange"), // comma-delimited list of parameter names ! TempStrNoSize("\x01""0"), // function type (0 = worksheet function) TempStrNoSize("\x0D""ObjectHandler"), // function category TempStrNoSize("\x00"""), // shortcut text (command macros only) --- 16,20 ---- TempStrNoSize("\x06""ohPack"), // function display name TempStrNoSize("\x10""inputRange"), // comma-delimited list of parameter names ! TempStrNoSize("\x01""0"), // function type (0 = hidden function) TempStrNoSize("\x0D""ObjectHandler"), // function category TempStrNoSize("\x00"""), // shortcut text (command macros only) *************** *** 24,29 **** TempStrNoSize("\x06""ohPack")); // function code name - %(xlunregister)s - } --- 26,29 ---- |
From: Eric E. <eri...@us...> - 2006-06-16 16:26:51
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10484/oh Modified Files: objecthandler.hpp utilities.cpp Log Message: cache the last error message Index: utilities.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** utilities.cpp 9 Jun 2006 18:58:27 -0000 1.6 --- utilities.cpp 16 Jun 2006 16:15:36 -0000 1.7 *************** *** 45,48 **** --- 45,49 ---- // so this function must not throw try { + ObjectHandler::instance().setLastLogMessage(message); Logger::instance().logMessage(message, level); } catch (...) {} Index: objecthandler.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandler.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** objecthandler.hpp 11 Jun 2006 12:38:21 -0000 1.5 --- objecthandler.hpp 16 Jun 2006 16:15:36 -0000 1.6 *************** *** 99,106 **** --- 99,114 ---- virtual const std::vector < std::string > listInstanceNames( const std::string regex = ""); + + void setLastLogMessage(const std::string &message) { + lastLogMessage_ = message; + } + const std::string &lastLogMessage() { + return lastLogMessage_; + } //@} protected: static ObjectHandler *instance_; void checkName(const std::string &instanceName); + std::string lastLogMessage_; }; |
From: Eric E. <eri...@us...> - 2006-06-16 16:26:50
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10484/gensrc/metadata Modified Files: functions.xml Log Message: cache the last error message Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions.xml 15 Jun 2006 08:18:35 -0000 1.5 --- functions.xml 16 Jun 2006 16:15:23 -0000 1.6 *************** *** 393,396 **** --- 393,410 ---- </Procedure> + <Procedure name='ohLastLogMessage'> + <description>return last logged message</description> + <alias>ObjHandler::ObjectHandler::instance().lastLogMessage</alias> + <functionCategory>ObjectHandler</functionCategory> + <ParameterList> + <Parameters/> + </ParameterList> + <ReturnValue> + <type>string</type> + <tensorRank>scalar</tensorRank> + <description>last logged message</description> + </ReturnValue> + </Procedure> + <!--Procedure name='ohPack'> <description>trim error values from bottom/right of matrix/vector</description> |
From: Eric E. <eri...@us...> - 2006-06-16 10:14:16
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16574/oh Modified Files: object.hpp Log Message: support for - objects as input parameters which may default to null pointers - instantiation of a QuantLib::Handle which is not linked to an Observable Index: object.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** object.hpp 11 Jun 2006 12:38:21 -0000 1.6 --- object.hpp 16 Jun 2006 10:14:10 -0000 1.7 *************** *** 32,43 **** #include <iostream> #define OH_GET_OBJECT( NAME, ID, OBJECT_CLASS ) \ ! boost::shared_ptr < OBJECT_CLASS > NAME = \ ! ObjHandler::ObjectHandler::instance().retrieveObject< OBJECT_CLASS >(ID); #define OH_GET_REFERENCE( NAME, ID, OBJECT_CLASS, LIBRARY_CLASS ) \ OH_GET_OBJECT(NAME ## temp, ID, OBJECT_CLASS ) \ ! const boost::shared_ptr < LIBRARY_CLASS > NAME = \ ! NAME ## temp->getLibraryObject < LIBRARY_CLASS >(); namespace ObjHandler { --- 32,53 ---- #include <iostream> + // get a boost shared pointer to a class derived from Object #define OH_GET_OBJECT( NAME, ID, OBJECT_CLASS ) \ ! boost::shared_ptr<OBJECT_CLASS> NAME = \ ! ObjHandler::ObjectHandler::instance().retrieveObject<OBJECT_CLASS>(ID); + // get a boost shared pointer to the client library object referenced by an ObjHandler::Object #define OH_GET_REFERENCE( NAME, ID, OBJECT_CLASS, LIBRARY_CLASS ) \ OH_GET_OBJECT(NAME ## temp, ID, OBJECT_CLASS ) \ ! /*const*/ boost::shared_ptr<LIBRARY_CLASS> NAME = \ ! NAME ## temp->getLibraryObject<LIBRARY_CLASS>(); ! ! // OH_GET_REF_DEFAULT - like OH_GET_REFERENCE but only attempt retrieval if id supplied ! #define OH_GET_REF_DEFAULT( NAME, ID, OBJECT_CLASS, LIBRARY_CLASS ) \ ! /*const*/ boost::shared_ptr<LIBRARY_CLASS> NAME; \ ! if (!ID.empty()) { \ ! OH_GET_OBJECT(NAME ## temp, ID, OBJECT_CLASS ) \ ! NAME = NAME ## temp->getLibraryObject<LIBRARY_CLASS>(); \ ! } namespace ObjHandler { *************** *** 116,120 **** public: template <class LibraryDerivedClass> ! const boost::shared_ptr<LibraryDerivedClass> getLibraryObject() const { boost::shared_ptr<LibraryDerivedClass> ret = boost::dynamic_pointer_cast<LibraryDerivedClass>(libraryObject_); --- 126,130 ---- public: template <class LibraryDerivedClass> ! /*const*/ boost::shared_ptr<LibraryDerivedClass> getLibraryObject() const { boost::shared_ptr<LibraryDerivedClass> ret = boost::dynamic_pointer_cast<LibraryDerivedClass>(libraryObject_); *************** *** 125,129 **** } template <> ! const boost::shared_ptr<LibraryClass> getLibraryObject<LibraryClass>() const { return libraryObject_; } --- 135,139 ---- } template <> ! /*const*/ boost::shared_ptr<LibraryClass> getLibraryObject<LibraryClass>() const { return libraryObject_; } |
From: Eric E. <eri...@us...> - 2006-06-15 08:18:42
|
Update of /cvsroot/objecthandler/ObjectHandler/gensrc/metadata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29951/gensrc/metadata Modified Files: functions.xml Log Message: revised behavior for permanent/nonpermanent objects: - non-permanent objects always deleted from cell on refresh - new parameter "deletePermanent" for function ohCallGC() Index: functions.xml =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/metadata/functions.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions.xml 14 Jun 2006 13:15:25 -0000 1.4 --- functions.xml 15 Jun 2006 08:18:35 -0000 1.5 *************** *** 125,132 **** <ParameterList> <Parameters> ! <Parameter name='permanent' default='false'> <type>bool</type> <tensorRank>scalar</tensorRank> ! <description>permanent</description> </Parameter> </Parameters> --- 125,132 ---- <ParameterList> <Parameters> ! <Parameter name='deletePermanent' default='false'> <type>bool</type> <tensorRank>scalar</tensorRank> ! <description>also delete permanent objects</description> </Parameter> </Parameters> *************** *** 378,382 **** <alias>ObjHandler::ObjectHandlerXL::instance().collectGarbage</alias> <ParameterList> ! <Parameters/> </ParameterList> <ReturnValue> --- 378,388 ---- <alias>ObjHandler::ObjectHandlerXL::instance().collectGarbage</alias> <ParameterList> ! <Parameters> ! <Parameter name='deletePermanent' default='false'> ! <type>bool</type> ! <tensorRank>scalar</tensorRank> ! <description>also delete permanent objects</description> ! </Parameter> ! </Parameters> </ParameterList> <ReturnValue> |
From: Eric E. <eri...@us...> - 2006-06-15 08:18:39
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29951/ohxl Modified Files: callingrange.cpp callingrange.hpp objecthandlerxl.cpp objecthandlerxl.hpp Log Message: revised behavior for permanent/nonpermanent objects: - non-permanent objects always deleted from cell on refresh - new parameter "deletePermanent" for function ohCallGC() Index: objecthandlerxl.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** objecthandlerxl.cpp 11 Jun 2006 12:38:22 -0000 1.6 --- objecthandlerxl.cpp 15 Jun 2006 08:18:36 -0000 1.7 *************** *** 39,47 **** // std::map cannot be exported across DLL boundaries // so instead we use a static variable ! std::map < std::string, boost::shared_ptr < CallingRange > > callingRanges_; ObjectHandlerXL &ObjectHandlerXL::instance() { if (instance_) { ! ObjectHandlerXL *ret = dynamic_cast < ObjectHandlerXL* > (instance_); if (ret) return *ret; --- 39,47 ---- // std::map cannot be exported across DLL boundaries // so instead we use a static variable ! std::map<std::string, boost::shared_ptr<CallingRange> > callingRanges_; ObjectHandlerXL &ObjectHandlerXL::instance() { if (instance_) { ! ObjectHandlerXL *ret = dynamic_cast<ObjectHandlerXL*>(instance_); if (ret) return *ret; *************** *** 52,56 **** } ! boost::shared_ptr < CallingRange > ObjectHandlerXL::getCallingRange() { // XLOPERs which might need freeing in the event of an exception --- 52,56 ---- } ! boost::shared_ptr<CallingRange> ObjectHandlerXL::getCallingRange() { // XLOPERs which might need freeing in the event of an exception *************** *** 60,64 **** try { ! boost::shared_ptr < CallingRange > callingRange; // get name if any --- 60,64 ---- try { ! boost::shared_ptr<CallingRange> callingRange; // get name if any *************** *** 72,76 **** 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()) { --- 72,76 ---- 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()) { *************** *** 102,106 **** void ObjectHandlerXL::resetCaller() { ! boost::shared_ptr < CallingRange > callingRange = getCallingRange(); if (callingRange) callingRange->update(); --- 102,106 ---- void ObjectHandlerXL::resetCaller() { ! boost::shared_ptr<CallingRange> callingRange = getCallingRange(); if (callingRange) callingRange->update(); *************** *** 109,117 **** std::string ObjectHandlerXL::storeObject( const std::string &instanceName, ! const boost::shared_ptr < Object > &object) { ! boost::shared_ptr < CallingRange > callingRange = getCallingRange(); if (!callingRange) { ! callingRange = boost::shared_ptr < CallingRange >(new CallingRange); callingRanges_[callingRange->getKey()] = callingRange; } --- 109,117 ---- std::string ObjectHandlerXL::storeObject( const std::string &instanceName, ! const boost::shared_ptr<Object> &object) { ! boost::shared_ptr<CallingRange> callingRange = getCallingRange(); if (!callingRange) { ! callingRange = boost::shared_ptr<CallingRange>(new CallingRange); callingRanges_[callingRange->getKey()] = callingRange; } *************** *** 133,137 **** } ! boost::shared_ptr < Object > ObjectHandlerXL::retrieveObjectImpl(const std::string &instanceName) const { std::string instanceNameStub; int counterOffset = instanceName.length() - 5; --- 133,137 ---- } ! boost::shared_ptr<Object> ObjectHandlerXL::retrieveObjectImpl(const std::string &instanceName) const { std::string instanceNameStub; int counterOffset = instanceName.length() - 5; *************** *** 155,160 **** } ! void ObjectHandlerXL::collectGarbage() { ! std::map < std::string, boost::shared_ptr < CallingRange > >::const_iterator iter_current, iter_previous; iter_current = callingRanges_.begin(); while (iter_current != callingRanges_.end()) { --- 155,160 ---- } ! 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()) { *************** *** 162,169 **** iter_current++; std::string key = iter_previous->first; ! boost::shared_ptr < CallingRange > callingRange = iter_previous->second; if (!callingRange->isValid()) { ! callingRange->clearAll(); ! callingRanges_.erase(key); } } --- 162,175 ---- 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); ! } } } *************** *** 184,190 **** } 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(); } --- 190,196 ---- } 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(); } Index: objecthandlerxl.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** objecthandlerxl.hpp 11 Jun 2006 12:38:22 -0000 1.6 --- objecthandlerxl.hpp 15 Jun 2006 08:18:36 -0000 1.7 *************** *** 57,61 **** const boost::shared_ptr < Object > &object); virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &instanceName) const; ! virtual void collectGarbage(); virtual void deleteAllObjects(const bool &deletePermanent = false); --- 57,61 ---- const boost::shared_ptr < Object > &object); virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &instanceName) const; ! virtual void collectGarbage(const bool &deletePermanent = false); virtual void deleteAllObjects(const bool &deletePermanent = false); Index: callingrange.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** callingrange.cpp 11 Jun 2006 12:38:22 -0000 1.3 --- callingrange.cpp 15 Jun 2006 08:18:36 -0000 1.4 *************** *** 64,68 **** } ! void CallingRange::clearAnonymous() { std::map<std::string, boost::shared_ptr<Object> >::const_iterator iter_current, iter_previous; iter_current = residentObjects_.begin(); --- 64,68 ---- } ! void CallingRange::clearNonPermanent() { std::map<std::string, boost::shared_ptr<Object> >::const_iterator iter_current, iter_previous; iter_current = residentObjects_.begin(); *************** *** 70,74 **** iter_previous = iter_current; iter_current++; ! if (iter_previous->second->anonymous()) { ObjectHandler::instance().deleteObject(iter_previous->first); residentObjects_.erase(iter_previous->first); --- 70,74 ---- iter_previous = iter_current; iter_current++; ! if (!iter_previous->second->permanent()) { ObjectHandler::instance().deleteObject(iter_previous->first); residentObjects_.erase(iter_previous->first); *************** *** 85,90 **** void CallingRange::registerObject( ! const std::string &instanceName, ! boost::shared_ptr<Object> object) { std::map<std::string, boost::shared_ptr<Object> >::const_iterator i; i = residentObjects_.find(instanceName); --- 85,90 ---- void CallingRange::registerObject( ! const std::string &instanceName, ! boost::shared_ptr<Object> object) { std::map<std::string, boost::shared_ptr<Object> >::const_iterator i; i = residentObjects_.find(instanceName); *************** *** 192,196 **** if (invocationCount_) busy_ = true; ! clearAnonymous(); } } --- 192,196 ---- if (invocationCount_) busy_ = true; ! clearNonPermanent(); } } Index: callingrange.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** callingrange.hpp 11 Jun 2006 12:38:22 -0000 1.3 --- callingrange.hpp 15 Jun 2006 08:18:36 -0000 1.4 *************** *** 38,46 **** void registerObject(const std::string &instanceName, boost::shared_ptr<Object> object); ! void clearAnonymous(); void clearAll(); void update(); std::string updateCount(); friend std::ostream &operator<<(std::ostream&, const CallingRange&); private: static int keyCount_; --- 38,49 ---- void registerObject(const std::string &instanceName, boost::shared_ptr<Object> object); ! void clearNonPermanent(); void clearAll(); void update(); std::string updateCount(); friend std::ostream &operator<<(std::ostream&, const CallingRange&); + bool empty() { + return (residentObjects_.size() == 0); + } private: static int keyCount_; |
From: Eric E. <eri...@us...> - 2006-06-14 15:26:11
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16507/ohxl Modified Files: functioncall.cpp functioncall.hpp Log Message: new XML tag "noXlWizardRecalc" to suppress execution of function when called from Function Wizard Index: functioncall.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functioncall.cpp 11 Jun 2006 12:38:22 -0000 1.6 --- functioncall.cpp 14 Jun 2006 15:25:57 -0000 1.7 *************** *** 2,5 **** --- 2,6 ---- /* Copyright (C) 2006 Eric Ehlers + Copyright (C) 1998, 1999, 2001, 2002 Jérôme Lecomte This file is part of QuantLib, a free-software/open-source library *************** *** 121,123 **** --- 122,163 ---- } + + // code to determine whether we've been called from the Excel function wizard + // taken from xlw by Jérôme Lecomte + + typedef struct _EnumStruct { + bool bFuncWiz; + short hwndXLMain; + } + EnumStruct, FAR * LPEnumStruct; + + bool CALLBACK EnumProc(HWND hwnd, LPEnumStruct pEnum) { + const size_t CLASS_NAME_BUFFER = 50; + // first check the class of the window. Will be szXLDialogClass + // if function wizard dialog is up in Excel + char rgsz[CLASS_NAME_BUFFER]; + GetClassName(hwnd, (LPSTR)rgsz, CLASS_NAME_BUFFER); + if (2 == CompareString(MAKELCID(MAKELANGID(LANG_ENGLISH, + SUBLANG_ENGLISH_US),SORT_DEFAULT), NORM_IGNORECASE, + (LPSTR)rgsz, (lstrlen((LPSTR)rgsz)>lstrlen("bosa_sdm_XL")) + ? lstrlen("bosa_sdm_XL"):-1, "bosa_sdm_XL", -1)) { + if(LOWORD((DWORD) GetParent(hwnd)) == pEnum->hwndXLMain) { + pEnum->bFuncWiz = TRUE; + return false; + } + } + // no luck - continue the enumeration + return true; + } + + bool FunctionCall::IsCalledByFuncWiz() { + XLOPER xHwndMain; + EnumStruct enm; + Excel(xlGetHwnd, &xHwndMain, 0); + enm.bFuncWiz = false; + enm.hwndXLMain = xHwndMain.val.w; + EnumWindows((WNDENUMPROC) EnumProc, (LPARAM) ((LPEnumStruct) &enm)); + return enm.bFuncWiz; + } + } Index: functioncall.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functioncall.hpp 11 Jun 2006 12:38:22 -0000 1.4 --- functioncall.hpp 14 Jun 2006 15:25:57 -0000 1.5 *************** *** 2,5 **** --- 2,6 ---- /* Copyright (C) 2006 Eric Ehlers + Copyright (C) 1998, 1999, 2001, 2002 Jérôme Lecomte This file is part of QuantLib, a free-software/open-source library *************** *** 50,53 **** --- 51,55 ---- //bool outerFunction(); CallerDimensions getCallerDimensions(); + bool IsCalledByFuncWiz(); private: static FunctionCall *instance_; |