|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



QUEUE METHODS



OpenVera provides the following types of built-in methods for analyzing and manipulating smart queue elements.
# Add/Delete
- delete()
- insert()
# Order
- reverse()
- rsort()
- sort()
- sum()
# Push/Pop
- pop_back()
- pop_front()
- push_back()
- push_front()
# Random
- pick()
- pick_index()
- unique()
- unique_index()
# Search
- find()
- find_index()
- first()
- first_index()
- last()
- last_index()
- max()
- max_index()
- min()
- min_index()
# Size
- capacity()
- empty()
- reserve()
- size()



EXAMPLE :
program main{
integer que[$];
printf(" size of queue %d \n",que.size());
que.push_back(10);
que.push_front(2);
printf(" pop_back is %d \n",que.pop_back());
printf(" pop_front is %d \n",que.pop_front());

que.push_back(1);
que.push_back(2);
que.push_back(3);
printf(" size of queue %d \n",que.size());
que.insert(2,6);
printf(" pop_back is %d \n",que.pop_back());
printf(" pop_back is %d \n",que.pop_back());
}

RESULTS

size of queue 0
pop_back is 10
pop_front is 2
size of queue 3
pop_back is 3
pop_back is 6

Index
Introduction
Data Types
Linked List
Operators Part 1
Operators Part 2
Operators Part 3
Operator Precedence
Control Statements
Procedures And Methods
Interprocess
Fork Join
Shadow Variables
Fork Join Control
Wait Var
Event Sync
Event Trigger
Semaphore
Regions
Mailbox
Timeouts
Oop
Casting
Randomization
Randomization Methods
Constraint Block
Constraint Expression
Variable Ordaring
Aop
Predefined Methods
String Methods
Queue Methods
Dut Communication
Functional Coverage

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright © 2007-2017 :: all rights reserved www.testbench.in::Disclaimer