39 #ifndef TYPE_DISCOVERY_HPP_ 40 #define TYPE_DISCOVERY_HPP_ 65 #include <boost/version.hpp> 66 #if BOOST_VERSION >= 106400 70 # include <boost/serialization/array_wrapper.hpp> 72 # include <boost/serialization/array.hpp> 74 #include <boost/serialization/serialization.hpp> 75 #include <boost/serialization/is_bitwise_serializable.hpp> 76 #include <boost/serialization/vector.hpp> 77 #include <boost/serialization/string.hpp> 78 #include <boost/archive/detail/iserializer.hpp> 79 #include <boost/archive/detail/oserializer.hpp> 80 #include <boost/archive/archive_exception.hpp> 81 #include <boost/config.hpp> 82 #include <boost/mpl/bool.hpp> 83 #include <boost/array.hpp> 87 #include "../base/DataSourceBase.hpp" 88 #include "../internal/PartDataSource.hpp" 89 #include "../internal/DataSources.hpp" 90 #include "../internal/Reference.hpp" 109 typedef std::vector<base::DataSourceBase::shared_ptr>
Parts;
147 mparent(parent), mref(0)
161 PartNames::iterator it = find( mnames.begin(), mnames.end(), name);
162 if ( it != mnames.end() && mparts.size() == mnames.size() )
163 return mparts.at( it - mnames.begin() );
175 #if BOOST_VERSION >= 104100 176 boost::archive::detail::load_non_pointer_type<type_discovery>::load_only::invoke(*
this,t);
178 boost::archive::detail::load_non_pointer_type<type_discovery,T>::load_only::invoke(*
this,t);
191 if ( ! mparts.empty() )
235 const boost::archive::detail::basic_pointer_iserializer *
243 void load_object(
void *x,
const boost::archive::detail::basic_oserializer & bos)
256 return load_a_type(t, boost::mpl::bool_<boost::serialization::implementation_level<T>::value == boost::serialization::primitive_type>());
303 #if BOOST_VERSION >= 106100 318 template<
class T, std::
size_t N>
345 if ( !membername.empty() ) {
358 mnames.push_back( t.name() );
type_discovery & load_a_type(const T *&, boost::mpl::false_)
void load_object(void *x, const boost::archive::detail::basic_oserializer &bos)
internal::Reference * mref
boost::mpl::bool_< true > is_loading
virtual void setReference(void *ref)=0
base::DataSourceBase::shared_ptr getMember(const std::string name)
type_discovery & load_a_type(boost::array< T, N > &t, boost::mpl::false_)
type_discovery & operator>>(T &t)
base::DataSourceBase::shared_ptr discoverMember(T &t, const std::string name)
type_discovery & operator&(T &t)
type_discovery & load_a_type(const boost::serialization::array< T > &t, boost::mpl::false_)
void delete_created_pointers()
void reset_object_address(const void *new_address, const void *old_address)
base::DataSourceBase::shared_ptr mparent
std::vector< std::string > PartNames
std::vector< base::DataSourceBase::shared_ptr > Parts
const boost::archive::detail::basic_pointer_iserializer * register_type(T *=NULL)
type_discovery & load_a_type(T &t, boost::mpl::false_)
unsigned int get_library_version()
type_discovery & load_a_type(T &t, boost::mpl::true_)
boost::intrusive_ptr< DataSourceBase > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
type_discovery(base::DataSourceBase::shared_ptr parent)
bool referenceMember(internal::Reference *ref, T &t, const std::string name)
boost::mpl::bool_< false > is_saving
type_discovery & load_a_type(const boost::serialization::nvp< T > &t, boost::mpl::false_)