Static Value-Flow Analysis
Public Member Functions | Private Types | Private Attributes | List of all members
SVF::FILOWorkList< Data > Class Template Reference

#include <WorkList.h>

Public Member Functions

 FILOWorkList ()
 
 ~FILOWorkList ()
 
bool empty () const
 
u32_t size () const
 
bool find (const Data &data) const
 
bool push (const Data &data)
 
Data pop ()
 
void removeBack ()
 
Data & back ()
 
void clear ()
 

Private Types

typedef Set< Data > DataSet
 
typedef std::vector< Data > DataVector
 

Private Attributes

DataSet data_set
 store all data in the work list. More...
 
DataVector data_list
 work list using std::vector. More...
 

Detailed Description

template<class Data>
class SVF::FILOWorkList< Data >

Worklist with "first in last out" order. New nodes will be pushed at back and popped from back. Elements in the list are unique as they're recorded by Set.

Definition at line 229 of file WorkList.h.

Member Typedef Documentation

◆ DataSet

template<class Data >
typedef Set<Data> SVF::FILOWorkList< Data >::DataSet
private

Definition at line 231 of file WorkList.h.

◆ DataVector

template<class Data >
typedef std::vector<Data> SVF::FILOWorkList< Data >::DataVector
private

Definition at line 232 of file WorkList.h.

Constructor & Destructor Documentation

◆ FILOWorkList()

template<class Data >
SVF::FILOWorkList< Data >::FILOWorkList ( )
inline

Definition at line 234 of file WorkList.h.

234 {}

◆ ~FILOWorkList()

template<class Data >
SVF::FILOWorkList< Data >::~FILOWorkList ( )
inline

Definition at line 236 of file WorkList.h.

236 {}

Member Function Documentation

◆ back()

template<class Data >
Data& SVF::FILOWorkList< Data >::back ( )
inline

Get reference of top data from the END of work list.

Definition at line 294 of file WorkList.h.

295  {
296  assert(!empty() && "work list is empty");
297  Data &data = data_list.back();
298  return data;
299  }
bool empty() const
Definition: WorkList.h:238
DataVector data_list
work list using std::vector.
Definition: WorkList.h:312

◆ clear()

template<class Data >
void SVF::FILOWorkList< Data >::clear ( void  )
inline

Clear all the data

Definition at line 304 of file WorkList.h.

305  {
306  data_list.clear();
307  data_set.clear();
308  }
DataSet data_set
store all data in the work list.
Definition: WorkList.h:311

◆ empty()

template<class Data >
bool SVF::FILOWorkList< Data >::empty ( void  ) const
inline

Definition at line 238 of file WorkList.h.

239  {
240  return data_list.empty();
241  }

◆ find()

template<class Data >
bool SVF::FILOWorkList< Data >::find ( const Data &  data) const
inline

Definition at line 249 of file WorkList.h.

250  {
251  return data_set.find(data) != data_set.end();;
252  }

◆ pop()

template<class Data >
Data SVF::FILOWorkList< Data >::pop ( )
inline

Pop a data from the END of work list.

Definition at line 272 of file WorkList.h.

273  {
274  assert(!empty() && "work list is empty");
275  Data data = data_list.back();
276  data_list.pop_back();
277  data_set.erase(data);
278  return data;
279  }

◆ push()

template<class Data >
bool SVF::FILOWorkList< Data >::push ( const Data &  data)
inline

Push a data into the work list.

Definition at line 257 of file WorkList.h.

258  {
259  if (!find(data))
260  {
261  data_list.push_back(data);
262  data_set.insert(data);
263  return true;
264  }
265  else
266  return false;
267  }
bool find(const Data &data) const
Definition: WorkList.h:249

◆ removeBack()

template<class Data >
void SVF::FILOWorkList< Data >::removeBack ( )
inline

Remove a data from the END of work list, no return value

Definition at line 284 of file WorkList.h.

285  {
286  assert(!empty() && "work list is empty");
287  data_set.erase(back());
288  data_list.pop_back();
289  }
Data & back()
Definition: WorkList.h:294

◆ size()

template<class Data >
u32_t SVF::FILOWorkList< Data >::size ( ) const
inline

Definition at line 243 of file WorkList.h.

244  {
245  assert(data_list.size() == data_set.size() && "list and set must be the same size!");
246  return data_list.size();
247  }

Member Data Documentation

◆ data_list

template<class Data >
DataVector SVF::FILOWorkList< Data >::data_list
private

work list using std::vector.

Definition at line 312 of file WorkList.h.

◆ data_set

template<class Data >
DataSet SVF::FILOWorkList< Data >::data_set
private

store all data in the work list.

Definition at line 311 of file WorkList.h.


The documentation for this class was generated from the following files: