torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ParameterArrayElement.cpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef HAVE_CONFIG_H
17 #include "torc/generic/config.h"
18 #endif
19 
20 #ifdef GENOM_SERIALIZATION
21 #include <boost/archive/binary_iarchive.hpp>
22 #include <boost/archive/binary_oarchive.hpp>
23 #include <boost/serialization/base_object.hpp>
24 #include <boost/serialization/export.hpp>
25 #endif //GENOM_SERIALIZATION
28 
29 #ifdef GENOM_SERIALIZATION
30 BOOST_CLASS_EXPORT(torc::generic::ParameterArrayElement)
31 #endif //GENOM_SERIALIZATION
32 
33 namespace torc {
34 namespace generic {
35 
37 
39 
40 void ParameterArrayElement::accept(BaseVisitor& inoutVisitor) throw (Error) {
41  try {
42  runVisitor(*this, inoutVisitor);
43  } catch(Error& e) {
44  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
45  throw;
46  }
47 }
48 
49 #ifdef GENOM_SERIALIZATION
50 template <class Archive> void ParameterArrayElement::serialize(Archive& ar, unsigned int) {
51  ar & boost::serialization::base_object< Parameter >(*this);
52  ar & boost::serialization::base_object< VectorBit<Parameter> >(*this);
53 }
54 
55 //TO SATISFY THE LINKER
56 template void ParameterArrayElement::serialize<boost::archive::binary_oarchive>(
57  boost::archive::binary_oarchive& ar, const unsigned int);
58 
59 template void ParameterArrayElement::serialize<boost::archive::binary_iarchive>(
60  boost::archive::binary_iarchive& ar, const unsigned int);
61 
62 #endif //GENOM_SERIALIZATION
63 
64 } // namespace generic
65 } // namespace torc
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
Definition: VisitorType.hpp:78
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
A base class for Visitor.
Definition: VisitorType.hpp:31
virtual void accept(BaseVisitor &inoutVisitor)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73