tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajbor...@apache.org
Subject svn commit: r452385 - /incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/
Date Tue, 03 Oct 2006 09:59:56 GMT
Author: ajborley
Date: Tue Oct  3 02:59:55 2006
New Revision: 452385

URL: http://svn.apache.org/viewvc?view=rev&rev=452385
Log:
Convert use of char* to string to fix bug introduced with r449433

Modified:
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataService.h
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.cpp
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.h
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountService.h
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.cpp
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.h
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteService.h
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.cpp
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.h
    incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteWebService.h

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataService.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataService.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataService.h Tue Oct
 3 02:59:55 2006
@@ -17,6 +17,9 @@
 
 #include "commonj/sdo/SDO.h"
 
+#include <string>
+using std::string;
+
 namespace services
 {
     namespace accountdata
@@ -34,14 +37,14 @@
             // float balance
     
             virtual commonj::sdo::DataObjectPtr /* CheckingAccount*/ getCheckingAccount(
-                const char *id) = 0;
+                const string id) = 0;
     
             // SavingsAccount is a data object containing
             // string accountNumber
             // float balance
     
             virtual commonj::sdo::DataObjectPtr /* SavingsAccount */ getSavingsAccount(
-                const char *id) = 0;
+                const string id) = 0;
     
             // StockAccount is a data object containing
             // string accountNumber
@@ -49,7 +52,7 @@
             // int quantity
     
             virtual commonj::sdo::DataObjectPtr /* StockAccount */ getStockAccount (
-                const char* id) = 0;
+                const string id) = 0;
     
         };
 

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.cpp?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.cpp Tue
Oct  3 02:59:55 2006
@@ -37,7 +37,7 @@
     {
 
         DataObjectPtr /* CheckingAccount*/
-            AccountDataServiceImpl::getCheckingAccount(const char *id) 
+            AccountDataServiceImpl::getCheckingAccount(const string id) 
         {
             try {
 
@@ -46,8 +46,8 @@
                 DataObjectPtr newaccount = 
                     factory->create("http://www.bigbank.com/AccountService","CheckingAccount");
 
-                char* name = new char[strlen(id) + 10];
-                strcpy(name,id);
+                char* name = new char[id.size() + 10];
+                strcpy(name,id.c_str());
                 strcat(name,"_CHA12345");
 
                 newaccount->setCString("accountNumber",name);
@@ -68,7 +68,7 @@
 
 
         DataObjectPtr /* SavingsAccount */
-            AccountDataServiceImpl::getSavingsAccount(const char *id) 
+            AccountDataServiceImpl::getSavingsAccount(const string id) 
         {
             try {
 
@@ -77,8 +77,8 @@
                 DataObjectPtr newaccount = 
                     factory->create("http://www.bigbank.com/AccountService","SavingsAccount");
 
-                char* name = new char[strlen(id) + 10];
-                strcpy(name,id);
+                char* name = new char[id.size() + 10];
+                strcpy(name,id.c_str());
                 strcat(name,"_SAA12345");
 
                 newaccount->setCString("accountNumber",name);
@@ -98,7 +98,7 @@
 
 
         DataObjectPtr /* StockAccount */
-            AccountDataServiceImpl::getStockAccount (const char* id)
+            AccountDataServiceImpl::getStockAccount (const string id)
         {
             try {
 
@@ -107,8 +107,8 @@
                 DataObjectPtr newaccount = 
                     factory->create("http://www.bigbank.com/AccountService","StockAccount");
 
-                char* name = new char[strlen(id) + 10];
-                strcpy(name,id);
+                char* name = new char[id.size() + 10];
+                strcpy(name,id.c_str());
                 strcat(name,"_STA12345");
 
                 newaccount->setCString("accountNumber",name);

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountDataServiceImpl.h Tue
Oct  3 02:59:55 2006
@@ -34,14 +34,14 @@
             // float balance
 
             virtual DataObjectPtr /* CheckingAccount*/ getCheckingAccount(
-                const char *id);
+                const string id);
 
             // SavingsAccount is a data object containing
             // string accountNumber
             // float balance
 
             virtual DataObjectPtr /* SavingsAccount */ getSavingsAccount(
-                const char *id);
+                const string id);
 
             // StockAccount is a data object containing
             // string accountNumber
@@ -49,7 +49,7 @@
             // int quantity
 
             virtual DataObjectPtr /* StockAccount */ getStockAccount (
-                const char* id);
+                const string id);
 
         };
         

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountService.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountService.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountService.h Tue Oct  3
02:59:55 2006
@@ -17,6 +17,9 @@
 
 #include "commonj/sdo/SDO.h"
 
+#include <string>
+using std::string;
+
 namespace services
 {
     namespace account
@@ -37,7 +40,7 @@
             // float balance.
 
              virtual commonj::sdo::DataObjectPtr /*AccountReport*/
-                 getAccountReport(const char* customerID) = 0;
+                 getAccountReport(const string customerID) = 0;
     
         };
 

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.cpp?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.cpp Tue Oct
 3 02:59:55 2006
@@ -38,7 +38,7 @@
     {
 
         DataObjectPtr /*AccountReport**/ 
-            AccountServiceImpl::getAccountReport(const char* customerID)
+            AccountServiceImpl::getAccountReport(const string customerID)
         {
                 ComponentContext theContext = ComponentContext::getCurrent();
     

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/AccountServiceImpl.h Tue Oct
 3 02:59:55 2006
@@ -31,7 +31,7 @@
         public:
         
             virtual DataObjectPtr /*AccountReport*/
-                getAccountReport(const char* customerID);
+                getAccountReport(const string customerID);
         
         private:
         

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteService.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteService.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteService.h Tue Oct
 3 02:59:55 2006
@@ -14,6 +14,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
+#include <string>
+using std::string;
 
 namespace services
 {
@@ -26,7 +28,7 @@
         {
 		public:
 
-			virtual float getQuote(const char* symbol) = 0;
+			virtual float getQuote(const string symbol) = 0;
 
 		};
 

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.cpp?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.cpp Tue
Oct  3 02:59:55 2006
@@ -36,7 +36,7 @@
 
         // Map the format returned by the StockQuote Web service to
         // the format expected in the BigBank application
-        float StockQuoteServiceImpl::getQuote(const char *symbol)
+        float StockQuoteServiceImpl::getQuote(const string symbol)
         {
             ComponentContext myContext = ComponentContext::getCurrent();
 
@@ -45,7 +45,7 @@
                 (StockQuoteWebService*)myContext.getService("webService");
 
             // Invoke the service
-            const char* result = webService->GetQuote(symbol);
+            const string result = webService->GetQuote(symbol);
 
             float stockPrice = 0.0f;
 

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteServiceImpl.h Tue
Oct  3 02:59:55 2006
@@ -29,7 +29,7 @@
         {
 	    public:
         
-		  virtual float getQuote(const char* symbol);
+		  virtual float getQuote(const string symbol);
     	};
         
     } // End stockquote	 

Modified: incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteWebService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteWebService.h?view=diff&rev=452385&r1=452384&r2=452385
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteWebService.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/bigbank.account/StockQuoteWebService.h Tue Oct
 3 02:59:55 2006
@@ -14,6 +14,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
+#include <string>
+using std::string;
 
 namespace services
 {
@@ -30,7 +32,7 @@
         {
 		public:
 		
-        	virtual const char* GetQuote(const char* symbol) = 0;
+        	virtual const string GetQuote(const string symbol) = 0;
 
 		};
         



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message