Update of /cvsroot/objecthandler/ObjectHandler/Examples/xl
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14253/Examples/xl
Modified Files:
addindynamic1.cpp addindynamic2.cpp addinstatic.cpp
Log Message:
autogenerate ObjectHandler code
Index: addindynamic1.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/Examples/xl/addindynamic1.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** addindynamic1.cpp 1 Jun 2006 16:56:25 -0000 1.5
--- addindynamic1.cpp 6 Jun 2006 09:08:26 -0000 1.6
***************
*** 20,23 ****
--- 20,24 ----
#include <xlsdk/xlsdk.hpp>
#include <ohxl/conversions.hpp>
+ #include <ohxl/functioncall.hpp>
/* Use BOOST_MSVC instead of _MSC_VER since some other vendors (Metrowerks,
for example) also #define _MSC_VER
***************
*** 70,74 ****
--- 71,78 ----
long *accountNumber,
char *accountType) {
+ boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
+ functionCall = boost::shared_ptr < ObjHandler::FunctionCall >
+ ( new ObjHandler::FunctionCall("addin1CreateAccount") );
ObjHandler::obj_ptr objectPointer(new AccountObject(
*accountNumber,
***************
*** 82,86 ****
return ret;
} catch (const std::exception &e) {
! ObjHandler::logMessage(std::string("Error: addin1CreateAccount: ") + e.what(), 2);
return 0;
}
--- 86,94 ----
return ret;
} catch (const std::exception &e) {
! std::ostringstream err;
! err << "Error: addin1CreateAccount - ";
! if (functionCall) err << functionCall->getAddressString() << " - ";
! err << e.what();
! ObjHandler::logMessage(err.str(), 2);
return 0;
}
***************
*** 88,92 ****
--- 96,103 ----
DLLEXPORT short int *addin1SetBalance(char *instanceName, long *balance) {
+ boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
+ functionCall = boost::shared_ptr < ObjHandler::FunctionCall >
+ ( new ObjHandler::FunctionCall("addin1SetBalance") );
OH_GET_OBJECT(accountObject, instanceName, AccountObject)
accountObject->setBalance(*balance);
***************
*** 94,98 ****
return &ret;
} catch (const std::exception &e) {
! ObjHandler::logMessage(std::string("Error: addin1SetBalance: ") + e.what(), 2);
return 0;
}
--- 105,113 ----
return &ret;
} catch (const std::exception &e) {
! std::ostringstream err;
! err << "Error: addin1SetBalance - ";
! if (functionCall) err << functionCall->getAddressString() << " - ";
! err << e.what();
! ObjHandler::logMessage(err.str(), 2);
return 0;
}
Index: addinstatic.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/Examples/xl/addinstatic.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** addinstatic.cpp 1 Jun 2006 14:06:54 -0000 1.5
--- addinstatic.cpp 6 Jun 2006 09:08:26 -0000 1.6
***************
*** 21,24 ****
--- 21,25 ----
#include <ohxl/register.hpp>
#include <ohxl/export.hpp>
+ #include <ohxl/functioncall.hpp>
#include <oh/objhandler.hpp>
/* Use BOOST_MSVC instead of _MSC_VER since some other vendors (Metrowerks,
***************
*** 81,85 ****
--- 82,89 ----
long *accountNumber,
char *accountType) {
+ boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
+ functionCall = boost::shared_ptr < ObjHandler::FunctionCall >
+ ( new ObjHandler::FunctionCall("createAccount") );
ObjHandler::obj_ptr objectPointer(new AccountObject(
*accountNumber,
***************
*** 93,97 ****
return ret;
} catch (const std::exception &e) {
! ObjHandler::logMessage(std::string("Error: createAccount: ") + e.what(), 2);
return 0;
}
--- 97,105 ----
return ret;
} catch (const std::exception &e) {
! std::ostringstream err;
! err << "Error: createAccount - ";
! if (functionCall) err << functionCall->getAddressString() << " - ";
! err << e.what();
! ObjHandler::logMessage(err.str(), 2);
return 0;
}
***************
*** 99,103 ****
--- 107,114 ----
DLLEXPORT short int *setBalance(char *instanceName, long *balance) {
+ boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
+ functionCall = boost::shared_ptr < ObjHandler::FunctionCall >
+ ( new ObjHandler::FunctionCall("createAccount") );
OH_GET_OBJECT(accountObject, instanceName, AccountObject)
accountObject->setBalance(*balance);
***************
*** 105,109 ****
return &ret;
} catch (const std::exception &e) {
! ObjHandler::logMessage(std::string("Error: setBalance: ") + e.what(), 2);
return 0;
}
--- 116,124 ----
return &ret;
} catch (const std::exception &e) {
! std::ostringstream err;
! err << "Error: setBalance - ";
! if (functionCall) err << functionCall->getAddressString() << " - ";
! err << e.what();
! ObjHandler::logMessage(err.str(), 2);
return 0;
}
***************
*** 111,115 ****
--- 126,133 ----
DLLEXPORT long *getBalance(char *instanceName, OPER *trigger) {
+ boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
+ functionCall = boost::shared_ptr < ObjHandler::FunctionCall >
+ ( new ObjHandler::FunctionCall("createAccount") );
OH_GET_OBJECT(accountObject, instanceName, AccountObject)
static long ret;
***************
*** 117,121 ****
return &ret;
} catch (const std::exception &e) {
! ObjHandler::logMessage(std::string("Error: getBalance: ") + e.what(), 2);
return 0;
}
--- 135,143 ----
return &ret;
} catch (const std::exception &e) {
! std::ostringstream err;
! err << "Error: getBalance - ";
! if (functionCall) err << functionCall->getAddressString() << " - ";
! err << e.what();
! ObjHandler::logMessage(err.str(), 2);
return 0;
}
Index: addindynamic2.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/Examples/xl/addindynamic2.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** addindynamic2.cpp 1 Jun 2006 16:56:25 -0000 1.4
--- addindynamic2.cpp 6 Jun 2006 09:08:26 -0000 1.5
***************
*** 20,23 ****
--- 20,24 ----
#include <xlsdk/xlsdk.hpp>
#include <ohxl/conversions.hpp>
+ #include <ohxl/functioncall.hpp>
/* Use BOOST_MSVC instead of _MSC_VER since some other vendors (Metrowerks,
for example) also #define _MSC_VER
***************
*** 59,63 ****
--- 60,67 ----
DLLEXPORT long *addin2GetBalance(char *instanceName, OPER *trigger) {
+ boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
+ functionCall = boost::shared_ptr < ObjHandler::FunctionCall >
+ ( new ObjHandler::FunctionCall("addin2GetBalance") );
OH_GET_OBJECT(accountObject, instanceName, AccountObject)
static long ret;
***************
*** 65,69 ****
return &ret;
} catch (const std::exception &e) {
! ObjHandler::logMessage(std::string("Error: getBalance: ") + e.what(), 2);
return 0;
}
--- 69,77 ----
return &ret;
} catch (const std::exception &e) {
! std::ostringstream err;
! err << "Error: addin2GetBalance - ";
! if (functionCall) err << functionCall->getAddressString() << " - ";
! err << e.what();
! ObjHandler::logMessage(err.str(), 2);
return 0;
}
|