summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/kernel
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-16 06:15:24 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-16 06:15:24 +0000
commit16f96409b9ad2a1451c88b4e0074b57686f02269 (patch)
tree7c5c2e1d5276975aa26c9056a008cd302306a998 /sca-cpp/trunk/kernel
parente351502e55d7de56a2d14ad33923f796a73d118f (diff)
Test Postgresql hot standby + replication and integrated Postgresql database in store-cluster sample. Add a front cache component which can be used to wire a cache component and a database component.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@985799 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/kernel')
-rw-r--r--sca-cpp/trunk/kernel/list.hpp34
-rw-r--r--sca-cpp/trunk/kernel/value.hpp12
2 files changed, 43 insertions, 3 deletions
diff --git a/sca-cpp/trunk/kernel/list.hpp b/sca-cpp/trunk/kernel/list.hpp
index 84eba6d82f..db2f457317 100644
--- a/sca-cpp/trunk/kernel/list.hpp
+++ b/sca-cpp/trunk/kernel/list.hpp
@@ -313,27 +313,55 @@ template<typename T> const list<T> cdr(const list<T>& p) {
}
/**
- * Returns the car of the cdr of a list.
+ * Returns the car of the cdr (the 2nd element) of a list.
*/
template<typename T> const T cadr(const list<T>& p) {
return car(cdr(p));
}
/**
- * Returns the car of the cdr of the cdr of a list.
+ * Returns the 3rd element of a list.
*/
template<typename T> const T caddr(const list<T>& p) {
return car(cdr(cdr(p)));
}
/**
- * Returns the car of the cdr of the cdr of the cdr of a list.
+ * Returns the 4th element of a list.
*/
template<typename T> const T cadddr(const list<T>& p) {
return car(cdr(cdr(cdr(p))));
}
/**
+ * Returns the 5th element of a list.
+ */
+template<typename T> const T caddddr(const list<T>& p) {
+ return car(cdr(cdr(cdr(cdr(p)))));
+}
+
+/**
+ * Returns the 6th element of a list.
+ */
+template<typename T> const T cadddddr(const list<T>& p) {
+ return car(cdr(cdr(cdr(cdr(cdr(p))))));
+}
+
+/**
+ * Returns the 7th element of a list.
+ */
+template<typename T> const T caddddddr(const list<T>& p) {
+ return car(cdr(cdr(cdr(cdr(cdr(cdr(p)))))));
+}
+
+/**
+ * Returns the 8th element of a list.
+ */
+template<typename T> const T cadddddddr(const list<T>& p) {
+ return car(cdr(cdr(cdr(cdr(cdr(cdr(cdr(p))))))));
+}
+
+/**
* Returns the cdr of a cdr of a list.
*/
template<typename T> const list<T> cddr(const list<T>& p) {
diff --git a/sca-cpp/trunk/kernel/value.hpp b/sca-cpp/trunk/kernel/value.hpp
index 87d80a3e2a..24688648d2 100644
--- a/sca-cpp/trunk/kernel/value.hpp
+++ b/sca-cpp/trunk/kernel/value.hpp
@@ -27,6 +27,7 @@
*/
#include <stdlib.h>
+#include <apr_uuid.h>
#include "string.hpp"
#include "sstream.hpp"
#include "gc.hpp"
@@ -589,5 +590,16 @@ const value path(const list<value>& p) {
return string("/") + car(p) + path(cdr(p));
}
+/**
+ * Make a uuid value.
+ */
+const value mkuuid() {
+ apr_uuid_t id;
+ apr_uuid_get(&id);
+ char buf[APR_UUID_FORMATTED_LENGTH];
+ apr_uuid_format(buf, &id);
+ return value(string(buf, APR_UUID_FORMATTED_LENGTH));
+}
+
}
#endif /* tuscany_value_hpp */