16 #ifndef TORC_GENERIC_BUNDLEFLATTENER_HPP
17 #define TORC_GENERIC_BUNDLEFLATTENER_HPP
34 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
35 typename _Bundle>
class BundleFlattener :
public _Scalar::Visitor,
public _Vector::Visitor,
36 public _VectorBit::Visitor,
public _Bundle::Visitor {
39 typedef typename _BaseType::List
List;
45 void visit(_VectorBit& vectorBit)
throw (
Error);
64 template <typename _BaseType, typename _Scalar, typename _Vector, typename _VectorBit,
65 typename _Bundle>
void BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
67 outChildren.insert(outChildren.end(), mChildren.begin(), mChildren.end());
71 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
72 typename _Bundle>
void BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
74 mChildren.push_back(scalar.getSharedThis());
77 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
78 typename _Bundle>
void BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
81 typename _Vector::List children;
82 vector.getChildren(children);
86 for_each(children.begin(), children.end(), applier);
93 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
94 typename _Bundle>
void BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
96 mChildren.push_back(vectorBit.getSharedThis());
100 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
101 typename _Bundle>
void BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
107 bundle.applyOnAllChildren(applier);
115 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
116 typename _Bundle>
BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
120 template <
typename _BaseType,
typename _Scalar,
typename _Vector,
typename _VectorBit,
121 typename _Bundle>
BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit,
122 _Bundle>::~BundleFlattener() throw () {}
127 #endif // TORC_GENERIC_BUNDLEFLATTENER_HPP
The Error object thrown by different methods of EdifOM.
void visit(_Scalar &scalar)
void getChildren(typename Bundle< _BaseType >::List &outChildren) const
Bundle< _BaseType >::List mChildren
Represents a "bundle" in the EDIF sense.
Flatten a bundle to bits.
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)