diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-01 07:57:32 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-01 07:57:32 +0000 |
commit | 80f6823cacf6f018cbe0d86198afa23be71f991f (patch) | |
tree | 64181f34f79e158e945c8e3aba7da2d3514f0bc7 /sca-cpp/trunk/components/chat/chat-sender.cpp | |
parent | 8c5172b8ab407b79db53ce46271d72d8a3f9c19f (diff) |
Added build configuration and dependencies for chat and queue components.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@905203 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/components/chat/chat-sender.cpp')
-rw-r--r-- | sca-cpp/trunk/components/chat/chat-sender.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/sca-cpp/trunk/components/chat/chat-sender.cpp b/sca-cpp/trunk/components/chat/chat-sender.cpp new file mode 100644 index 0000000000..dfcae6796a --- /dev/null +++ b/sca-cpp/trunk/components/chat/chat-sender.cpp @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +/** + * XMPP chat sender component implementation. + */ + +#include "string.hpp" +#include "function.hpp" +#include "list.hpp" +#include "value.hpp" +#include "monad.hpp" +#include "xmpp.hpp" + +namespace tuscany { +namespace chat { + +/** + * Post an item to an XMPP JID. + */ +const failable<value> post(unused const list<value>& params) { + + //TODO post the item + + return value(true); +} + +} +} + +extern "C" { + +const tuscany::value apply(const tuscany::list<tuscany::value>& params) { + const tuscany::value func(car(params)); + if (func == "post") + return tuscany::chat::post(cdr(params)); + return tuscany::mkfailure<tuscany::value>(tuscany::string("Function not supported: ") + func); +} + +} |