SAGA Adaptor CPI v.1.0
|
00001 // Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) 00002 // Copyright (c) 2005-2009 Hartmut Kaiser 00003 // 00004 // Use, modification and distribution is subject to the Boost Software 00005 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 00006 // http://www.boost.org/LICENSE_1_0.txt) 00007 00008 // include the object implementation we want to use 00009 #include <boost/version.hpp> 00010 #include <saga/impl/engine/object.hpp> 00011 00012 // include the basic header file 00013 #include <saga/saga/exception.hpp> 00014 #include <saga/saga/object.hpp> 00015 00016 // we need saga::session and saga::uuid 00017 #include <saga/saga/session.hpp> 00018 #include <saga/saga/uuid.hpp> 00019 00021 namespace saga 00022 { 00023 object::object (saga::impl::object * init) 00024 #if BOOST_VERSION >= 103900 00025 : impl_ (init) 00026 #else 00027 : impl_ (init->_internal_weak_this.use_count() ? 00028 init->shared_from_this() : TR1::shared_ptr<saga::impl::object>(init)) 00029 #endif 00030 { 00031 } 00032 00033 object::object (TR1::shared_ptr<saga::impl::object> init) 00034 : impl_ (init) 00035 { 00036 } 00037 00038 // constructor for objects without session 00039 object::object () 00040 { 00041 } 00042 00043 saga::object::type object::get_type (void) const 00044 { 00045 return impl_ ? (impl_->get_type()) : Unknown; 00046 } 00047 00048 saga::uuid object::get_id (void) const 00049 { 00050 return impl_ ? impl_->get_uuid () : uuid(); 00051 } 00052 00053 saga::session& object::get_session() 00054 { 00055 return (impl_->get_session ()); 00056 } 00057 saga::session const& object::get_session() const 00058 { 00059 return (impl_->get_session ()); 00060 } 00061 00062 saga::object object::clone() const 00063 { 00064 return impl_->clone(); 00065 } 00066 00067 } // namespace saga 00069