a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
IndexedBlockTemplate.hpp
Go to the documentation of this file.
1/*
2 * IndexedBlockTemplate.hpp
3 *
4 * Created on: Mar 15, 2012
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2012 Ben O'Leary
7 *
8 * This file is part of LesHouchesParserClasses, released under the
9 * GNU General Public License. Please see the accompanying
10 * README.LHPC_CPP.txt file for a full list of files, brief documentation
11 * on how to use these classes, and further details on the license.
12 */
13
14#ifndef INDEXEDBLOCKTEMPLATE_HPP_
15#define INDEXEDBLOCKTEMPLATE_HPP_
16
17#include "../SlhaBlock.hpp"
18
19namespace LHPC
20{
21 namespace SLHA
22 {
23 // this abstract base template class covers the common functions for a
24 // block with at least 1 index.
25 template< class ValueClass, class IndexedParser >
26 class IndexedBlockTemplate : public SlhaBlock< ValueClass, IndexedParser >
27 {
28 public:
29 IndexedBlockTemplate( std::string const& blockName,
30 ValueClass const& defaultUnsetValue,
31 bool const isVerbose,
32 std::vector< int > const& indexDigitsVector );
33 virtual
35
36
37 protected:
38 std::vector< int > const indexDigitsVector;
39
40 virtual void
42 // derived classes can insert extra arguments to any new block
43 // interpreters by over-riding this.
44 };
45
46
47
48
49
50 template< class ValueClass, class IndexedParser >
51 inline
53 std::string const& blockName,
54 ValueClass const& defaultUnsetValue,
55 bool const isVerbose,
56 std::vector< int > const& indexDigitsVector ) :
57 SlhaBlock< ValueClass, IndexedParser >( blockName,
58 defaultUnsetValue,
59 isVerbose ),
60 indexDigitsVector( indexDigitsVector )
61 {
62 this->dataBlocks.getFront().setIndexDigits( indexDigitsVector );
63 }
64
65 template< class ValueClass, class IndexedParser >
66 inline
68 {
69 // does nothing.
70 }
71
72 template< class ValueClass, class IndexedParser >
73 inline void
75 {
76 this->dataBlocks.getBack().setIndexDigits( indexDigitsVector );
77 }
78
79 } // end of SLHA namespace
80
81} // end of LHPC namespace
82
83#endif /* INDEXEDBLOCKTEMPLATE_HPP_ */
IndexedBlockTemplate(std::string const &blockName, ValueClass const &defaultUnsetValue, bool const isVerbose, std::vector< int > const &indexDigitsVector)
std::vector< int > const indexDigitsVector
BOL::VectorlikeArray< IndexedParser > dataBlocks
Definition: SlhaBlock.hpp:140