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/serialization/export.hpp>
00027 #endif //GENOM_SERIALIZATION
00028
00029 #include "torc/generic/om/InstanceArrayMember.hpp"
00030 #include "torc/generic/om/VisitorType.hpp"
00031 #include "torc/generic/om/ParameterMap.hpp"
00032
00033 #ifdef GENOM_SERIALIZATION
00034 BOOST_CLASS_EXPORT( torc::generic::InstanceArrayMember )
00035 #endif //GENOM_SERIALIZATION
00036
00037 namespace torc {
00038
00039 namespace generic {
00040
00041
00042
00043
00044
00045
00046
00047 void
00048 InstanceArrayMember::accept(
00049 BaseVisitor & inoutVisitor) throw(Error)
00050 {
00051 try
00052 {
00053 runVisitor( *this, inoutVisitor );
00054 }
00055 catch( Error &e )
00056 {
00057 e.setCurrentLocation(
00058 __FUNCTION__, __FILE__, __LINE__ );
00059 throw;
00060 }
00061 }
00062
00063
00064 ParameterContext
00065 InstanceArrayMember::getParameterContext() const throw() {
00066 InstanceSharedPtr parent = getParentCollection();
00067 if( !parent )
00068 {
00069 return ParameterContext();
00070 }
00071 return parent->getParameterContext();
00072 }
00073
00074
00075
00076
00077
00078
00079 ParameterMapSharedPtr
00080 InstanceArrayMember::getParameters() const throw(Error)
00081 {
00082 InstanceSharedPtr parent = getParentCollection();
00083 if( !parent )
00084 {
00085 Error e( eMessageIdErrorPointerToItemDoesNotExist,
00086 __FUNCTION__, __FILE__, __LINE__ );
00087 e.saveContextData("Parent Collection", parent);
00088 throw e;
00089 }
00090 return parent->getParameters();
00091 }
00092
00093 InstanceArrayMember::InstanceArrayMember()
00094 :Instance(),
00095 VectorBit<Instance>(){
00096 }
00097
00098 InstanceArrayMember::~InstanceArrayMember() throw() {
00099 }
00100
00101
00102
00103
00104 void InstanceArrayMember::flatten() throw(Error) {
00105 }
00106
00107 #ifdef GENOM_SERIALIZATION
00108 template<class Archive> void
00109 InstanceArrayMember::serialize( Archive &ar, unsigned int ) {
00110 ar & boost::serialization::base_object<Instance>( *this );
00111 ar & boost::serialization::base_object<
00112 VectorBit<Instance> >( *this );
00113 }
00114
00115
00116 template void
00117 InstanceArrayMember::serialize<boost::archive::binary_iarchive>(
00118 boost::archive::binary_iarchive & ar, const unsigned int);
00119
00120 template void
00121 InstanceArrayMember::serialize<boost::archive::binary_oarchive>(
00122 boost::archive::binary_oarchive & ar, const unsigned int);
00123
00124 #endif //GENOM_SERIALIZATION
00125
00126
00127 }
00128
00129 }