SAGA C++ API 1.6
service_data.cpp
Go to the documentation of this file.
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 #define SAGA_NO_IMPORT_ATTRIBUTE
00006 
00007 #include <iostream>
00008 
00009 #include <saga/saga/sd.hpp>
00010 #include <saga/impl/sd.hpp>
00011 
00012 #include <saga/saga/detail/attribute_impl.hpp>
00013 
00014 using namespace std;
00015 
00016 namespace saga
00017 {
00018   namespace sd {
00019    service_data::service_data ()
00020     : object (new saga::impl::service_data())
00021   {
00022       //initialize attribute implementation
00023       this->init(true, true); // arg1: extensible (to allow arbitrary key names) and 
00024                               // arg2: cache only implementation
00025       //std::cout << "DC1: Uid = " << this->get_id().string() << " Type = " << this->get_type() << std::endl;
00026   }
00027 
00028   service_data::service_data(saga::impl::service_data *impl)
00029     : object (impl)
00030   {
00031       //std::cout << "DC2: Uid = " << this->get_id().string() << " Type = " << this->get_type() << std::endl;
00032   }
00033 
00034   service_data::~service_data (void)
00035   {
00036      //std::cout << this->get_id().string() << " Destructor" << std::endl;
00037   }
00038 
00040   service_data::service_data (saga::object const& o)
00041     : saga::object (o)
00042   {
00043       if (this->get_type() != saga::object::ServiceData)
00044       {
00045           SAGA_THROW("Bad type conversion.", saga::BadParameter);
00046       }
00047   }
00048 
00049   service_data &service_data::operator= (saga::object const& o)
00050   {
00051       return saga::object::operator=(o), *this;
00052   }
00053 
00054  } // namespace sd
00055 
00056   namespace detail
00057   {
00059     //  implement the attribute functions (we need to explicitly specialize
00060     //  the template because the functions are not implemented inline)
00061     template struct SAGA_SD_PACKAGE_EXPORT_REPEAT attribute<sd::service_data>;
00062 
00063     template struct SAGA_SD_PACKAGE_EXPORT attribute_priv<sd::service_data, task_base::Async>;
00064     template struct SAGA_SD_PACKAGE_EXPORT attribute_priv<sd::service_data, task_base::Task>;
00065     template struct SAGA_SD_PACKAGE_EXPORT attribute_priv<sd::service_data, task_base::Sync>;
00066 
00067     template struct SAGA_SD_PACKAGE_EXPORT attribute_sync<sd::service_data>;
00068   }
00069 
00071 } // namespace saga
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines