summaryrefslogtreecommitdiffstats
path: root/cpp/sca/samples/store/catalog.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-09-26 21:31:26 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-09-26 21:31:26 +0000
commitc39d4c6d143697ee8982df0833499a8de934dd9a (patch)
treecbc758f3921459c0f11a96f24f5ef251db0bf367 /cpp/sca/samples/store/catalog.hpp
parent8eb242943144ad5ea57c7471e4a3e199bf5687d5 (diff)
Refactored the value class. Cleaned up usage of namespaces to remove side effects from includes. Added a few util functions to help work with threads. Added synchronizations to make pointers thread safe. Adjusted store sample to refactoring.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@819220 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--cpp/sca/samples/store/catalog.hpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/cpp/sca/samples/store/catalog.hpp b/cpp/sca/samples/store/catalog.hpp
index 6578dd71ed..da63ab593a 100644
--- a/cpp/sca/samples/store/catalog.hpp
+++ b/cpp/sca/samples/store/catalog.hpp
@@ -22,13 +22,11 @@
#ifndef store_catalog_hpp
#define store_catalog_hpp
-#include <string.h>
+#include <string>
#include "tuscany/list.hpp"
#include "currency.hpp"
#include "item.hpp"
-using namespace tuscany;
-
namespace store
{
@@ -37,13 +35,13 @@ public:
virtual const double convert(const double price) const = 0;
- virtual const list<Item> get() const = 0;
+ virtual const tuscany::list<Item> get() const = 0;
};
class CatalogImpl : public Catalog {
public:
- const string currencyCode;
+ const std::string currencyCode;
const CurrencyConverter& currencyConverter;
CatalogImpl(const CurrencyConverter& currencyConverter) :
@@ -54,9 +52,9 @@ public:
return currencyConverter.convert("USD", currencyCode, price);
}
- virtual const list<Item> get() const {
- const string currencySymbol = currencyConverter.getSymbol(currencyCode);
- return makeList(
+ virtual const tuscany::list<Item> get() const {
+ const std::string currencySymbol = currencyConverter.getSymbol(currencyCode);
+ return tuscany::makeList(
Item("Apple", currencyCode, currencySymbol, convert(2.99)),
Item("Orange", currencyCode, currencySymbol, convert(3.55)),
Item("Pear", currencyCode, currencySymbol, convert(1.55)));