Skip to content

Commit

Permalink
API comments: html to markup style
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongho Nam committed Jan 14, 2017
1 parent c4ed516 commit 97aa9dd
Show file tree
Hide file tree
Showing 56 changed files with 2,516 additions and 2,523 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ======================================================
# CUSTOM IGNORE
# ======================================================
handbook/
lib/

*.bat
*.lnk
1 change: 0 additions & 1 deletion ts/src/std/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace std
{
}


/**
* Base classes composing STL in background.
*
Expand Down
1,448 changes: 732 additions & 716 deletions ts/src/std/Algorithm.ts

Large diffs are not rendered by default.

125 changes: 62 additions & 63 deletions ts/src/std/Deque.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@

namespace std.Deque
{
export type iterator<T> = std.DequeIterator<T>;
export type reverse_iterator<T> = std.DequeReverseIterator<T>;
export type iterator<T> = DequeIterator<T>;
export type reverse_iterator<T> = DequeReverseIterator<T>;
}

namespace std
{
/**
* <p> Double ended queue. </p>
* Double ended queue.
*
* <p> {@link Deque} (usually pronounced like "<i>deck</i>") is an irregular acronym of
* {@link Deque} (usually pronounced like "<i>deck</i>") is an irregular acronym of
* <b>d</b>ouble-<b>e</b>nded <b>q</b>ueue. Double-ended queues are sequence containers with dynamic sizes that can be
* expanded or contracted on both ends (either its front or its back). </p>
* expanded or contracted on both ends (either its front or its back).
*
* <p> Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any
* Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any
* case, they allow for the individual elements to be accessed directly through random access iterators, with storage
* handled automatically by expanding and contracting the container as needed. </p>
* handled automatically by expanding and contracting the container as needed.
*
* <p> Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of
* Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of
* elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors},
* {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing
* elements in a <u>deque</u> by offsetting a pointer to another element causes undefined behavior. </p>
* elements in a <u>deque</u> by offsetting a pointer to another element causes undefined behavior.
*
* <p> Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes,
* Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes,
* but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be
* occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of
* storage, with the container keeping the necessary information internally to provide direct access to any of its
* elements in constant time and with a uniform sequential interface (through iterators). Therefore,
* {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more
* efficiently under certain circumstances, especially with very long sequences, where reallocations become more
* expensive. </p>
* expensive.
*
* <p> For operations that involve frequent insertion or removals of elements at positions other than the beginning or
* For operations that involve frequent insertion or removals of elements at positions other than the beginning or
* the end, {@link Deque Deques} perform worse and have less consistent iterators and references than
* {@link List Lists}. </p>
* {@link List Lists}.
*
* <p> <a href="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" target="_blank">
* <a href="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" target="_blank">
* <img src="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" style="max-width: 100%" /> </a>
* </p>
*
*
* <h3> Container properties </h3>
* ### Container properties
* <dl>
* <dt> Sequence </dt>
* <dd> Elements in sequence containers are ordered in a strict linear sequence. Individual elements
Expand Down Expand Up @@ -152,25 +152,25 @@ namespace std
CONSTURCTORS
--------------------------------------------------------- */
/**
* <p> Default Constructor. </p>
* Default Constructor.
*
* <p> Constructs an empty container, with no elements. </p>
* Constructs an empty container, with no elements.
*/
public constructor();

/**
* <p> Initializer list Constructor. </p>
* Initializer list Constructor.
*
* <p> Constructs a container with a copy of each of the elements in <i>array</i>, in the same order. </p>
* Constructs a container with a copy of each of the elements in <i>array</i>, in the same order.
*
* @param array An array containing elements to be copied and contained.
*/
public constructor(items: Array<T>);

/**
* <p> Fill Constructor. </p>
* Fill Constructor.
*
* <p> Constructs a container with <i>n</i> elements. Each element is a copy of <i>val</i> (if provided). </p>
* Constructs a container with <i>n</i> elements. Each element is a copy of <i>val</i> (if provided).
*
* @param n Initial container size (i.e., the number of elements in the container at construction).
* @param val Value to fill the container with. Each of the <i>n</i> elements in the container is
Expand All @@ -179,20 +179,20 @@ namespace std
public constructor(size: number, val: T);

/**
* <p> Copy Constructor. </p>
* Copy Constructor.
*
* <p> Constructs a container with a copy of each of the elements in <i>container</i>, in the same order. </p>
* Constructs a container with a copy of each of the elements in <i>container</i>, in the same order.
*
* @param container Another container object of the same type (with the same class template
* arguments <i>T</i>), whose contents are either copied or acquired.
*/
public constructor(container: Deque<T>);

/**
* <p> Range Constructor. </p>
* Range Constructor.
*
* <p> Constructs a container with as many elements as the range (<i>begin</i>, <i>end<i>), with each
* element emplace-constructed from its corresponding element in that range, in the same order. </p>
* Constructs a container with as many elements as the range (<i>begin</i>, <i>end<i>), with each
* element emplace-constructed from its corresponding element in that range, in the same order.
*
* @param begin Input interator of the initial position in a sequence.
* @param end Input interator of the final position in a sequence.
Expand Down Expand Up @@ -306,20 +306,20 @@ namespace std
}

/**
* <p> Request a change in capacity. </p>
* Request a change in capacity.
*
* <p> Requests that the {@link Deque container} {@link capacity} be at least enough to contain
* <i>n</i> elements. </p>
* Requests that the {@link Deque container} {@link capacity} be at least enough to contain
* <i>n</i> elements.
*
* <p> If <i>n</i> is greater than the current {@link Deque container} {@link capacity}, the
* If <i>n</i> is greater than the current {@link Deque container} {@link capacity}, the
* function causes the {@link Deque container} to reallocate its storage increasing its
* {@link capacity} to <i>n</i> (or greater). </p>
* {@link capacity} to <i>n</i> (or greater).
*
* <p> In all other cases, the function call does not cause a reallocation and the
* {@link Deque container} {@link capacity} is not affected. </p>
* In all other cases, the function call does not cause a reallocation and the
* {@link Deque container} {@link capacity} is not affected.
*
* <p> This function has no effect on the {@link Deque container} {@link size} and cannot alter
* its elements. </p>
* This function has no effect on the {@link Deque container} {@link size} and cannot alter
* its elements.
*
* @param n Minimum {@link capacity} for the {@link Deque container}.
* Note that the resulting {@link capacity} may be equal or greater than <i>n</i>.
Expand Down Expand Up @@ -425,23 +425,23 @@ namespace std
}

/**
* <p> Return size of allocated storage capacity. </p>
* Return size of allocated storage capacity.
*
* <p> Returns the size of the storage space currently allocated for the {@link Deque container},
* expressed in terms of elements. </p>
* Returns the size of the storage space currently allocated for the {@link Deque container},
* expressed in terms of elements.
*
* <p> This {@link capacity} is not necessarily equal to the {@link Deque container} {@link size}.
* This {@link capacity} is not necessarily equal to the {@link Deque container} {@link size}.
* It can be equal or greater, with the extra space allowing to accommodate for growth without the
* need to reallocate on each insertion. </p>
* need to reallocate on each insertion.
*
* <p> Notice that this {@link capacity} does not suppose a limit on the {@link size} of the
* Notice that this {@link capacity} does not suppose a limit on the {@link size} of the
* {@link Deque container}. When this {@link capacity} is exhausted and more is needed, it is
* automatically expanded by the {@link Deque container} (reallocating it storage space).
* The theoretical limit on the {@link size} of a {@link Deque container} is given by member
* {@link max_size}. </p>
* {@link max_size}.
*
* <p> The {@link capacity} of a {@link Deque container} can be explicitly altered by calling member
* {@link Deque.reserve}. </p>
* The {@link capacity} of a {@link Deque container} can be explicitly altered by calling member
* {@link Deque.reserve}.
*
* @return The size of the currently allocated storage capacity in the {@link Deque container},
* measured in terms of the number elements it can hold.
Expand Down Expand Up @@ -895,17 +895,17 @@ namespace std
SWAP
--------------------------------------------------------- */
/**
* <p> Swap content. </p>
* Swap content.
*
* <p> Exchanges the content of the container by the content of <i>obj</i>, which is another
* {@link Deque container} object with same type of elements. Sizes and container type may differ. </p>
* Exchanges the content of the container by the content of <i>obj</i>, which is another
* {@link Deque container} object with same type of elements. Sizes and container type may differ.
*
* <p> After the call to this member function, the elements in this container are those which were in <i>obj</i>
* After the call to this member function, the elements in this container are those which were in <i>obj</i>
* before the call, and the elements of <i>obj</i> are those which were in this. All iterators, references and
* pointers remain valid for the swapped objects. </p>
* pointers remain valid for the swapped objects.
*
* <p> Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that
* algorithm with an optimization that behaves like this member function. </p>
* Notice that a non-member function exists with the same name, {@link swap swap}, overloading that
* algorithm with an optimization that behaves like this member function.
*
* @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated
* with the same template parameter, <b>T</b>) whose content is swapped with that of this
Expand Down Expand Up @@ -936,11 +936,10 @@ namespace std
namespace std
{
/**
* <p> An iterator of {@link Deque}. </p>
* An iterator of {@link Deque}.
*
* <p> <a href="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" target="_blank">
* <a href="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" target="_blank">
* <img src="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" style="max-width: 100%" /> </a>
* </p>
*
* @author Jeongho Nam <http://samchon.org>
*/
Expand All @@ -949,19 +948,20 @@ namespace std
implements base.IArrayIterator<T>
{
/**
* Sequence number of iterator in the source {@link Deque}.
* @hidden
*/
private index_: number;

/* ---------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------- */
/**
* <p> Construct from the source {@link Deque container}. </p>
* Construct from the source {@link Deque container}.
*
* <h4> Note </h4>
* <p> Do not create the iterator directly, by yourself. </p>
* <p> Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead. </p>
* #### Note
* Do not create the iterator directly, by yourself.
*
* Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.
*
* @param source The source {@link Deque container} to reference.
* @param index Sequence number of the element in the source {@link Deque}.
Expand Down Expand Up @@ -1078,11 +1078,10 @@ namespace std
namespace std
{
/**
* <p> A reverse-iterator of Deque. </p>
* A reverse-iterator of Deque.
*
* <p> <a href="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" target="_blank">
* <a href="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" target="_blank">
* <img src="http://samchon.github.io/tstl/images/design/class_diagram/linear_containers.png" style="max-width: 100%" /> </a>
* </p>
*
* @param <T> Type of the elements.
*
Expand Down
Loading

0 comments on commit 97aa9dd

Please sign in to comment.