torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle > Class Template Reference

Flatten a bundle to bits. More...

#include <BundleFlattener.hpp>

+ Inheritance diagram for torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >:
+ Collaboration diagram for torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >:

Public Types

typedef _BaseType::List List
 

Public Member Functions

void visit (_Scalar &scalar) throw (Error)
 
void visit (_Vector &vector) throw (Error)
 
void visit (_VectorBit &vectorBit) throw (Error)
 
void visit (_Bundle &bundle) throw (Error)
 
void getChildren (typename Bundle< _BaseType >::List &outChildren) const throw (Error)
 
 BundleFlattener ()
 
 ~BundleFlattener () throw ()
 

Private Attributes

Bundle< _BaseType >::List mChildren
 

Detailed Description

template<typename _BaseType, typename _Scalar, typename _Vector, typename _VectorBit, typename _Bundle>
class torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >

Flatten a bundle to bits.

The BundleFlattener class is used to flatten a bundle,

Definition at line 35 of file BundleFlattener.hpp.

Member Typedef Documentation

template<typename _BaseType, typename _Scalar, typename _Vector, typename _VectorBit, typename _Bundle>
typedef _BaseType::List torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::List

Definition at line 39 of file BundleFlattener.hpp.

Constructor & Destructor Documentation

template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::BundleFlattener ( )

Definition at line 117 of file BundleFlattener.hpp.

117  :
118  mChildren() {}
Bundle< _BaseType >::List mChildren
template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::~BundleFlattener ( )
throw (
)

Definition at line 122 of file BundleFlattener.hpp.

122 {}

Member Function Documentation

template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
void torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::getChildren ( typename Bundle< _BaseType >::List outChildren) const
throw (Error
)
inline

Get children of this composition.

Parameters
[out]outChildrenA list of all children for this composition

Definition at line 66 of file BundleFlattener.hpp.

66  {
67  outChildren.insert(outChildren.end(), mChildren.begin(), mChildren.end());
68  return;
69 }
Bundle< _BaseType >::List mChildren

+ Here is the caller graph for this function:

template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
void torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::visit ( _Scalar &  scalar)
throw (Error
)

Definition at line 73 of file BundleFlattener.hpp.

73  {
74  mChildren.push_back(scalar.getSharedThis());
75 }
Bundle< _BaseType >::List mChildren
template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
void torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::visit ( _Vector &  vector)
throw (Error
)

Definition at line 79 of file BundleFlattener.hpp.

79  {
80  try {
81  typename _Vector::List children;
82  vector.getChildren(children);
83  BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit, _Bundle> flattener;
84  VisitorApplier<BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit, _Bundle> > applier(
85  flattener);
86  for_each(children.begin(), children.end(), applier);
87  } catch(Error& e) {
88  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
89  throw;
90  }
91 }

+ Here is the call graph for this function:

template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
void torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::visit ( _VectorBit &  vectorBit)
throw (Error
)

Definition at line 95 of file BundleFlattener.hpp.

95  {
96  mChildren.push_back(vectorBit.getSharedThis());
97 
98 }
Bundle< _BaseType >::List mChildren
template<typename _BaseType , typename _Scalar , typename _Vector , typename _VectorBit , typename _Bundle >
void torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::visit ( _Bundle &  bundle)
throw (Error
)

Definition at line 102 of file BundleFlattener.hpp.

102  {
103  try {
104  BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit, _Bundle> flattener;
105  VisitorApplier<BundleFlattener<_BaseType, _Scalar, _Vector, _VectorBit, _Bundle> >
106  applier(flattener);
107  bundle.applyOnAllChildren(applier);
108 
109  } catch(Error& e) {
110  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
111  throw;
112  }
113 }

+ Here is the call graph for this function:

Field Documentation

template<typename _BaseType, typename _Scalar, typename _Vector, typename _VectorBit, typename _Bundle>
Bundle<_BaseType>::List torc::generic::BundleFlattener< _BaseType, _Scalar, _Vector, _VectorBit, _Bundle >::mChildren
private

Definition at line 56 of file BundleFlattener.hpp.


The documentation for this class was generated from the following file: