diff options
Diffstat (limited to 'tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model')
8 files changed, 0 insertions, 705 deletions
diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp deleted file mode 100644 index 9e5a227f01..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/model/CPPImplementation.h" -#include "tuscany/sca/cpp/model/CPPServiceBinding.h" -#include "tuscany/sca/cpp/model/CPPReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - - namespace cpp - { - - // Constructor - CPPImplementation::CPPImplementation(Composite* composite, const string& library, const string& header, - const string&headerPath, const string& headerStub, const string& className, Scope scope) - : ComponentType(composite, headerPath + headerStub), - library(library), header(header), headerPath(headerPath), - headerStub(headerStub), className(className), scope(scope) - { - } - - CPPImplementation::~CPPImplementation() - { - } - - void CPPImplementation::initializeComponent(Component* component) - { - ComponentType::initializeComponent(component); - - // Create CPP bindings for all the services - const Component::SERVICE_MAP& services = component->getServices(); - Component::SERVICE_MAP::const_iterator iter = services.begin(); - for (unsigned int i=0; i< services.size(); i++) - { - Service *service = iter->second; - CPPServiceBinding* binding = new CPPServiceBinding(service); - service->setBinding(binding); - iter++; - } - - // Create CPP bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (unsigned int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - CPPReferenceBinding* binding = new CPPReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h deleted file mode 100644 index 11f487361d..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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$ */ - -#ifndef tuscany_sca_cpp_model_cppimplementation_h -#define tuscany_sca_cpp_model_cppimplementation_h - -#include <map> -#include <string> - -#include "tuscany/sca/model/ComponentType.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Holds information about an SCA implementation written in C++ - */ - class CPPImplementation : public tuscany::sca::model::ComponentType - { - - public: - /** - * Scope of the component implementation. - */ - enum Scope - { - COMPOSITE, - STATELESS - }; - - /** - * Constructor. - * @param dllName Name of the shared library. - * @param header Name of the header file that contains the class declaring the - * implementation class. - * @param className Name of the class in the header file (could be a blank string - * if this is not specified). - */ - CPPImplementation(tuscany::sca::model::Composite* composite, - const std::string& library, const std::string& header, const std::string&headerPath, - const std::string& headerStub, const std::string& className, Scope scope); - - /** - * Destructor - */ - virtual ~CPPImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(tuscany::sca::model::Component* component); - - /** - * Returns the name of the shared library. - * @return The name of the shared library. - */ - const std::string& getLibrary() const { return library; } - - /** - * Get the name of the header file. - * @return Name of the header file. - */ - const std::string& getHeader() const { return header; } - - /** - * Get the header file name without the extension. - * @return The name of the header file without any extension. - */ - const std::string& getHeaderStub() const { return headerStub; } - - /** - * Get the header path. - * @return The pathe element of the header. - */ - const std::string& getHeaderPath() const { return headerPath; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const std::string& getClass() const { return className; } - - /** - * Returns the implementation scope - */ - Scope getScope() { return scope; } - - private: - - /** - * Name of the shared library. - */ - std::string library; - - /** - * Name of the header file describing the interface. - */ - std::string header; - - /** - * Name of the header file without the extension. - */ - std::string headerStub; - - /** - * Path element of the header. - */ - std::string headerPath; - - /** - * Name of the class in the header file declaring the implementation. - * May be an empty string if not set in the SCDL file. - */ - std::string className; - - /** - * Scope of the implementation - */ - Scope scope; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppimplementation_h diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp deleted file mode 100644 index 2322d1bdf5..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/cpp/model/CPPInterface.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - const string CPPInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#CPPInterface"); - - // Constructor - CPPInterface::CPPInterface( - const string& header, - const string& className, - bool remotable, - bool conversational) - : Interface(remotable, conversational), header(header), className(className) - { - string::size_type dot = header.rfind(".h"); // this will also find .hpp - if (dot != string::npos) - { - headerStub = header.substr(0, dot); - } - else - { - headerStub = header; - } - - } - - CPPInterface::~CPPInterface() - { - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h deleted file mode 100644 index fdbf314d3d..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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$ */ - -#ifndef tuscany_sca_cpp_model_cppinterface_h -#define tuscany_sca_cpp_model_cppinterface_h - -#include <string> - -#include "tuscany/sca/model/Interface.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Holds information about an interface described using a C++ - * header file. - */ - class CPPInterface : public tuscany::sca::model::Interface - { - - public: - /** - * Constuctor. - * @param header Name of the header file containing the class that - * describes the interface. - * @param className Name of the class in the header file that - * describes the interface. - * @param scope The scope of the interface (stateless or composite). - * @param remotable True if the interface is remotable. - */ - CPPInterface( - const std::string& header, - const std::string& className, - bool remotable, - bool conversational); - - /** - * Destructor. - */ - virtual ~CPPInterface(); - - /** - * Get the name of the header file. - * @return The name of the header file containing the definition of the - * interface. - */ - const std::string& getHeader() { return header; } - - /** - * Return the name of the header file without the extension. - * @return Header file name without any extension. - */ - const std::string& getHeaderStub() { return headerStub; } - - /** - * Get the name of the class. - * @return The name of the class defining the interface. - */ - const std::string& getClass() { return className; } - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - virtual const std::string& getInterfaceTypeQName() { return typeQName; }; - - private: - - /** - * Name of the header file containing the definition of the interface. - */ - std::string header; - - /** - * Name of the header file without the extension. - */ - std::string headerStub; - - /** - * Name of the class in the header file. - */ - std::string className; - - /** - * The QName of the schema type for this interface type. - */ - static const std::string typeQName; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppinterface_h - diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp deleted file mode 100644 index ba20a1d5a0..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/model/CPPReferenceBinding.h" -#include "tuscany/sca/cpp/CPPServiceProxy.h" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // Constructor - CPPReferenceBinding::CPPReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL), targetServiceBinding(NULL) - { - } - - // Destructor - CPPReferenceBinding::~CPPReferenceBinding() - { - } - - ServiceProxy* CPPReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void CPPReferenceBinding::configure(ServiceBinding* binding) - { - targetServiceBinding = binding; - - serviceProxy = new CPPServiceProxy(getReference()); - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h deleted file mode 100644 index 398417011f..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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$ */ - -#ifndef tuscany_sca_cpp_model_cppreferencebinding_h -#define tuscany_sca_cpp_model_cppreferencebinding_h - -#include <string> - -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Information about a CPP service binding for service or a reference. - */ - class CPPReferenceBinding : public tuscany::sca::model::ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - CPPReferenceBinding(tuscany::sca::model::Reference* reference); - - /** - * Destructor. - */ - virtual ~CPPReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CPPImplementationBinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); - - /** - * Returns the target service binding. - */ - tuscany::sca::model::ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - tuscany::sca::model::ServiceBinding* targetServiceBinding; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppreferencebinding_h diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp deleted file mode 100644 index 45afea8375..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/model/CPPServiceBinding.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // Constructor - CPPServiceBinding::CPPServiceBinding(Service* service) - : ServiceBinding(service, "") - { - serviceWrapper = CPPServiceWrapper::getServiceWrapper(service); - } - - // Destructor - CPPServiceBinding::~CPPServiceBinding() - { - } - - ServiceWrapper* CPPServiceBinding::getServiceWrapper() - { - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h b/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h deleted file mode 100644 index 13b88a84dd..0000000000 --- a/tags/native-sca-1.0.incubating-M3/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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$ */ - -#ifndef tuscany_sca_cpp_model_cppservicebinding_h -#define tuscany_sca_cpp_model_cppservicebinding_h - -#include <string> - -#include "tuscany/sca/model/ServiceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Information about a CPP service binding for service or a reference. - */ - class CPPServiceBinding : public tuscany::sca::model::ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - CPPServiceBinding(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~CPPServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CPPImplementationBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - private: - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppservicebinding_h |