souffle  2.0.2-371-g6315b36
Row.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2016, The Souffle Developers. All rights reserved
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 #pragma once
10 
12 
13 #include <memory>
14 #include <vector>
15 
16 namespace souffle {
17 namespace profile {
18 
19 /*
20  * Row class for Tables, holds a vector of cells.
21  */
22 class Row {
23 public:
24  std::vector<std::shared_ptr<CellInterface>> cells;
25 
26  Row(unsigned long size) : cells() {
27  for (unsigned long i = 0; i < size; i++) {
28  cells.emplace_back(std::shared_ptr<CellInterface>(nullptr));
29  }
30  }
31 
32  std::shared_ptr<CellInterface>& operator[](unsigned long i) {
33  return cells.at(i);
34  }
35 
36  // void addCell(int location, std::shared_ptr<CellInterface> cell) {
37  // cells[location] = cell;
38  // }
39 
40  inline std::vector<std::shared_ptr<CellInterface>> getCells() {
41  return cells;
42  }
43 };
44 
45 } // namespace profile
46 } // namespace souffle
TCB_SPAN_NAMESPACE_NAME::detail::size
constexpr auto size(const C &c) -> decltype(c.size())
Definition: span.h:198
CellInterface.h
souffle::profile::Row::cells
std::vector< std::shared_ptr< CellInterface > > cells
Definition: Row.h:24
i
size_t i
Definition: json11.h:663
souffle::profile::Row
Definition: Row.h:22
souffle::profile::Row::operator[]
std::shared_ptr< CellInterface > & operator[](unsigned long i)
Definition: Row.h:32
souffle::profile::Row::Row
Row(unsigned long size)
Definition: Row.h:26
souffle
Definition: AggregateOp.h:25
souffle::profile::Row::getCells
std::vector< std::shared_ptr< CellInterface > > getCells()
Definition: Row.h:40