CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
42 lines
2.2 KiB
TeX
42 lines
2.2 KiB
TeX
|
|
\subsection{Containers}
|
|
\label{sec:containers}
|
|
|
|
Several of the ParseAPI data structures export containers of CFG objects; the
|
|
CodeObject provides a list of functions in the binary, for example, while
|
|
functions provide lists of blocks and so on. To avoid tying the internal
|
|
storage for these structures to any particular container type, ParseAPI objects
|
|
export a ContainerWrapper that provides an iterator interface to the internal
|
|
containers. These wrappers and predicate interfaces are designed to add minimal
|
|
overhead while protecting ParseAPI users from exposure to internal container
|
|
storage details. Users \emph{must not} rely on properties of the underlying
|
|
container type (e.g. storage order) unless that property is explicity stated in
|
|
this manual.
|
|
|
|
\noindent
|
|
ContainerWrapper containers export the following interface (\code{iterator} types vary depending on the template parameters of the ContainerWrapper, but are always instantiations of the PredicateIterator described below):
|
|
|
|
\begin{apient}
|
|
iterator begin()
|
|
iterator begin(predicate *)
|
|
\end{apient}
|
|
\apidesc{Return an iterator pointing to the beginning of the container, with or without a filtering predicate implementation (see Section \ref{sec:pred} for details on filter predicates).}
|
|
|
|
\begin{apient}
|
|
iterator const& end()
|
|
\end{apient}
|
|
\apidesc{Return the iterator pointing to the end of the container (past the last element).}
|
|
|
|
\begin{apient}
|
|
size_t size()
|
|
\end{apient}
|
|
\apidesc{Returns the number of elements in the container. Execution cost may vary depending on the underlying container type.}
|
|
|
|
\begin{apient}
|
|
bool empty()
|
|
\end{apient}
|
|
\apidesc{Indicates whether the container is empty or not.}
|
|
|
|
\noindent
|
|
The elements in ParseAPI containers can be accessed by iteration using an instantiation of the PredicateIterator. These iterators can optionally act as filters, evaluating a boolean predicate for each element and only returning those elements for which the predicate returns {\scshape true}. \emph{Iterators with non-{\scshape null} predicates may return fewer elements during iteration than their \code{size()} method indicates.} Currently PredicateIterators only support forward iteration. The operators \code{++} (prefix and postfix), \code{==}, \code{!=}, and \code{*} (dereference) are supported.
|