Mix-in class designed to be inherited to provide facets to the subclass. More...
#include <Channels/ChannelFacet.H>
Classes | |
struct | Impl |
Public Member Functions | |
ChannelFacetMap () | |
Default constructor. | |
virtual | ~ChannelFacetMap () |
Virtual destructor. | |
void | writeFacetsTo (ParamMap &pmap) const |
Write our facets out to a ParamMap. | |
void | readFacetsFrom (const ParamMap &pmap) |
Read our facets back in from a ParamMap. | |
template<class T > | |
bool | hasFacet () const |
Query if we have a facet of type T. | |
template<class T > | |
rutz::shared_ptr< T > | getFacet () const |
Get the facet of type T. | |
template<class T > | |
void | setFacet (rutz::shared_ptr< T > f) |
Install a facet of type T. | |
unsigned int | numFacets () const |
Number of installed facets. |
Mix-in class designed to be inherited to provide facets to the subclass.
This map can hold various ChannelFacet elements and provides a basic interface to add/retrieve ChannelFacet elements. SingleChannel and ComplexChannel both inherit from ChannelFacetMap.
Definition at line 79 of file ChannelFacet.H.
ChannelFacetMap::ChannelFacetMap | ( | ) |
Default constructor.
Definition at line 63 of file ChannelFacet.C.
ChannelFacetMap::~ChannelFacetMap | ( | ) | [virtual] |
Virtual destructor.
Definition at line 69 of file ChannelFacet.C.
rutz::shared_ptr< T > ChannelFacetMap::getFacet | ( | ) | const [inline] |
Get the facet of type T.
Will throw an exception if there is no such facet (check hasFacet() first).
Definition at line 137 of file ChannelFacet.H.
References ASSERT, rutz::demangled_name(), rutz::dyn_cast(), and rutz::shared_ptr< T >::get().
Referenced by GuidedSearchBiaser::visitComplexChannel(), OptimalGainsFinder::visitComplexChannel(), OptimalGainsFinder::visitSingleChannel(), and GuidedSearchBiaser::visitSingleChannel().
bool ChannelFacetMap::hasFacet | ( | ) | const [inline] |
Query if we have a facet of type T.
Definition at line 130 of file ChannelFacet.H.
References rutz::shared_ptr< T >::get().
Referenced by GuidedSearchBiaser::visitComplexChannel(), OptimalGainsFinder::visitComplexChannel(), ChannelVisitorInstallFacet< CFS, CFC >::visitComplexChannel(), OptimalGainsFinder::visitSingleChannel(), ChannelVisitorInstallFacet< CFS, CFC >::visitSingleChannel(), and GuidedSearchBiaser::visitSingleChannel().
unsigned int ChannelFacetMap::numFacets | ( | ) | const |
Number of installed facets.
Definition at line 104 of file ChannelFacet.C.
void ChannelFacetMap::readFacetsFrom | ( | const ParamMap & | pmap | ) |
Read our facets back in from a ParamMap.
Definition at line 88 of file ChannelFacet.C.
References ParamMap::getSubpmap(), and ParamMap::hasParam().
Referenced by ComplexChannel::readFrom(), SingleChannel::readFrom(), IntegerComplexChannel::readFrom(), and IntegerSimpleChannel::readFrom().
void ChannelFacetMap::setFacet | ( | rutz::shared_ptr< T > | f | ) | [inline] |
Install a facet of type T.
This will replace any previous such facet.
Definition at line 157 of file ChannelFacet.H.
Referenced by GuidedSearchBiaser::visitComplexChannel(), OptimalGainsFinder::visitComplexChannel(), ChannelVisitorInstallFacet< CFS, CFC >::visitComplexChannel(), OptimalGainsFinder::visitSingleChannel(), ChannelVisitorInstallFacet< CFS, CFC >::visitSingleChannel(), and GuidedSearchBiaser::visitSingleChannel().
void ChannelFacetMap::writeFacetsTo | ( | ParamMap & | pmap | ) | const |
Write our facets out to a ParamMap.
Definition at line 75 of file ChannelFacet.C.
References ParamMap::putSubpmap().
Referenced by ComplexChannel::writeTo(), IntegerSimpleChannel::writeTo(), SingleChannel::writeTo(), and IntegerComplexChannel::writeTo().