souffle  2.0.2-371-g6315b36
Data Structures | Public Member Functions | Private Attributes
souffle::Table< T, blockSize > Class Template Reference

#include <Table.h>

Collaboration diagram for souffle::Table< T, blockSize >:
Collaboration graph

Data Structures

struct  Block
 
class  iterator
 

Public Member Functions

iterator begin () const
 
void clear ()
 
bool empty () const
 
iterator end () const
 
const T & insert (const T &element)
 
std::size_t size () const
 
 Table ()
 
 ~Table ()
 

Private Attributes

std::size_t count = 0
 
Blockhead
 
Blocktail
 

Detailed Description

template<typename T, unsigned blockSize = 4096>
class souffle::Table< T, blockSize >

Definition at line 33 of file Table.h.

Constructor & Destructor Documentation

◆ Table()

template<typename T , unsigned blockSize = 4096>
souffle::Table< T, blockSize >::Table ( )
inline

Definition at line 105 of file Table.h.

105 {

◆ ~Table()

template<typename T , unsigned blockSize = 4096>
souffle::Table< T, blockSize >::~Table ( )
inline

Definition at line 107 of file Table.h.

107  {
108  head = new Block();
109  tail = head;

References souffle::Table< T, blockSize >::head, and souffle::Table< T, blockSize >::tail.

Member Function Documentation

◆ begin()

template<typename T , unsigned blockSize = 4096>
iterator souffle::Table< T, blockSize >::begin ( ) const
inline

Definition at line 139 of file Table.h.

◆ clear()

template<typename T , unsigned blockSize = 4096>
void souffle::Table< T, blockSize >::clear ( )
inline

Definition at line 147 of file Table.h.

Referenced by souffle::Table< T, blockSize >::iterator::operator++().

◆ empty()

template<typename T , unsigned blockSize = 4096>
bool souffle::Table< T, blockSize >::empty ( ) const
inline

◆ end()

template<typename T , unsigned blockSize = 4096>
iterator souffle::Table< T, blockSize >::end ( ) const
inline

Definition at line 143 of file Table.h.

◆ insert()

template<typename T , unsigned blockSize = 4096>
const T& souffle::Table< T, blockSize >::insert ( const T &  element)
inline

Definition at line 119 of file Table.h.

125  {
126  return iterator(head);
127  }
128 
129  iterator end() const {
130  return iterator();
131  }
132 
133  void clear() {
134  while (head != nullptr) {
135  auto cur = head;
136  head = head->next;
137  delete cur;

Referenced by souffle::test::TEST().

◆ size()

template<typename T , unsigned blockSize = 4096>
std::size_t souffle::Table< T, blockSize >::size ( ) const
inline

Definition at line 115 of file Table.h.

125  {

Referenced by souffle::genJsonRules(), and souffle::test::TEST().

Field Documentation

◆ count

template<typename T , unsigned blockSize = 4096>
std::size_t souffle::Table< T, blockSize >::count = 0
private

Definition at line 63 of file Table.h.

◆ head

template<typename T , unsigned blockSize = 4096>
Block* souffle::Table< T, blockSize >::head
private

Definition at line 60 of file Table.h.

Referenced by souffle::Table< T, blockSize >::~Table().

◆ tail

template<typename T , unsigned blockSize = 4096>
Block* souffle::Table< T, blockSize >::tail
private

The documentation for this class was generated from the following file:
souffle::Table::head
Block * head
Definition: Table.h:60
souffle::Table::Block::next
Block * next
Definition: Table.h:49
souffle::Table::tail
Block * tail
Definition: Table.h:61
souffle::Table::end
iterator end() const
Definition: Table.h:143
souffle::Table::clear
void clear()
Definition: Table.h:147