torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ParameterArrayElement.hpp
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 TORC_GENERIC_PARAMETERARRAYELEMENT_HPP
17 #define TORC_GENERIC_PARAMETERARRAYELEMENT_HPP
18 
20 
21 //BOOST
22 #ifdef GENOM_SERIALIZATION
23 #include <boost/serialization/access.hpp>
24 #endif //GENOM_SERIALIZATION
25 #include "torc/generic/Error.hpp"
30 
31 namespace torc { namespace generic { class BaseVisitor; } }
32 
33 namespace torc {
34 namespace generic {
35 
36 /**
37  * Represents an element of a parameter array.
38  */
39 class ParameterArrayElement : public Parameter, public VectorBit<Parameter> {
40 #ifdef GENOM_SERIALIZATION
41  friend class boost::serialization::access;
42 #endif //GENOM_SERIALIZATION
43 public:
46 
48 
49  virtual ~ParameterArrayElement() throw ();
50 
51  /**
52  * Receive an inoutVisitor to this class. The visit method of the inoutVisitor is called and a
53  * reference to this object is passed as a parameter. It has to be noted however, that a
54  * dynamic_cast is performed inside this method. If the cast fails, an appropriate exception is
55  * thrown by this method. This situation can arise when the passed Visitor object does not
56  * inherit from the appropriate inoutVisitor specialization. See Visitor documentation for more
57  * details.
58  *
59  * @param[in,out] inoutVisitor A reference to the inoutVisitor object
60  * @exception Error Visitor type inappropriate for visiting this object or any other error
61  * thrown by the Visitor::throw() method.
62  */
63  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
64 
65 private:
66 #ifdef GENOM_SERIALIZATION
67  template <class Archive> void serialize(Archive& ar, unsigned int);
68 #endif //GENOM_SERIALIZATION
69 };
70 
71 } // namespace generic
72 } // namespace torc
73 
74 #endif // TORC_GENERIC_PARAMETERARRAYELEMENT_HPP
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
VisitorType< ParameterArrayElement > Visitor
Represents a parameter object in EDIF.
Definition: Parameter.hpp:38
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)
A placeholder for a factory method.
Definition: FactoryType.hpp:35
Represents a single element of a vector composition.
Definition: VectorBit.hpp:41
FactoryType< ParameterArrayElement > Factory