souffle  2.0.2-371-g6315b36
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
souffle::t_info< Arity_ > Class Template Reference

info relations More...

#include <CompiledSouffle.h>

Collaboration diagram for souffle::t_info< Arity_ >:
Collaboration graph

Data Structures

struct  context
 
class  iterator
 

Public Types

using t_tuple = Tuple< RamDomain, Arity >
 

Public Member Functions

iterator begin () const
 
bool contains (const t_tuple &t) const
 
bool contains (const t_tuple &t, context &) const
 
context createContext ()
 
bool empty () const
 
iterator end () const
 
void insert (const RamDomain *ramDomain)
 
void insert (const t_tuple &t)
 
void insert (const t_tuple &t, context &)
 
void printStatistics (std::ostream &) const
 
void purge ()
 
std::size_t size () const
 
 t_info ()=default
 

Static Public Attributes

static constexpr Relation::arity_type Arity = Arity_
 

Private Attributes

std::vector< Tuple< RamDomain, Arity > > data
 
Lock insert_lock
 

Detailed Description

template<Relation::arity_type Arity_>
class souffle::t_info< Arity_ >

info relations

Definition at line 270 of file CompiledSouffle.h.

Member Typedef Documentation

◆ t_tuple

template<Relation::arity_type Arity_>
using souffle::t_info< Arity_ >::t_tuple = Tuple<RamDomain, Arity>

Definition at line 275 of file CompiledSouffle.h.

Constructor & Destructor Documentation

◆ t_info()

template<Relation::arity_type Arity_>
souffle::t_info< Arity_ >::t_info ( )
default

Member Function Documentation

◆ begin()

template<Relation::arity_type Arity_>
iterator souffle::t_info< Arity_ >::begin ( ) const
inline

Definition at line 303 of file CompiledSouffle.h.

303  {
304  insert_lock.lock();
305  if (!contains(t)) {

References souffle::t_info< Arity_ >::contains(), souffle::t_info< Arity_ >::insert_lock, and souffle::Lock::lock().

Here is the call graph for this function:

◆ contains() [1/2]

template<Relation::arity_type Arity_>
bool souffle::t_info< Arity_ >::contains ( const t_tuple t) const
inline

Definition at line 328 of file CompiledSouffle.h.

330  {
331  return contains(t);
332  }
333  std::size_t size() const {
334  return data.size();
335  }

Referenced by souffle::t_info< Arity_ >::begin().

◆ contains() [2/2]

template<Relation::arity_type Arity_>
bool souffle::t_info< Arity_ >::contains ( const t_tuple t,
context  
) const
inline

Definition at line 336 of file CompiledSouffle.h.

336  {
337  return data.size() == 0;
338  }

References souffle::t_info< Arity_ >::data.

◆ createContext()

template<Relation::arity_type Arity_>
context souffle::t_info< Arity_ >::createContext ( )
inline

Definition at line 277 of file CompiledSouffle.h.

277  :
278  iterator(const typename std::vector<t_tuple>::const_iterator& o) : it(o) {}
279 

◆ empty()

template<Relation::arity_type Arity_>
bool souffle::t_info< Arity_ >::empty ( ) const
inline

Definition at line 342 of file CompiledSouffle.h.

342  {}
343 
344 private:

◆ end()

template<Relation::arity_type Arity_>
iterator souffle::t_info< Arity_ >::end ( ) const
inline

Definition at line 306 of file CompiledSouffle.h.

310  {

◆ insert() [1/3]

template<Relation::arity_type Arity_>
void souffle::t_info< Arity_ >::insert ( const RamDomain ramDomain)
inline

Definition at line 319 of file CompiledSouffle.h.

322  {
323  for (const auto& o : data) {
324  if (t == o) {
325  return true;
326  }
327  }

◆ insert() [2/3]

template<Relation::arity_type Arity_>
void souffle::t_info< Arity_ >::insert ( const t_tuple t)
inline

Definition at line 309 of file CompiledSouffle.h.

310  {
311  insert(t);
312  }
313  void insert(const RamDomain* ramDomain) {
314  insert_lock.lock();
315  t_tuple t;

◆ insert() [3/3]

template<Relation::arity_type Arity_>
void souffle::t_info< Arity_ >::insert ( const t_tuple t,
context  
)
inline

Definition at line 316 of file CompiledSouffle.h.

316  {
317  t.data[i] = ramDomain[i];
318  }

References i.

◆ printStatistics()

template<Relation::arity_type Arity_>
void souffle::t_info< Arity_ >::printStatistics ( std::ostream &  ) const
inline

Definition at line 348 of file CompiledSouffle.h.

◆ purge()

template<Relation::arity_type Arity_>
void souffle::t_info< Arity_ >::purge ( )
inline

Definition at line 345 of file CompiledSouffle.h.

◆ size()

template<Relation::arity_type Arity_>
std::size_t souffle::t_info< Arity_ >::size ( ) const
inline

Definition at line 339 of file CompiledSouffle.h.

339  {
340  data.clear();
341  }

References souffle::t_info< Arity_ >::data.

Field Documentation

◆ Arity

template<Relation::arity_type Arity_>
constexpr Relation::arity_type souffle::t_info< Arity_ >::Arity = Arity_
staticconstexpr

Definition at line 272 of file CompiledSouffle.h.

◆ data

template<Relation::arity_type Arity_>
std::vector<Tuple<RamDomain, Arity> > souffle::t_info< Arity_ >::data
private

◆ insert_lock

template<Relation::arity_type Arity_>
Lock souffle::t_info< Arity_ >::insert_lock
private

Definition at line 352 of file CompiledSouffle.h.

Referenced by souffle::t_info< Arity_ >::begin().


The documentation for this class was generated from the following file:
souffle::RamDomain
int32_t RamDomain
Definition: RamTypes.h:56
souffle::Lock::lock
void lock()
Definition: ParallelUtil.h:475
souffle::t_info::insert_lock
Lock insert_lock
Definition: CompiledSouffle.h:352
i
size_t i
Definition: json11.h:663
souffle::t_info::t_tuple
Tuple< RamDomain, Arity > t_tuple
Definition: CompiledSouffle.h:275
souffle::t_info::size
std::size_t size() const
Definition: CompiledSouffle.h:339
o
var o
Definition: htmlJsChartistMin.h:15
souffle::t_info::data
std::vector< Tuple< RamDomain, Arity > > data
Definition: CompiledSouffle.h:351
souffle::t_info::contains
bool contains(const t_tuple &t) const
Definition: CompiledSouffle.h:328
souffle::t_info::insert
void insert(const t_tuple &t)
Definition: CompiledSouffle.h:309