53 template<
class ValueClass,
class BlockParser >
77 int& indexForLowerScale,
78 int& indexForUpperScale,
79 double& fractionFromLowerScale );
114 virtual std::string
const&
157 template<
class ValueClass,
class BlockParser >
160 std::string
const& blockName,
161 ValueClass
const& defaultUnsetValue,
162 bool const isVerbose ) :
164 isVerbose( isVerbose ),
165 defaultUnsetValue( defaultUnsetValue ),
167 lowestScaleIndex( 0 ),
168 hasHadPushSinceLastReset( true ),
169 scaleOrderedIndices(),
170 scaleIndexIterator(),
171 stringInterpretation(
"" )
177 template<
class ValueClass,
class BlockParser >
185 template<
class ValueClass,
class BlockParser >
194 if( 0 == whichScaleIndex )
196 return dataBlocks[ lowestScaleIndex ];
200 return dataBlocks[ (--whichScaleIndex) ];
204 template<
class ValueClass,
class BlockParser >
205 inline BlockParser
const&
207 int whichScaleIndex )
const
210 if( 0 == whichScaleIndex )
212 return dataBlocks[ lowestScaleIndex ];
216 return dataBlocks[ (--whichScaleIndex) ];
220 template<
class ValueClass,
class BlockParser >
225 if( hasHadPushSinceLastReset )
227 return dataBlocks.getSize();
235 template<
class ValueClass,
class BlockParser >
238 double const soughtScale,
239 int& indexForLowerScale,
240 int& indexForUpperScale,
241 double& fractionFromLowerScale )
281 fractionFromLowerScale );
284 template<
class ValueClass,
class BlockParser >
285 inline std::string
const&
287 bool onlyShowScalesGreaterThanZero )
298 stringInterpretation.clear();
299 for(
int scaleIndex( 0 );
300 dataBlocks.getSize() > scaleIndex;
303 stringInterpretation.append(
305 stringInterpretation.append(
" " );
306 stringInterpretation.append( blockName );
307 if( onlyShowScalesGreaterThanZero
309 ( 0.0 > dataBlocks[ scaleIndex ].getScale() ) )
311 stringInterpretation.append(
" Q= " );
312 stringInterpretation.append(
314 dataBlocks[ scaleIndex ].getScale() ) );
316 stringInterpretation.append(
"\n" );
317 stringInterpretation.append( dataBlocks[ scaleIndex ].getAsString() );
319 return stringInterpretation;
322 template<
class ValueClass,
class BlockParser >
330 dataBlocks.setSize( 1 ).getBack().clearEntries();
331 scaleOrderedIndices.clear();
332 hasHadPushSinceLastReset =
false;
335 template<
class ValueClass,
class BlockParser >
342 if( hasHadPushSinceLastReset )
344 dataBlocks.newEnd().setDefaultUnsetValue( defaultUnsetValue );
345 dataBlocks.getBack().setVerbosity( isVerbose );
346 prepareNewDataBlock();
347 dataBlocks.getBack().interpretStringBlock( pushedValue );
349 < dataBlocks[ lowestScaleIndex ].getScale() )
355 lowestScaleIndex = dataBlocks.getLastIndex();
360 dataBlocks[ 0 ].interpretStringBlock( pushedValue );
362 hasHadPushSinceLastReset =
true;
363 scaleIndexIterator = scaleOrderedIndices.begin();
364 while( ( scaleIndexIterator != scaleOrderedIndices.end() )
366 ( scaleIndexIterator->second < pushedValue.
getScale() ) )
368 ++scaleIndexIterator;
372 scaleOrderedIndices.insert( scaleIndexIterator,
373 std::pair< int, double >( dataBlocks.getLastIndex(),
377 template<
class ValueClass,
class BlockParser >
static bool findScaleIndices(double const soughtScale, std::list< std::pair< int, double > > const &scaleOrderedIndices, int &indexForLowerScale, int &indexForUpperScale, double &fractionFromLowerScale)
static std::string const blockIdentifierString
static BOL::StringParser const slhaDoubleMaker
BlockParser & operator[](int whichScaleIndex)
ValueClass const defaultUnsetValue
BlockParser const & operator[](int whichScaleIndex) const
std::list< std::pair< int, double > >::iterator scaleIndexIterator
SlhaBlock(std::string const &blockName, ValueClass const &defaultUnsetValue, bool const isVerbose)
bool hasHadPushSinceLastReset
virtual std::string const & interpretAsString(bool onlyShowScalesGreaterThanZero=true)
int getNumberOfCopiesWithDifferentScale() const
BOL::VectorlikeArray< BlockParser > dataBlocks
bool hasRecordedScale(double const soughtScale, int &indexForLowerScale, int &indexForUpperScale, double &fractionFromLowerScale)
std::list< std::pair< int, double > > scaleOrderedIndices
std::string stringInterpretation
virtual void respondToObservedSignal()
virtual void prepareNewDataBlock()
virtual void respondToPush(BlockClass::BaseStringBlock const &pushedValue)