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

#include <ConditionalPT.h>

Public Types

typedef OrderedSet< Element >::iterator iterator
 
typedef OrderedSet< Element >::const_iterator const_iterator
 

Public Member Functions

 CondStdSet ()
 
 ~CondStdSet ()
 
 CondStdSet (const CondStdSet< Element > &cptsSet)
 Copy constructor. More...
 
bool test_and_set (const Element &var)
 Return true if the element is added. More...
 
bool test (const Element &var) const
 Return true if the element is in the set. More...
 
void set (const Element &var)
 Add the element into set. More...
 
void reset (const Element &var)
 Remove var from the set. More...
 
bool empty () const
 Set size. More...
 
unsigned size () const
 
unsigned count () const
 
void clear ()
 Clear set. More...
 
iterator begin ()
 Iterators. More...
 
iterator end ()
 
iterator begin () const
 
iterator end () const
 
bool operator|= (const CondStdSet< Element > &rhs)
 Overload operators. More...
 
bool operator&= (const CondStdSet< Element > &rhs)
 
bool operator!= (const CondStdSet< Element > &rhs) const
 
bool operator== (const CondStdSet< Element > &rhs) const
 
CondStdSet< Element > & operator= (const CondStdSet< Element > &rhs)
 
bool operator< (const CondStdSet< Element > &rhs) const
 
bool intersects (const CondStdSet< Element > &rhs) const
 
std::string toString () const
 
const ElementSetgetElementSet () const
 
void checkAndRemap (void) const
 TODO: dummy to use for PointsTo in the various PTData. More...
 

Private Types

typedef OrderedSet< Element > ElementSet
 

Private Attributes

ElementSet elements
 

Detailed Description

template<class Element>
class SVF::CondStdSet< Element >

Conditional variable set

Definition at line 131 of file ConditionalPT.h.

Member Typedef Documentation

◆ const_iterator

template<class Element >
typedef OrderedSet<Element>::const_iterator SVF::CondStdSet< Element >::const_iterator

Definition at line 137 of file ConditionalPT.h.

◆ ElementSet

template<class Element >
typedef OrderedSet<Element> SVF::CondStdSet< Element >::ElementSet
private

Definition at line 133 of file ConditionalPT.h.

◆ iterator

template<class Element >
typedef OrderedSet<Element>::iterator SVF::CondStdSet< Element >::iterator

Definition at line 136 of file ConditionalPT.h.

Constructor & Destructor Documentation

◆ CondStdSet() [1/2]

template<class Element >
SVF::CondStdSet< Element >::CondStdSet ( )
inline

Definition at line 139 of file ConditionalPT.h.

139 {}

◆ ~CondStdSet()

template<class Element >
SVF::CondStdSet< Element >::~CondStdSet ( )
inline

Definition at line 140 of file ConditionalPT.h.

140 {}

◆ CondStdSet() [2/2]

template<class Element >
SVF::CondStdSet< Element >::CondStdSet ( const CondStdSet< Element > &  cptsSet)
inline

Copy constructor.

Definition at line 143 of file ConditionalPT.h.

143  : elements(cptsSet.getElementSet())
144  {
145  }
ElementSet elements

Member Function Documentation

◆ begin() [1/2]

template<class Element >
iterator SVF::CondStdSet< Element >::begin ( )
inline

Iterators.

Definition at line 192 of file ConditionalPT.h.

193  {
194  return elements.begin();
195  }

◆ begin() [2/2]

template<class Element >
iterator SVF::CondStdSet< Element >::begin ( ) const
inline

Definition at line 200 of file ConditionalPT.h.

201  {
202  return elements.begin();
203  }

◆ checkAndRemap()

template<class Element >
void SVF::CondStdSet< Element >::checkAndRemap ( void  ) const
inline

TODO: dummy to use for PointsTo in the various PTData.

Definition at line 293 of file ConditionalPT.h.

293 { }

◆ clear()

template<class Element >
void SVF::CondStdSet< Element >::clear ( )
inline

Clear set.

Definition at line 185 of file ConditionalPT.h.

186  {
187  elements.clear();
188  }

◆ count()

template<class Element >
unsigned SVF::CondStdSet< Element >::count ( ) const
inline

Definition at line 178 of file ConditionalPT.h.

179  {
180  return size();
181  }
unsigned size() const

◆ empty()

template<class Element >
bool SVF::CondStdSet< Element >::empty ( ) const
inline

Set size.

Definition at line 170 of file ConditionalPT.h.

171  {
172  return elements.empty();
173  }

◆ end() [1/2]

template<class Element >
iterator SVF::CondStdSet< Element >::end ( )
inline

Definition at line 196 of file ConditionalPT.h.

197  {
198  return elements.end();
199  }

◆ end() [2/2]

template<class Element >
iterator SVF::CondStdSet< Element >::end ( ) const
inline

Definition at line 204 of file ConditionalPT.h.

205  {
206  return elements.end();
207  }

◆ getElementSet()

template<class Element >
const ElementSet& SVF::CondStdSet< Element >::getElementSet ( ) const
inline

Definition at line 287 of file ConditionalPT.h.

288  {
289  return elements;
290  }

◆ intersects()

template<class Element >
bool SVF::CondStdSet< Element >::intersects ( const CondStdSet< Element > &  rhs) const
inline

Return TRUE if this and RHS share common elements.

Definition at line 261 of file ConditionalPT.h.

262  {
263  if (empty() && rhs.empty())
264  return false;
265 
266  for (const_iterator i = rhs.begin(); i != rhs.end(); ++i)
267  {
268  if (elements.find(*i) != elements.end())
269  return true;
270  }
271  return false;
272  }
bool empty() const
Set size.
OrderedSet< Element >::const_iterator const_iterator

◆ operator!=()

template<class Element >
bool SVF::CondStdSet< Element >::operator!= ( const CondStdSet< Element > &  rhs) const
inline

Definition at line 236 of file ConditionalPT.h.

237  {
238  return elements!=rhs.getElementSet();
239  }

◆ operator&=()

template<class Element >
bool SVF::CondStdSet< Element >::operator&= ( const CondStdSet< Element > &  rhs)
inline

Definition at line 221 of file ConditionalPT.h.

222  {
223  if(rhs.empty() || (*this == rhs))
224  return false;
225  bool changed = false;
226  for (const_iterator i = rhs.begin(); i != rhs.end(); ++i)
227  {
228  if (elements.find(*i) == elements.end())
229  {
230  elements.erase(*i);
231  changed = true;
232  }
233  }
234  return changed;
235  }

◆ operator<()

template<class Element >
bool SVF::CondStdSet< Element >::operator< ( const CondStdSet< Element > &  rhs) const
inline

Definition at line 252 of file ConditionalPT.h.

253  {
254  return elements < rhs.getElementSet();
255  }

◆ operator=()

template<class Element >
CondStdSet<Element>& SVF::CondStdSet< Element >::operator= ( const CondStdSet< Element > &  rhs)
inline

Definition at line 244 of file ConditionalPT.h.

245  {
246  if(*this!=rhs)
247  {
248  elements = rhs.getElementSet();
249  }
250  return *this;
251  }

◆ operator==()

template<class Element >
bool SVF::CondStdSet< Element >::operator== ( const CondStdSet< Element > &  rhs) const
inline

Definition at line 240 of file ConditionalPT.h.

241  {
242  return ((*this != rhs) == false);
243  }

◆ operator|=()

template<class Element >
bool SVF::CondStdSet< Element >::operator|= ( const CondStdSet< Element > &  rhs)
inline

Overload operators.

Definition at line 212 of file ConditionalPT.h.

213  {
214  const ElementSet& rhsElementSet = rhs.getElementSet();
215  if(rhsElementSet.empty() || (*this==rhs))
216  return false;
217  u32_t oldSize = elements.size();
218  elements.insert(rhsElementSet.begin(),rhsElementSet.end());
219  return oldSize!=elements.size();
220  }
unsigned u32_t
Definition: CommandLine.h:18
OrderedSet< Element > ElementSet

◆ reset()

template<class Element >
void SVF::CondStdSet< Element >::reset ( const Element &  var)
inline

Remove var from the set.

Definition at line 163 of file ConditionalPT.h.

164  {
165  elements.erase(var);
166  }

◆ set()

template<class Element >
void SVF::CondStdSet< Element >::set ( const Element &  var)
inline

Add the element into set.

Definition at line 158 of file ConditionalPT.h.

159  {
160  elements.insert(var);
161  }

◆ size()

template<class Element >
unsigned SVF::CondStdSet< Element >::size ( ) const
inline

Definition at line 174 of file ConditionalPT.h.

175  {
176  return elements.size();
177  }

◆ test()

template<class Element >
bool SVF::CondStdSet< Element >::test ( const Element &  var) const
inline

Return true if the element is in the set.

Definition at line 153 of file ConditionalPT.h.

154  {
155  return (elements.find(var) != elements.end());
156  }

◆ test_and_set()

template<class Element >
bool SVF::CondStdSet< Element >::test_and_set ( const Element &  var)
inline

Return true if the element is added.

Definition at line 148 of file ConditionalPT.h.

149  {
150  return elements.insert(var).second;
151  }

◆ toString()

template<class Element >
std::string SVF::CondStdSet< Element >::toString ( ) const
inline

Definition at line 274 of file ConditionalPT.h.

275  {
276  std::string str;
277  std::stringstream rawstr(str);
278  rawstr << "{ ";
279  for (const_iterator i = elements.begin(); i != elements.end(); ++i)
280  {
281  rawstr << (*i).toString() << " ";
282  }
283  rawstr << "} ";
284  return rawstr.str();
285  }
const char *const string
Definition: cJSON.h:172

Member Data Documentation

◆ elements

template<class Element >
ElementSet SVF::CondStdSet< Element >::elements
private

Definition at line 296 of file ConditionalPT.h.


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