Z3
Data Structures | Public Member Functions | Friends
ast_vector_tpl< T > Class Template Reference

Data Structures

class  iterator
 

Public Member Functions

 ast_vector_tpl (context &c)
 
 ast_vector_tpl (context &c, Z3_ast_vector v)
 
 ast_vector_tpl (ast_vector_tpl const &s)
 
 ~ast_vector_tpl ()
 
 operator Z3_ast_vector () const
 
unsigned size () const
 
operator[] (int i) const
 
void push_back (T const &e)
 
void resize (unsigned sz)
 
back () const
 
void pop_back ()
 
bool empty () const
 
ast_vector_tploperator= (ast_vector_tpl const &s)
 
ast_vector_tplset (unsigned idx, ast &a)
 
iterator begin () const
 
iterator end () const
 

Friends

std::ostream & operator<< (std::ostream &out, ast_vector_tpl const &v)
 

Detailed Description

template<typename T>
class z3::ast_vector_tpl< T >

Definition at line 69 of file z3++.h.

Constructor & Destructor Documentation

◆ ast_vector_tpl() [1/3]

ast_vector_tpl ( context c)
inline

Definition at line 1861 of file z3++.h.

1861 :object(c) { init(Z3_mk_ast_vector(c)); }

◆ ast_vector_tpl() [2/3]

ast_vector_tpl ( context c,
Z3_ast_vector  v 
)
inline

Definition at line 1862 of file z3++.h.

1862 :object(c) { init(v); }

◆ ast_vector_tpl() [3/3]

ast_vector_tpl ( ast_vector_tpl< T > const &  s)
inline

Definition at line 1863 of file z3++.h.

1863 :object(s), m_vector(s.m_vector) { Z3_ast_vector_inc_ref(ctx(), m_vector); }

◆ ~ast_vector_tpl()

~ast_vector_tpl ( )
inline

Definition at line 1864 of file z3++.h.

1864 { Z3_ast_vector_dec_ref(ctx(), m_vector); }

Member Function Documentation

◆ back()

T back ( ) const
inline

Definition at line 1870 of file z3++.h.

1870 { return operator[](size() - 1); }

◆ begin()

iterator begin ( ) const
inline

Definition at line 1917 of file z3++.h.

1917 { return iterator(this, 0); }

◆ empty()

bool empty ( ) const
inline

Definition at line 1872 of file z3++.h.

1872 { return size() == 0; }

◆ end()

iterator end ( ) const
inline

Definition at line 1918 of file z3++.h.

1918 { return iterator(this, size()); }

◆ operator Z3_ast_vector()

operator Z3_ast_vector ( ) const
inline

Definition at line 1865 of file z3++.h.

1865 { return m_vector; }

◆ operator=()

ast_vector_tpl& operator= ( ast_vector_tpl< T > const &  s)
inline

Definition at line 1873 of file z3++.h.

1873  {
1874  Z3_ast_vector_inc_ref(s.ctx(), s.m_vector);
1875  Z3_ast_vector_dec_ref(ctx(), m_vector);
1876  m_ctx = s.m_ctx;
1877  m_vector = s.m_vector;
1878  return *this;
1879  }

◆ operator[]()

T operator[] ( int  i) const
inline

Definition at line 1867 of file z3++.h.

1867 { assert(0 <= i); Z3_ast r = Z3_ast_vector_get(ctx(), m_vector, i); check_error(); return cast_ast<T>()(ctx(), r); }

Referenced by ast_vector_tpl< expr >::back().

◆ pop_back()

void pop_back ( )
inline

Definition at line 1871 of file z3++.h.

1871 { assert(size() > 0); resize(size() - 1); }

◆ push_back()

void push_back ( T const &  e)
inline

Definition at line 1868 of file z3++.h.

1868 { Z3_ast_vector_push(ctx(), m_vector, e); check_error(); }

Referenced by context::enumeration_sort(), and context::tuple_sort().

◆ resize()

void resize ( unsigned  sz)
inline

Definition at line 1869 of file z3++.h.

1869 { Z3_ast_vector_resize(ctx(), m_vector, sz); check_error(); }

Referenced by ast_vector_tpl< expr >::pop_back().

◆ set()

ast_vector_tpl& set ( unsigned  idx,
ast a 
)
inline

Definition at line 1880 of file z3++.h.

1880  {
1881  Z3_ast_vector_set(ctx(), m_vector, idx, a);
1882  return *this;
1883  }

◆ size()

unsigned size ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
ast_vector_tpl< T > const &  v 
)
friend

Definition at line 1919 of file z3++.h.

1919 { out << Z3_ast_vector_to_string(v.ctx(), v); return out; }
z3::ast_vector_tpl::resize
void resize(unsigned sz)
Definition: z3++.h:1869
Z3_ast_vector_push
void Z3_API Z3_ast_vector_push(Z3_context c, Z3_ast_vector v, Z3_ast a)
Add the AST a in the end of the AST vector v. The size of v is increased by one.
Z3_ast_vector_size
unsigned Z3_API Z3_ast_vector_size(Z3_context c, Z3_ast_vector v)
Return the size of the given AST vector.
z3::ast_vector_tpl::size
unsigned size() const
Definition: z3++.h:1866
Z3_ast_vector_to_string
Z3_string Z3_API Z3_ast_vector_to_string(Z3_context c, Z3_ast_vector v)
Convert AST vector into a string.
Z3_ast_vector_dec_ref
void Z3_API Z3_ast_vector_dec_ref(Z3_context c, Z3_ast_vector v)
Decrement the reference counter of the given AST vector.
Z3_ast_vector_inc_ref
void Z3_API Z3_ast_vector_inc_ref(Z3_context c, Z3_ast_vector v)
Increment the reference counter of the given AST vector.
Z3_ast_vector_set
void Z3_API Z3_ast_vector_set(Z3_context c, Z3_ast_vector v, unsigned i, Z3_ast a)
Update position i of the AST vector v with the AST a.
Z3_ast_vector_get
Z3_ast Z3_API Z3_ast_vector_get(Z3_context c, Z3_ast_vector v, unsigned i)
Return the AST at position i in the AST vector v.
Z3_mk_ast_vector
Z3_ast_vector Z3_API Z3_mk_ast_vector(Z3_context c)
Return an empty AST vector.
Z3_ast_vector_resize
void Z3_API Z3_ast_vector_resize(Z3_context c, Z3_ast_vector v, unsigned n)
Resize the AST vector v.
z3::ast_vector_tpl::operator[]
T operator[](int i) const
Definition: z3++.h:1867