hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SphinxConfigOptions.cpp
Go to the documentation of this file.
1 #include <sstream>
2 
4 
5 namespace HCE
6 {
7 namespace sphinx
8 {
9 //-----------------------------------------------------------------------------
11 : maxDocId(0), createdDate(time(nullptr)), mergedDate(time(nullptr)), branches(), ranker(0), rankerExpression("")
12 {
13 }
14 //-----------------------------------------------------------------------------
16 {
17  maxDocId = 0;
18  createdDate = time(nullptr);
19  mergedDate = time(nullptr);
20  branches.clear();
21  ranker = 0;
22  rankerExpression.clear();
23 }
24 //-----------------------------------------------------------------------------
25 // cppcheck-suppress unusedFunction
27 {
28  createdDate = time(nullptr);
29 }
30 //-----------------------------------------------------------------------------
32 {
33  mergedDate = time(nullptr);
34 }
35 //-----------------------------------------------------------------------------
37 {
38  branches.push_back(branchName);
39 }
40 //-----------------------------------------------------------------------------
42 {
43  branches.push_back(std::forward<std::string>(branchName));
44 }
45 //-----------------------------------------------------------------------------
46 // cppcheck-suppress unusedFunction
47 void SphinxConfigOptions::addBranches(const std::vector<std::string>& branches_)
48 {
49  branches.insert(branches.end(), branches_.begin(), branches_.end());
50 }
51 //-----------------------------------------------------------------------------
52 // cppcheck-suppress unusedFunction
54 {
55  return branches.size();
56 }
57 //-----------------------------------------------------------------------------
58 std::string SphinxConfigOptions::getBranchItem(size_t index) const
59 {
60  return branches[index];
61 }
62 //-----------------------------------------------------------------------------
64 {
65  std::stringstream outStr;
66  for (const std::string& branchName: branches)
67  {
68  if (!outStr.str().empty())
69  outStr << ',';
70  outStr << branchName;
71  }
72  return outStr.str();
73 }
74 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 } // end namespace sphinx
77 } // end namespace HCE