strus  0.17
summaryElement.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_SUMMARY_ELEMENT_HPP_INCLUDED
11 #define _STRUS_SUMMARY_ELEMENT_HPP_INCLUDED
12 #include <string>
13 
14 namespace strus
15 {
16 
19 {
20 public:
22  SummaryElement( const std::string& name_, const std::string& value_, double weight_=1.0, int index_=-1)
23  :m_name(name_),m_value(value_),m_weight(weight_),m_index(index_){}
26  :m_name(o.m_name),m_value(o.m_value),m_weight(o.m_weight),m_index(o.m_index){}
27 
29  const std::string& name() const {return m_name;}
31  const std::string& value() const {return m_value;}
33  double weight() const {return m_weight;}
35  int index() const {return m_index;}
36 
37 private:
38  std::string m_name;
39  std::string m_value;
40  double m_weight;
41  int m_index;
42 };
43 
44 } //namespace
45 #endif
46 
SummaryElement(const std::string &name_, const std::string &value_, double weight_=1.0, int index_=-1)
Constructor.
Definition: summaryElement.hpp:22
const std::string & value() const
Get the value of the element.
Definition: summaryElement.hpp:31
int index() const
Get the index of the element if defined.
Definition: summaryElement.hpp:35
One result element of summarization.
Definition: summaryElement.hpp:18
double weight() const
Get the weight of the element if defined.
Definition: summaryElement.hpp:33
const std::string & name() const
Get the name of the element.
Definition: summaryElement.hpp:29
SummaryElement(const SummaryElement &o)
Copy constructor.
Definition: summaryElement.hpp:25