00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/generic/om/ParameterArrayElement.hpp $ 00003 // $Id: ParameterArrayElement.hpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 #ifndef TORC_GENERIC_OM_PARAMETERARRAYELEMENT_HPP 00017 #define TORC_GENERIC_OM_PARAMETERARRAYELEMENT_HPP 00018 00019 #include "torc/generic/om/PointerTypes.hpp" 00020 #include "torc/generic/om/DumpRestoreConfig.hpp" 00021 00022 //BOOST 00023 #ifdef GENOM_SERIALIZATION 00024 #include <boost/serialization/access.hpp> 00025 #endif //GENOM_SERIALIZATION 00026 00027 #include "torc/generic/util/Error.hpp" 00028 #include "torc/generic/om/FactoryType.hpp" 00029 #include "torc/generic/om/Parameter.hpp" 00030 #include "torc/generic/om/VectorBit.hpp" 00031 #include "torc/generic/om/VisitorType.hpp" 00032 00033 namespace torc { namespace generic { class BaseVisitor; } } 00034 00035 namespace torc { 00036 00037 namespace generic { 00038 00039 /** 00040 * Represents an element of a paramter array. 00041 */ 00042 class ParameterArrayElement : 00043 public Parameter, 00044 public VectorBit<Parameter> { 00045 #ifdef GENOM_SERIALIZATION 00046 friend class boost::serialization::access; 00047 #endif //GENOM_SERIALIZATION 00048 00049 public: 00050 typedef VisitorType<ParameterArrayElement> Visitor; 00051 typedef FactoryType<ParameterArrayElement> Factory; 00052 00053 ParameterArrayElement(); 00054 00055 virtual 00056 ~ParameterArrayElement() throw(); 00057 00058 /** 00059 * Recive a inoutVisitor to this class. The visit method of the inoutVisitor is called and a reference to this object is passed as a parameter. It has to be noted however, that a dynamic_cast is performed inside this method. If the cast fails, an appropriate exception is thrown by this method. This sitation can arise when the passed Visitor object does not inherit from the appropriate inoutVisitor specialization. See Visitor documentation for more details. 00060 * 00061 * @param[in,out] inoutVisitor A reference to the inoutVisitor object 00062 * @exception Error Visitor type inappropriate for visiting this object or any other error thrown by the Visitor::throw() method. 00063 */ 00064 virtual void 00065 accept(BaseVisitor &inoutVisitor) throw(Error); 00066 00067 00068 private: 00069 #ifdef GENOM_SERIALIZATION 00070 template<class Archive> void 00071 serialize( Archive &ar, unsigned int); 00072 #endif //GENOM_SERIALIZATION 00073 00074 }; 00075 00076 } // namespace torc::generic 00077 00078 } // namespace torc 00079 #endif // TORC_GENERIC_OM_PARAMETERARRAYELEMENT_HPP