Skip to content

Commit 99f0e00

Browse files
committed
working on doxygen stuff
1 parent 30330b6 commit 99f0e00

File tree

1 file changed

+42
-38
lines changed

1 file changed

+42
-38
lines changed

Deque.h

+42-38
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class my_deque {
521521
// ------------
522522

523523
/**
524-
* <your documentation>
524+
*
525525
*/
526526
explicit my_deque (const allocator_type& a = allocator_type()):_a(a) {
527527
const_reference v = value_type();
@@ -544,17 +544,7 @@ class my_deque {
544544
assert(valid());}
545545

546546
/**
547-
* <your documentation>
548-
* allocator_type _a; // allocator for inner arrays
549-
B _b; //allocator for outer array?
550-
b_pointer _top; //points to first container
551-
pointer _e; //end of size
552-
pointer _b; // begining
553-
//pointer_l; //for capacity of current
554-
difference_type _top_size;
555-
difference_type offset;
556-
size_type size;
557-
547+
*
558548
*/
559549
explicit my_deque (size_type s, const_reference v = value_type(), const allocator_type& a = allocator_type()): _a(a) {
560550
_top = _outter.allocate((s/AWIDTH + 1)*2);
@@ -587,6 +577,7 @@ class my_deque {
587577

588578
/**
589579
* Copy Constructor
580+
*
590581
*/
591582
my_deque (const my_deque& that):_a(that._a) {
592583
_top = _outter.allocate(that._top_size);
@@ -607,7 +598,7 @@ class my_deque {
607598
// ----------
608599

609600
/**
610-
* <your documentation>
601+
* deque constructor
611602
*/
612603
~my_deque () {
613604
//call _a.destroy(); and then deallocate each array, then deallocate outside array
@@ -622,7 +613,8 @@ class my_deque {
622613
// ----------
623614

624615
/**
625-
* <your documentation>
616+
* @ret my_deque&
617+
* sets this to the deque passed in
626618
*/
627619
my_deque& operator = (const my_deque& rhs) {
628620
clear();
@@ -642,7 +634,8 @@ class my_deque {
642634
// -----------
643635

644636
/**
645-
* <your documentation>
637+
* @param size_type index, used to index into the deque
638+
* @ret returns a reference of the object at the location index
646639
*/
647640
reference operator [] (size_type index) {
648641
// dummy is just to be able to compile the skeleton, remove it
@@ -664,7 +657,8 @@ class my_deque {
664657
return dummy;}
665658

666659
/**
667-
* <your documentation>
660+
* @param size_type index, used to index into the deque
661+
* @ret returns a reference of the object at the location index
668662
*/
669663
const_reference operator [] (size_type index) const {
670664
return const_cast<my_deque*>(this)->operator[](index);}
@@ -674,15 +668,17 @@ class my_deque {
674668
// --
675669

676670
/**
677-
* <your documentation>
671+
*@param size_type index, used to index into the deque
672+
* @ret returns a reference of the object at the location index
678673
*/
679674
reference at (size_type index) {
680675
//
681676
// dummy is just to be able to compile the skeleton, remove it
682677
return this->operator[](index);}
683678

684679
/**
685-
* <your documentation>
680+
* @param size_type index, used to index into the deque
681+
* @ret returns a reference of the object at the location index
686682
*/
687683
const_reference at (size_type index) const {
688684
return const_cast<my_deque*>(this)->at(index);}
@@ -692,14 +688,14 @@ class my_deque {
692688
// ----
693689

694690
/**
695-
* <your documentation>
691+
* @ret object at the end of the array
696692
*/
697693
reference back () {
698694
// dummy is just to be able to compile the skeleton, remove it
699695
return *(--end());}
700696

701697
/**
702-
* <your documentation>
698+
* @ret object at the end of the array
703699
*/
704700
const_reference back () const {
705701
return const_cast<my_deque*>(this)->back();}
@@ -709,13 +705,13 @@ class my_deque {
709705
// -----
710706

711707
/**
712-
* <your documentation>
708+
* @ret returns iterator pointing to the first element
713709
*/
714710
iterator begin () {
715711
return iterator(0, *this);}
716712

717713
/**
718-
* <your documentation>
714+
* @ret iterator that points to 1 position past the end of the deque
719715
*/
720716
const_iterator begin () const {
721717
return const_iterator(0, *this);}
@@ -725,7 +721,7 @@ class my_deque {
725721
// -----
726722

727723
/**
728-
* <your documentation>
724+
* clears the array
729725
*/
730726
void clear () {
731727
resize(0);
@@ -736,7 +732,7 @@ class my_deque {
736732
// -----
737733

738734
/**
739-
* <your documentation>
735+
* @ret a bool if the deque is empty
740736
*/
741737
bool empty () const {
742738
return !size();}
@@ -746,13 +742,14 @@ class my_deque {
746742
// ---
747743

748744
/**
749-
* <your documentation>
745+
* @ret iterator that points to 1 position past the end of the deque
746+
750747
*/
751748
iterator end () {
752749
return iterator(_size, *this);}
753750

754751
/**
755-
* <your documentation>
752+
* @ret const_iterator that points to 1 position past the end of the deque
756753
*/
757754
const_iterator end () const {
758755
return const_iterator(_size, *this);}
@@ -763,7 +760,8 @@ class my_deque {
763760

764761
/**
765762
* @param iterator iter, points to location to be erased
766-
* result: size()==
763+
* @ret an iterator pointing to the location that was erased
764+
* erases the object at iter
767765
*/
768766
iterator erase (iterator iter) {
769767
if (iter==end())
@@ -785,7 +783,7 @@ class my_deque {
785783
// -----
786784

787785
/**
788-
* <your documentation>
786+
* @ret const_reference the object at the front of the array
789787
*/
790788
reference front () {
791789
// <your code>
@@ -794,7 +792,7 @@ class my_deque {
794792
return dummy;}
795793

796794
/**
797-
* <your documentation>
795+
* @ret const_reference the object at the front of the array
798796
*/
799797
const_reference front () const {
800798
return const_cast<my_deque*>(this)->front();}
@@ -804,8 +802,10 @@ class my_deque {
804802
// ------
805803

806804
/**
807-
* <your documentation>
805+
* @param iterator iter points to the location to insert
806+
* @const_reference val value to insert
808807
* @ret iterator pointing to spot where inserted
808+
* pushes stuff at the location iter and afterwards backwards 1 and inserts val
809809
*/
810810
iterator insert (iterator iter, const_reference val) {
811811
resize(_size+1);
@@ -825,14 +825,14 @@ class my_deque {
825825
// ---
826826

827827
/**
828-
* <your documentation>
828+
* removes the last element
829829
*/
830830
void pop_back () {
831831
this->resize(_size-1);
832832
assert(valid());}
833833

834834
/**
835-
* <your documentation>
835+
* removes the first element
836836
*/
837837
void pop_front () {
838838
if (_offset == AWIDTH-1){
@@ -851,14 +851,16 @@ class my_deque {
851851
// ----
852852

853853
/**
854-
* <your documentation>
854+
* @param const_reference val
855+
* pushes val to the bac of the array
855856
*/
856857
void push_back (const_reference val) {
857858
resize(_size+1, val);
858859
assert(valid());}
859860

860861
/**
861-
* <your documentation>
862+
* @param const_reference val
863+
* pushes val to the front of the array, deque[0] returns val
862864
*/
863865
void push_front (const_reference val) {
864866
if(_offset == 0 && _b == 0)
@@ -879,8 +881,9 @@ class my_deque {
879881
// ------
880882

881883
/**
882-
* User-level, number of objects
883-
* <your documentation>
884+
* @param size_type s the size to change the deque to
885+
* @param const_reference v the value to initialize each new spot to
886+
* resizes the deque, adds/ removes space from the back
884887
*/
885888
void resize (size_type s, const_reference v = value_type()) {
886889
//if longer but within _top_size but if allocated
@@ -939,7 +942,7 @@ class my_deque {
939942
// ----
940943

941944
/**
942-
* <your documentation>
945+
* @ret returns the size_type size of this deque
943946
*/
944947
size_type size () const {
945948
// <your code>
@@ -950,7 +953,8 @@ class my_deque {
950953
// ----
951954

952955
/**
953-
* <your documentation>
956+
* @param my_deque&
957+
* changes all of the containers and info from this deque into the one passed in
954958
*/
955959
void swap (my_deque& that) {
956960
std::swap (this->_a, that._a); // allocator for inner arrays

0 commit comments

Comments
 (0)