00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "torc/generic/om/DumpRestoreConfig.hpp"
00017
00018 #ifndef HAVE_CONFIG_H
00019 #include "torc/generic/config.h"
00020 #endif
00021
00022 #ifdef GENOM_SERIALIZATION
00023 #include <boost/archive/binary_iarchive.hpp>
00024 #include <boost/archive/binary_oarchive.hpp>
00025 #include <boost/serialization/base_object.hpp>
00026 #include <boost/type_traits/is_abstract.hpp>
00027 #endif //GENOM_SERIALIZATION
00028
00029 #include "torc/generic/om/Port.hpp"
00030 #include "torc/generic/om/PortReference.hpp"
00031
00032 #ifdef GENOM_SERIALIZATION
00033 BOOST_IS_ABSTRACT(
00034 torc::generic::Composite<torc::generic::PortReference> )
00035 #endif //GENOM_SERIALIZATION
00036
00037 namespace torc {
00038
00039 namespace generic {
00040
00041 PortReference::PortReference()
00042 : Composite<PortReference>(),
00043 Connectable(),
00044 PropertyContainer(),
00045 Visitable(),
00046 ParentedObject<Instance>() {
00047 }
00048
00049 PortReference::~PortReference() throw() {
00050 }
00051
00052
00053
00054
00055
00056
00057 void
00058 PortReference::bindToMasterPort(
00059 const PortSharedPtr &inMaster) throw(Error) {
00060 mMaster = inMaster;
00061 }
00062
00063 void
00064 PortReference::setAttributes(
00065 const PortAttributesSharedPtr & inSource) throw() {
00066 mAttributes = inSource;
00067 }
00068 std::string
00069 PortReference::getName() throw() {
00070 return (mMaster)
00071 ? mMaster->getName()
00072 :std::string();
00073 }
00074
00075 #ifdef GENOM_SERIALIZATION
00076 template<class Archive> void
00077 PortReference::serialize( Archive &ar, unsigned int ) {
00078 ar & boost::serialization::base_object<Connectable>( *this );
00079 ar & boost::serialization::base_object<PropertyContainer>( *this );
00080 ar & boost::serialization::base_object<Visitable>( *this );
00081 ar & boost::serialization::base_object<
00082 Composite<PortReference> >( *this );
00083
00084 }
00085
00086
00087 template void
00088 PortReference::serialize<boost::archive::binary_iarchive>(
00089 boost::archive::binary_iarchive & ar, const unsigned int);
00090
00091 template void
00092 PortReference::serialize<boost::archive::binary_oarchive>(
00093 boost::archive::binary_oarchive & ar, const unsigned int);
00094
00095 #endif //GENOM_SERIALIZATION
00096
00097 }
00098
00099 }