torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InstanceArrayMember.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_INSTANCEARRAYMEMBER_HPP
17 #define TORC_GENERIC_INSTANCEARRAYMEMBER_HPP
18 
20 
21 #ifdef GENOM_SERIALIZATION
22 #include <boost/serialization/access.hpp>
23 #endif //GENOM_SERIALIZATION
24 #include "torc/generic/Error.hpp"
29 
30 namespace torc { namespace generic { class BaseVisitor; } }
31 namespace torc { namespace generic { class ParameterMap; } }
32 
33 namespace torc {
34 namespace generic {
35 
36 /**
37  * @brief Represents a member of an instance array.
38  *
39  * The InstanceArrayMember represents a single instance from an array of instances.
40  */
41 class InstanceArrayMember : public Instance, public VectorBit<Instance> {
42 #ifdef GENOM_SERIALIZATION
43  friend class boost::serialization::access;
44 #endif //GENOM_SERIALIZATION
45 public:
47  /**
48  * Convenience typedef to create a parameter array element.
49  */
51 
52  /**
53  * Receive an inoutVisitor to this class. The visit method of the inoutVisitor is called and a
54  * reference to this object is passed as a parameter. It has to be noted however, that a
55  * dynamic_cast is performed inside this method. If the cast fails, an appropriate exception
56  * is thrown by this method. This situation can arise when the passed Visitor object does not
57  * inherit from the appropriate inoutVisitor specialization. See Visitor documentation for more
58  * details.
59  *
60  * @param[in,out] inoutVisitor A reference to the inoutVisitor object
61  * @exception Error Visitor type inappropriate for visiting this object or any other error
62  * thrown by the Visitor::throw() method.
63  */
64  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
65 
66  /**
67  * Returns the parent container's context that will be used to get parameters from
68  * the parameter map. For an unbound instance,
69  * this will return an invalid value
70  */
71  virtual ParameterContext getParameterContext() const;
72 
73  /**
74  * Get the ParameterMap corresponding to this instance and it's master
75  *
76  * @return A ParameterMap consisiting of only the overridden parameters.
77  */
78  virtual ParameterMapSharedPtr getParameters() const throw (Error);
79 
81  virtual ~InstanceArrayMember() throw ();
82 
83 private:
84 #ifdef GENOM_SERIALIZATION
85  template <class Archive> void serialize(Archive& ar, unsigned int);
86 #endif //GENOM_SERIALIZATION
87 };
88 
89 } // namespace generic
90 } // namespace torc
91 
92 #endif // TORC_GENERIC_INSTANCEARRAYMEMBER_HPP
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
FactoryType< InstanceArrayMember > Factory
VisitorType< InstanceArrayMember > Visitor
Represents an instantiation of a cell view in the view of another cell.
Represents a member of an instance array.
virtual ParameterContext getParameterContext() const
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)
virtual ParameterMapSharedPtr getParameters() const
A placeholder for a factory method.
Definition: FactoryType.hpp:35
Represents a single element of a vector composition.
Definition: VectorBit.hpp:41
boost::shared_ptr< ParameterMap > ParameterMapSharedPtr