Z3
Data Structures | Public Member Functions | Friends
ast_vector_tpl< T > Class Template Reference
+ Inheritance diagram for ast_vector_tpl< T >:

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 (context &c, ast_vector_tpl const &src)
 
 ~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
 
- Public Member Functions inherited from object
 object (context &c)
 
 object (object const &s)
 
contextctx () const
 
Z3_error_code check_error () const
 

Friends

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

Additional Inherited Members

- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ ast_vector_tpl() [1/4]

ast_vector_tpl ( context c)
inline

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

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

◆ ast_vector_tpl() [2/4]

ast_vector_tpl ( context c,
Z3_ast_vector  v 
)
inline

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

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

◆ ast_vector_tpl() [3/4]

ast_vector_tpl ( ast_vector_tpl< T > const &  s)
inline

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

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

◆ ast_vector_tpl() [4/4]

ast_vector_tpl ( context c,
ast_vector_tpl< T > const &  src 
)
inline

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

532 : object(c) { init(Z3_ast_vector_translate(src.ctx(), src, c)); }

◆ ~ast_vector_tpl()

~ast_vector_tpl ( )
inline

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

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

Member Function Documentation

◆ back()

T back ( ) const
inline

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

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

◆ begin()

iterator begin ( ) const
inline

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

587 { return iterator(this, 0); }

Referenced by optimize::add().

◆ empty()

bool empty ( ) const
inline

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

542 { return size() == 0; }

◆ end()

iterator end ( ) const
inline

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

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

Referenced by optimize::add().

◆ operator Z3_ast_vector()

operator Z3_ast_vector ( ) const
inline

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

535 { return m_vector; }

◆ operator=()

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

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

543  {
544  Z3_ast_vector_inc_ref(s.ctx(), s.m_vector);
545  Z3_ast_vector_dec_ref(ctx(), m_vector);
546  m_ctx = s.m_ctx;
547  m_vector = s.m_vector;
548  return *this;
549  }

◆ operator[]()

T operator[] ( int  i) const
inline

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

537 { 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 541 of file z3++.h.

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

◆ push_back()

void push_back ( T const &  e)
inline

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

538 { 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 539 of file z3++.h.

539 { 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 550 of file z3++.h.

550  {
551  Z3_ast_vector_set(ctx(), m_vector, idx, a);
552  return *this;
553  }

◆ 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 589 of file z3++.h.

589 { out << Z3_ast_vector_to_string(v.ctx(), v); return out; }
z3::ast_vector_tpl::resize
void resize(unsigned sz)
Definition: z3++.h:539
Z3_ast_vector_translate
Z3_ast_vector Z3_API Z3_ast_vector_translate(Z3_context s, Z3_ast_vector v, Z3_context t)
Translate the AST vector v from context s into an AST vector in context t.
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:536
z3::object::object
object(context &c)
Definition: z3++.h:416
z3::object::m_ctx
context * m_ctx
Definition: z3++.h:414
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:537
z3::object::check_error
Z3_error_code check_error() const
Definition: z3++.h:419
z3::object::ctx
context & ctx() const
Definition: z3++.h:418