00001 // Copyright (c) 2009 STFC 00002 // 00003 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00005 #ifndef SAGA_PACKAGES_SD_SERVICE_DESCRIPTION_HPP 00006 00007 #define SAGA_PACKAGES_SD_SERVICE_DESCRIPTION_HPP 00008 00009 #include <saga/saga/util.hpp> 00010 #include <saga/saga/base.hpp> 00011 #include <saga/saga/types.hpp> 00012 #include <saga/saga/session.hpp> 00013 #include <saga/saga/call.hpp> 00014 #include <saga/saga/detail/attribute.hpp> 00015 #include <saga/saga/exception.hpp> 00016 #include <saga/saga/url.hpp> 00017 00018 #include <saga/saga/packages/sd/config.hpp> 00019 00020 #include <saga/saga/packages/sd/service_data.hpp> 00021 00022 namespace saga 00023 { 00024 namespace impl 00025 { 00026 class info_provider; 00027 class discoverer_cpi_impl; 00028 } 00029 } 00030 00031 // suppress warnings about dependent classes not being exported from the dll 00032 #if defined(BOOST_MSVC) 00033 #pragma warning(push) 00034 #pragma warning(disable: 4251 4231 4275 4660) 00035 #endif 00036 00037 namespace saga 00038 { 00039 namespace sd { 00040 namespace attributes 00041 { 00043 // attribute names for service_description 00044 00045 char const* const service_description_url = "Url"; 00046 char const* const service_description_type = "Type"; 00047 char const* const service_description_uid = "Uid"; 00048 char const* const service_description_site = "Site"; 00049 char const* const service_description_name = "Name"; 00050 char const* const service_description_relatedservices = "RelatedServices"; 00051 char const* const service_description_vo = "VO"; 00052 char const* const service_description_implementation_version = 00053 "ImplementationVersion"; 00054 char const* const service_description_interface_version = 00055 "InterfaceVersion"; 00056 char const* const service_description_capability = "Capabilities"; 00057 char const* const service_description_information_provider_url = 00058 "InformationServiceUrl"; 00059 char const* const service_description_implementor = "Implementor"; 00060 00061 } 00062 00064 // service description 00095 class SAGA_SD_PACKAGE_EXPORT service_description 00096 : public saga::object, 00097 public saga::detail::attribute<service_description> 00098 { 00099 protected: 00101 00102 TR1::shared_ptr <saga::impl::service_description> get_impl_sp(void) const; 00103 saga::impl::service_description* get_impl (void) const; 00105 00106 friend struct saga::detail::attribute<service_description>; 00107 friend class saga::impl::service_description; 00108 friend class saga::impl::discoverer_cpi_impl; 00109 friend class saga::impl::info_provider; 00110 00111 explicit service_description(saga::impl::service_description *impl, saga::url loc); 00112 void set_session(TR1::shared_ptr<saga::session> sess); 00113 void set_data(std::string data_key, std::string data_value); 00114 00115 using saga::detail::attribute<service_description>::set_attribute; 00116 using saga::detail::attribute<service_description>::set_vector_attribute; 00117 00118 protected: 00122 service_description (saga::url loc); 00123 explicit service_description (saga::object const& o); 00124 00125 public: 00126 using saga::detail::attribute<service_description>::get_attribute; 00127 using saga::detail::attribute<service_description>::get_vector_attribute; 00128 00132 ~service_description (void) SAGA_THROW_SPEC(throw()); 00133 00134 // default operator=() and copy ctor are ok 00135 service_description &operator= (saga::object const& o) 00136 SAGA_THROW_SPEC(throw()); 00137 00138 // special getters 00146 std::string get_url() SAGA_THROW_SPEC(throw()); 00147 00171 std::vector<saga::sd::service_description> get_related_services() 00172 SAGA_THROW_SPEC(throw(saga::authorization_failed, 00173 saga::authentication_failed, 00174 saga::timeout, 00175 saga::no_success)); 00176 00184 saga::sd::service_data &get_data() SAGA_THROW_SPEC(throw()); 00185 }; // service_description 00186 } // namespace sd 00187 } // namespace saga 00189 00190 // re-enable warnings about dependent classes not being exported from the dll 00191 #if defined(BOOST_MSVC) 00192 #pragma warning(pop) 00193 #endif 00194 00195 #endif // !defined(SAGA_PACKAGES_SD_SERVICE_DESCRIPTION_HPP) 00196